28 #include "hugin_config.h"
34 #include <wx/dcbuffer.h>
36 #include <vigra/inspectimage.hxx>
37 #include <vigra/transformimage.hxx>
38 #include <vigra/basicimageview.hxx>
58 SetEventType( EVT_CPEVENT );
59 SetEventObject( (wxWindow *) NULL );
65 SetEventType(EVT_CPEVENT);
72 SetEventType( EVT_CPEVENT );
73 SetEventObject( win );
80 SetEventType( EVT_CPEVENT );
81 SetEventObject( win );
88 SetEventType( EVT_CPEVENT );
89 SetEventObject( win );
97 SetEventType(EVT_CPEVENT);
106 SetEventType(EVT_CPEVENT);
114 SetEventType(EVT_CPEVENT);
122 SetEventType(EVT_CPEVENT);
160 dc.DrawLine(p + wxPoint(-l, 0),
162 dc.DrawLine(p + wxPoint(2, 0),
163 p + wxPoint(l+1, 0));
164 dc.DrawLine(p + wxPoint(0, -l),
166 dc.DrawLine(p + wxPoint(0, 2),
167 p + wxPoint(0, l+1));
179 bool drawMag =
false;
182 bgColor = wxTheColourDatabase->Find(
"RED");
183 textColor = wxTheColourDatabase->Find(
"WHITE");
188 bgColor = wxTheColourDatabase->Find(
"YELLOW");
189 textColor = wxTheColourDatabase->Find(
"BLACK");
193 dc.SetPen(wxPen(
"WHITE", 1, wxPENSTYLE_SOLID));
194 dc.SetBrush(wxBrush(
"BLACK",wxBRUSHSTYLE_TRANSPARENT));
199 hugin_utils::FDiff2D pointInput2;
207 const wxRect lineRect(p, p2);
208 if (!visibleRect.Intersects(lineRect))
219 if (!visibleRect.Contains(p))
238 box.setSize(2*l, 2*l);
242 if(box.width()<=0 || box.height()<=0)
247 vigra::FindAverage<vigra::UInt8> average;
248 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> > lumac;
254 dc.SetPen(wxPen(
"WHITE", 1, wxPENSTYLE_SOLID));
258 dc.SetPen(wxPen(
"BLACK", 1, wxPENSTYLE_SOLID));
289 wxSize clientSize =
m_control->GetClientSize();
292 wxFont font(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT);
294 wxPoint pClient(p.x - vx0, p.y - vy0);
296 int maxDistUR =
std::min(clientSize.x - pClient.x, pClient.y);
297 int maxDistLL =
std::min(pClient.x, clientSize.y - pClient.y);
298 int maxDistLR =
std::min(clientSize.x - pClient.x, clientSize.y - pClient.y);
303 wxPoint tul = p + wxPoint(toff,toff);
309 dc.GetTextExtent(
m_label, &tw, &th);
317 int w = toff + magBitmap.GetWidth()+3;
319 if ( maxDistLR > w + db )
321 ulMag = p + wxPoint(toff,toff);
325 if (maxDistLL > w + db)
327 ulMag = p + wxPoint(-w, toff);
331 if (maxDistUR > w + db)
333 ulMag = p + wxPoint(toff, -w);
337 ulMag = p + wxPoint(-w, -w);
342 dc.DrawBitmap(magBitmap, ulMag);
343 dc.SetPen(wxPen(
"BLACK", 1, wxPENSTYLE_SOLID));
344 dc.SetBrush(wxBrush(
"WHITE",wxBRUSHSTYLE_TRANSPARENT));
347 int bw = magBitmap.GetWidth();
348 int bh = magBitmap.GetHeight();
349 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
350 ulMag.x+bw+1, ulMag.y+bh);
351 dc.DrawLine(ulMag.x+bw, ulMag.y+bh,
352 ulMag.x+bw, ulMag.y-2);
353 dc.SetPen(wxPen(
"WHITE", 1, wxPENSTYLE_SOLID));
354 dc.DrawLine(ulMag.x-1, ulMag.y-1,
355 ulMag.x+bw+1, ulMag.y-1);
356 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
357 ulMag.x-1, ulMag.y-2);
361 int w = toff+tw+2*tB;
362 if ( maxDistLR > w + db && (!drawMag) )
364 tul = p + wxPoint(toff,toff);
368 if (maxDistLL > w + db)
370 tul = p + wxPoint(-w, toff);
374 if (maxDistUR > w + db)
376 tul = p + wxPoint(toff, -(toff) - (th+2*tB));
380 tul = p + wxPoint(-w, -(toff) - (th+2*tB));
386 dc.SetPen(wxPen(textColour, 1, wxPENSTYLE_SOLID));
387 dc.SetBrush(wxBrush(bgColour, wxBRUSHSTYLE_SOLID));
388 dc.DrawRectangle(tul.x, tul.y, tw+2*tB+1, th+2*tB);
389 labelPos.SetLeft(tul.x);
390 labelPos.SetTop(tul.y);
391 labelPos.SetWidth(tw+2*tB+1);
392 labelPos.SetHeight(th+2*tB);
394 dc.SetTextForeground(textColour);
395 dc.DrawText(
m_label, tul + wxPoint(tB,tB));
426 wxPoint* points=
new wxPoint[len+1];
427 for(
size_t i=0; i<len+1; i++)
451 dc.DrawLines(len+1, points);
452 dc.DestroyClippingRegion();
466 hugin_utils::FDiff2D p1, p2, dp;
480 int image_dimension=
std::min(image_width, image_height);
488 if(length > 0.05f * image_dimension && length < 0.75f * image_dimension)
502 wxPoint* points=
new wxPoint[2*line_length+1];
503 for(
size_t i=0; i<2*line_length+1; i++)
505 hugin_utils::FDiff2D p = p1 + dp*f*(((double)i - line_length) / (2.0f*line_length));
515 dc.DrawLines(2*line_length+1, points);
516 dc.DestroyClippingRegion();
652 const wxString& name)
654 wxScrolledWindow::Create(parent,
id, pos, size, style, name);
667 SetBackgroundStyle(wxBG_STYLE_PAINT);
671 #if defined(__WXMSW__)
680 pointColors.push_back(wxTheColourDatabase->Find(
"BLUE"));
681 textColours.push_back(wxTheColourDatabase->Find(
"WHITE"));
683 pointColors.push_back(wxTheColourDatabase->Find(
"GREEN"));
684 textColours.push_back(wxTheColourDatabase->Find(
"WHITE"));
686 pointColors.push_back(wxTheColourDatabase->Find(
"CYAN"));
687 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
688 pointColors.push_back(wxTheColourDatabase->Find(
"GOLD"));
689 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
691 pointColors.push_back(wxTheColourDatabase->Find(
"NAVY"));
692 textColours.push_back(wxTheColourDatabase->Find(
"WHITE"));
694 pointColors.push_back(wxTheColourDatabase->Find(
"DARK TURQUOISE"));
695 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
697 pointColors.push_back(wxTheColourDatabase->Find(
"SALMON"));
698 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
700 pointColors.push_back(wxTheColourDatabase->Find(
"MAROON"));
701 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
703 pointColors.push_back(wxTheColourDatabase->Find(
"KHAKI"));
704 textColours.push_back(wxTheColourDatabase->Find(
"BLACK"));
741 this->SetCursor(wxNullCursor);
748 wxAutoBufferedPaintDC dc(
this);
750 dc.SetBackground(GetBackgroundColour());
752 wxSize vSize = GetClientSize();
756 dc.DrawBitmap(
bitmap,0,0);
765 wxRect visibleRect(GetViewStart(), vSize);
766 visibleRect.Inflate(20);
767 for(
size_t i=0; i<
m_points.size(); i++)
771 m_points[i].Draw(dc, visibleRect,
false);
785 dsp.
Draw(dc, visibleRect,
false,
true);
788 dc.SetLogicalFunction(wxINVERT);
789 dc.SetPen(wxPen(
"RED", 1, wxPENSTYLE_SOLID));
790 dc.SetBrush(wxBrush(
"WHITE", wxBRUSHSTYLE_TRANSPARENT));
792 upperLeft =
scale(upperLeft);
796 dc.DrawRectangle(upperLeft.x-width, upperLeft.y-width, 2*width, 2*width);
797 dc.SetLogicalFunction(wxCOPY);
814 dc.SetLogicalFunction(wxINVERT);
815 dc.SetPen(wxPen(
"WHITE", 1, wxPENSTYLE_SOLID));
816 dc.SetBrush(wxBrush(
"WHITE", wxBRUSHSTYLE_TRANSPARENT));
819 upperLeft =
scale(upperLeft);
824 dc.SetLogicalFunction(wxCOPY);
836 typedef vigra::RGBValue<vigra::UInt8> VT;
841 int magWidth = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth",61l);
845 wxImage img(magWidth, magWidth);
846 vigra::BasicImageView<VT> magImg((VT*)img.GetData(), magWidth,magWidth);
847 vigra::BImage maskImg(magWidth, magWidth);
869 vigra::FindMinMax<vigra::UInt8> minmax;
874 vigra::linearRangeMapping(
875 VT(minmax.min), VT(minmax.max),
876 VT(0, 0, 0), VT(255, 255, 255))
882 for(
int x=0; x < magWidth; x++) {
883 VT p =magImg(x,hw+1);
884 vigra::UInt8 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
890 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
900 img = img.Rotate90(
true);
903 img = img.Rotate180();
906 img = img.Rotate90(
false);
949 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
987 if (img.GetWidth() == 0) {
990 imageSize = wxSize(img.GetWidth(), img.GetHeight());
1009 wxImageResizeQuality resizeQuality = wxIMAGE_QUALITY_NORMAL;
1010 if (
std::max(img.GetWidth(), img.GetHeight()) > (ULONG_MAX >> 16))
1016 resizeQuality = wxIMAGE_QUALITY_BOX_AVERAGE;
1026 img = img.Rotate90(
true);
1029 img = img.Rotate180();
1032 img = img.Rotate90(
false);
1041 vigra::ImageImportInfo::ICCProfile iccProfile;
1043 if (
m_img->imageFloat->width() == 0)
1045 iccProfile = *(
m_img->iccProfile);
1100 DEBUG_DEBUG(
"trying to select invalid point nr: " << nr <<
". Nr of points: " <<
m_points.size());
1119 point =
scale(point);
1123 wxSize sz = GetClientSize();
1124 int scrollx = x - sz.GetWidth()/2;
1125 int scrolly = y - sz.GetHeight()/2;
1126 Scroll(scrollx, scrolly);
1129 GetViewStart(&sx, &sy);
1130 DEBUG_DEBUG(
"relative coordinages: " << x-sx <<
"," << y-sy);
1131 WarpPointer(x-sx,y-sy);
1140 for(
int i=
m_points.size()-1; i>=0; i--)
1142 if(
m_points[i].isOccupiedLabel(mousePos))
1149 for(std::vector<DisplayedControlPoint>::const_iterator it=
m_points.begin(); it!=
m_points.end(); ++it)
1151 if(it->isOccupiedPos(p))
1164 #if wxCHECK_VERSION(3,3,0)
1169 wxClientDC dc(
this);
1174 dc.SetPen(wxPen(*wxWHITE, 2, wxPENSTYLE_LONG_DASH));
1175 dc.SetBrush(*wxTRANSPARENT_BRUSH);
1178 dc.DrawRectangle(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);
1183 if (!
m_img.get())
return;
1184 wxPoint unScrolledMousePos;
1185 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1186 &unScrolledMousePos.x, & unScrolledMousePos.y);
1188 bool doUpdate =
false;
1198 if (mouse.LeftIsDown() && ! mouse.ShiftDown()) {
1201 DEBUG_DEBUG(
"mouse down movement without selection, in NO_SELECTION state!");
1204 if (mpos.x >= 0 && mpos.x <=
m_realSize.GetWidth()){
1206 }
else if (mpos.x < 0) {
1212 if (mpos.y >= 0 && mpos.y <=
m_realSize.GetHeight()){
1214 }
else if (mpos.y < 0) {
1216 }
else if (mpos.y >
m_realSize.GetHeight()) {
1227 DEBUG_DEBUG(
"WARNING: mouse move in new point state")
1245 if (mouse.MiddleIsDown())
1251 if (mouse.ShiftDown()) {
1276 unsigned int selPointNr;
1278 SetCursor(wxCursor(wxCURSOR_ARROW));
1294 if (!
m_img.get())
return;
1298 wxPoint unScrolledMousePos;
1299 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1300 &unScrolledMousePos.x, & unScrolledMousePos.y);
1309 unsigned int selPointNr = 0;
1328 DEBUG_DEBUG(
"click on new space, select new point");
1341 DEBUG_ERROR(
"invalid state " << clickState <<
" on mouse down");
1351 if (!
m_img.get())
return;
1366 if (!
m_img.get())
return;
1374 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1375 &mpos_.x, & mpos_.y);
1385 if (mouse.LeftUp()) {
1403 DEBUG_DEBUG(
"new Point changed (event fire): x:" << mpos.x <<
" y:" << mpos.y);
1430 DEBUG_DEBUG(
"middle mouse button released, leaving scroll mode")
1437 DEBUG_DEBUG(
"middle mouse button pressed, entering scroll mode")
1438 if (!
m_img.get())
return;
1449 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y, &mpos_.x, & mpos_.y);
1466 if (!
m_img.get())
return;
1468 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1469 &mpos_.x, & mpos_.y);
1475 if (mouse.RightUp())
1492 DEBUG_DEBUG(
"Emitting right click (rmb release)");
1501 if ( ProcessEvent( ev ) == FALSE ) {
1502 wxLogWarning( _(
"Could not process event!") );
1529 int w = size.GetWidth();
1530 int h = size.GetHeight();
1538 wxSize csize = GetSize();
1539 DEBUG_DEBUG(
"csize: " << csize.GetWidth() <<
"x" << csize.GetHeight() <<
"image: " << w <<
"x" <<
h);
1540 double s1 = (double)csize.GetWidth()/w;
1541 double s2 = (double)csize.GetHeight()/
h;
1543 return s1 < s2 ? s1 : s2;
1572 if (!
m_img.get())
return;
1576 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_LEFT ) delta.x = -1;
1577 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_RIGHT ) delta.x = 1;
1578 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_UP ) delta.y = -1;
1579 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_DOWN ) delta.y = 1;
1580 if ( (delta.x != 0 || delta.y != 0 ) && (e.ShiftDown() || e.CmdDown())) {
1582 double speed = (double) GetClientSize().GetWidth()/10;
1583 delta.x = (int) (delta.x * speed);
1584 delta.y = (int) (delta.y * speed);
1585 if (e.ShiftDown()) {
1590 }
else if (e.CmdDown()) {
1593 }
else if (delta.x != 0 || delta.y != 0 ) {
1631 else if (e.m_keyCode ==
'a') {
1632 DEBUG_DEBUG(
"adding point with a key, faking right click");
1638 else if (e.m_keyCode==WXK_ESCAPE) {
1643 bool forward =
false;
1644 switch (e.GetKeyCode())
1667 e.SetEventObject(
this);
1669 <<
" origin: id:" << e.GetId() <<
" obj: "
1670 << e.GetEventObject());
1683 if (!
m_img.get())
return;
1684 if (e.m_keyCode == WXK_SHIFT || e.m_keyCode == WXK_CONTROL) {
1685 DEBUG_DEBUG(
"shift or control down, reseting scoll position");
1756 GetViewStart( &x, &y );
1758 wxSize winSize = GetClientSize();
1760 imgSize.x =
bitmap.GetWidth();
1761 imgSize.y =
bitmap.GetHeight();
1763 if (x + delta.x < 0) {
1766 if (y + delta.y < 0) {
1770 int right = x + delta.x + winSize.x ;
1771 if (right > imgSize.x) {
1772 delta.x = imgSize.x - right;
1777 int bottom = y + delta.y + winSize.y ;
1778 if (bottom > imgSize.y) {
1779 delta.y = imgSize.y - bottom;
1790 if (delta.x == 0 && delta.y == 0) {
1794 GetViewStart( &x, &y );
1815 return m_img->get8BitImage();
1831 : wxXmlResourceHandler()
1840 cp->Create(m_parentAsWindow,
1842 GetPosition(), GetSize(),
1853 return IsOfClass(node,
"CPImageCtrl");
wxDEFINE_EVENT(EVT_QUEUE_PROGRESS, wxCommandEvent)
void ScrollDelta(const wxPoint &delta)
scroll the window by delta pixels
bool FileExists(const std::string &filename)
checks if file exists
Dummy progress display, without output.
double calcAutoScaleFactor(wxSize size)
calculate new scale factor for this image
wxColour m_pointColour
colour of the point
HuginBase::PTools::Transform * getFirstInvTrans() const
DisplayedControlPoint()
default constructor
wxSize DoGetBestSize() const
int invScale(int x) const
void setNewPoint(const hugin_utils::FDiff2D &p)
set new point to a specific point
ImageRotation m_imgRotation
void transformImage(vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::ProgressDisplay *progress, bool singleThreaded=false)
Transform an image into the panorama.
#define HUGIN_FT_SEARCH_AREA_PERCENT
hugin_utils::FDiff2D GetPos() const
returns selected position
void deselect()
remove selection.
void SetColour(wxColour pointColour, wxColour textColour)
set colours for drawing control points
void OnKeyDown(wxKeyEvent &e)
double getScaleFactor() const
get scale factor (calculates factor when fit to window is active)
ImageCache::RequestPtr m_imgRequest
const bool GetForceMagnifier() const
control point editor panel.
bool operator==(const DisplayedControlPoint other)
compare operator
wxBitmap & GetMagBitmap(hugin_utils::FDiff2D point)
draw the magnified view of a selected control point
void Draw(wxDC &dc, const wxRect &visibleRect, bool selected, bool newPoint=false)
draw the control points to the given device context
const bool IsMirrored() const
return true, if cp is used with mirrored coordinates by current CPImageCtrl
virtual wxEvent * Clone() const
void selectPoint(unsigned int, bool scrollTo=true)
select a point for usage
Events to notify about new point / region / point change.
void mousePressLMBEvent(wxMouseEvent &mouse)
bool m_sameImage
true, if in control point tab the same image is selected 2 times in this case a special treatment for...
void DrawSelectionRectangle(hugin_utils::FDiff2D pos1, hugin_utils::FDiff2D pos2)
void OnSizeFinished(wxTimerEvent &e)
hugin_utils::FDiff2D m_magImgCenter
include file for the hugin project
helper class to display and manipulate cp in cp tab
EditorState isOccupied(wxPoint mousePos, const hugin_utils::FDiff2D &point, unsigned int &pointNr) const
check if p is over a known point, if it is, pointNr contains the point
EditorState
state machine for selection process:
represents a control point
wxCursor * m_CPSelectCursor
void GetMonitorProfile(wxString &profileName, cmsHPROFILE &profile)
void mousePressRMBEvent(wxMouseEvent &mouse)
void mouseMoveEvent(wxMouseEvent &mouse)
void DrawLineSegment(wxDC &dc)
draw line control point over different images
static huginApp * Get()
hack.. kind of a pseudo singleton...
ImageCache::EntryPtr m_img
const wxSize GetRealImageSize() const
return the real size of the image in the control
bool m_mirrored
is first or second image in cp used
void OnImageLoaded(ImageCache::EntryPtr entry, std::string filename, bool load_small)
HuginBase::ImageCache::ImageCacheRGB8Ptr GetImg()
get pointer to image, for DisplayedControlPoint
void SetControl(CPImageCtrl *control)
remember the control, where the information should be drawn
void UpdateControlPointY(double y)
update y coordinate of selected cp coordinate
const bool isOccupiedLabel(const wxPoint mousePos) const
check if given point is over label of cp, using screen coordinates
const bool GetMouseInWindow() const
void mouseReleaseLMBEvent(wxMouseEvent &mouse)
std::vector< DisplayedControlPoint > m_points
void clearNewPoint()
clear new point
std::string imageFilename
void OnMouseLeave(wxMouseEvent &e)
double getScale()
return scale factor, 0 for autoscale
CPImageCtrl * m_control
pointer to control to access some functions
void CheckSelection(const wxPoint mousePos, const hugin_utils::FDiff2D &p)
used by manipulating line control points, remember if the selected point given in screen coordinates ...
#define HUGIN_FT_TEMPLATE_SIZE
void CorrectImage(wxImage &image, const vigra::ImageImportInfo::ICCProfile &iccProfile, const cmsHPROFILE &monitorProfile)
apply color correction to given image using input iccProfile and monitor profile
void Init(CPEditorPanel *parent)
void clearCtrlPointList()
clear internal control point list
HuginBase::PTools::Transform * m_firstInvTrans
std::shared_ptr< vigra::BRGBImage > ImageCacheRGB8Ptr
use reference counted pointers
std::vector< wxColour > pointColors
virtual wxObject * DoCreateResource()
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
void ShiftControlPoint(hugin_utils::FDiff2D shift)
shift selected cp coordinate by given
wxImage imageCacheEntry2wxImage(ImageCache::EntryPtr e)
HuginBase::PTools::Transform * getSecondInvTrans() const
T applyRot(const T &p) const
void showTemplateArea(bool show=true)
wxPoint MaxScrollDelta(wxPoint delta)
calculate maximum delta that is allowed when scrolling
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
void OnMouseEnter(wxMouseEvent &e)
bool HasMonitorProfile() const
return true if we found a suitable monitor profile and could loading it
wxRect m_labelPos
position of the point labels (in screen coordinates)
evaluate x, points are on a vertical line
void DrawCross(wxDC &dc, wxPoint p, int l)
hugin_utils::FDiff2D rectStartPos
const wxString GetLabel() const
return label
TDiff2D< double > FDiff2D
void transformImageIntern(vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, TRANSFORM &transform, PixelTransform &pixelTransform, vigra::Diff2D destUL, Interpolator interp, bool warparound, AppBase::ProgressDisplay *progress, bool singleThreaded)
Transform an image into the panorama.
void mouseReleaseRMBEvent(wxMouseEvent &mouse)
vigra::pair< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImage(ROIImage< Image, Alpha > &img)
T applyRotInv(const T &p) const
vigra::triple< typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::image_const_traverser, typename ROIImage< Image, Mask >::ImageConstAccessor > srcImageRange(const ROIImage< Image, Mask > &img)
helper function for ROIImages
void setTransforms(HuginBase::PTools::Transform *firstTrans, HuginBase::PTools::Transform *firstInvTrans, HuginBase::PTools::Transform *secondInvTrans)
void showSearchArea(bool show=true)
show/hide the search area rectangle
const wxSize GetBitmapSize() const
return the size of the drawn bitmap (possible rotate is applied)
const HuginBase::ControlPoint GetControlPoint() const
returns the control point
void OnPaint(wxPaintEvent &e)
paint event
wxColour m_textColour
colour of the text background
HuginBase::PTools::Transform * m_magTrans
HuginBase::ControlPoint m_cp
void OnKey(wxKeyEvent &e)
hugin_utils::FDiff2D getNewPoint()
get the new point
void OnSize(wxSizeEvent &e)
HuginBase::PTools::Transform * m_magInvTrans
void DrawLine(wxDC &dc)
draw line control point on same image
include file for the hugin project
std::vector< wxColour > textColours
HuginBase::PTools::Transform * m_secondInvTrans
virtual bool CanHandle(wxXmlNode *node)
void StartLineControlPoint(hugin_utils::FDiff2D newPoint)
starts a new line control point with given coodinates
bool IsDrawingLine() const
return true, if line cp should be drawn as separate line
bool emit(CPEvent &ev)
helper func to emit a region
HuginBase::ControlPoint m_cp
representation of underlying control point
void setCtrlPoint(const HuginBase::ControlPoint &cp, const bool mirrored)
add control piont to internal cp list
wxRect DrawTextMag(wxDC &dc, wxPoint p, hugin_utils::FDiff2D pointInput, bool drawMag, wxColour pointColour, wxColour textColour)
draw magnified area
const bool isOccupiedPos(const hugin_utils::FDiff2D &p) const
check if the given point is over the drawn cp, using image coordinates
hugin_utils::FDiff2D newPoint
void mousePressMMBEvent(wxMouseEvent &mouse)
void setScale(double factor)
set the scaling factor for cp display.
vigra::triple< typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::image_traverser, typename ROIImage< Image, Alpha >::ImageAccessor > destImageRange(ROIImage< Image, Alpha > &img)
void OnTimer(wxTimerEvent &e)
void setImage(const std::string &filename, ImageRotation rot)
display img.
void setMagTransforms(HuginBase::PTools::Transform *magTrans, HuginBase::PTools::Transform *magInvTrans)
void showPosition(hugin_utils::FDiff2D point, bool warpPointer=false)
Show point x, y.
DisplayedControlPoint m_selectedPoint
CPEditorPanel * m_editPanel
void setSameImage(bool sameImage)
void OnScrollWin(wxScrollWinEvent &e)
const wxString & GetXRCPath()
return the current xrc path
bool m_line
true, if line control point on same image
hugin_utils::FDiff2D point
HuginBase::PTools::Transform * getFirstTrans() const
wxPoint roundP(const hugin_utils::FDiff2D &p) const
void UpdateControlPoint(hugin_utils::FDiff2D newPoint)
update selected cp coordinate
void UpdateControlPointX(double x)
update x coordinate of selected cp coordinate
void mouseReleaseMMBEvent(wxMouseEvent &mouse)
bool IsShowingLines() const
ImageRotation
image rotation.
wxString m_label
label of displayed control point: number or new
unsigned int selectedPointNr
hugin_utils::FDiff2D m_mousePos
T squareDistance(TDiff2D< T > other) const
Return square of the distance to another point.
void ShowLines(bool isShown)
HuginBase::PTools::Transform * m_firstTrans
void SetLabel(wxString newLabel)
set label to given wxString