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"));
739 this->SetCursor(wxNullCursor);
746 wxAutoBufferedPaintDC dc(
this);
748 dc.SetBackground(GetBackgroundColour());
750 wxSize vSize = GetClientSize();
754 dc.DrawBitmap(
bitmap,0,0);
763 wxRect visibleRect(GetViewStart(), vSize);
764 visibleRect.Inflate(20);
765 for(
size_t i=0; i<
m_points.size(); i++)
769 m_points[i].Draw(dc, visibleRect,
false);
783 dsp.
Draw(dc, visibleRect,
false,
true);
786 dc.SetLogicalFunction(wxINVERT);
787 dc.SetPen(wxPen(
"RED", 1, wxPENSTYLE_SOLID));
788 dc.SetBrush(wxBrush(
"WHITE", wxBRUSHSTYLE_TRANSPARENT));
790 upperLeft =
scale(upperLeft);
794 dc.DrawRectangle(upperLeft.x-width, upperLeft.y-width, 2*width, 2*width);
795 dc.SetLogicalFunction(wxCOPY);
812 dc.SetLogicalFunction(wxINVERT);
813 dc.SetPen(wxPen(
"WHITE", 1, wxPENSTYLE_SOLID));
814 dc.SetBrush(wxBrush(
"WHITE", wxBRUSHSTYLE_TRANSPARENT));
817 upperLeft =
scale(upperLeft);
822 dc.SetLogicalFunction(wxCOPY);
834 typedef vigra::RGBValue<vigra::UInt8> VT;
839 int magWidth = wxConfigBase::Get()->Read(
"/CPEditorPanel/MagnifierWidth",61l);
843 wxImage img(magWidth, magWidth);
844 vigra::BasicImageView<VT> magImg((VT*)img.GetData(), magWidth,magWidth);
845 vigra::BImage maskImg(magWidth, magWidth);
867 vigra::FindMinMax<vigra::UInt8> minmax;
872 vigra::linearRangeMapping(
873 VT(minmax.min), VT(minmax.max),
874 VT(0, 0, 0), VT(255, 255, 255))
880 for(
int x=0; x < magWidth; x++) {
881 VT p =magImg(x,hw+1);
882 vigra::UInt8 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
888 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
898 img = img.Rotate90(
true);
901 img = img.Rotate180();
904 img = img.Rotate90(
false);
947 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
985 if (img.GetWidth() == 0) {
988 imageSize = wxSize(img.GetWidth(), img.GetHeight());
1007 wxImageResizeQuality resizeQuality = wxIMAGE_QUALITY_NORMAL;
1008 if (
std::max(img.GetWidth(), img.GetHeight()) > (ULONG_MAX >> 16))
1014 resizeQuality = wxIMAGE_QUALITY_BOX_AVERAGE;
1024 img = img.Rotate90(
true);
1027 img = img.Rotate180();
1030 img = img.Rotate90(
false);
1092 DEBUG_DEBUG(
"trying to select invalid point nr: " << nr <<
". Nr of points: " <<
m_points.size());
1111 point =
scale(point);
1115 wxSize sz = GetClientSize();
1116 int scrollx = x - sz.GetWidth()/2;
1117 int scrolly = y - sz.GetHeight()/2;
1118 Scroll(scrollx, scrolly);
1121 GetViewStart(&sx, &sy);
1122 DEBUG_DEBUG(
"relative coordinages: " << x-sx <<
"," << y-sy);
1123 WarpPointer(x-sx,y-sy);
1132 for(
int i=
m_points.size()-1; i>=0; i--)
1134 if(
m_points[i].isOccupiedLabel(mousePos))
1141 for(std::vector<DisplayedControlPoint>::const_iterator it=
m_points.begin(); it!=
m_points.end(); ++it)
1143 if(it->isOccupiedPos(p))
1156 #if wxCHECK_VERSION(3,3,0)
1161 wxClientDC dc(
this);
1166 dc.SetPen(wxPen(*wxWHITE, 2, wxPENSTYLE_LONG_DASH));
1167 dc.SetBrush(*wxTRANSPARENT_BRUSH);
1170 dc.DrawRectangle(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);
1175 if (!
m_img.get())
return;
1176 wxPoint unScrolledMousePos;
1177 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1178 &unScrolledMousePos.x, & unScrolledMousePos.y);
1180 bool doUpdate =
false;
1190 if (mouse.LeftIsDown() && ! mouse.ShiftDown()) {
1193 DEBUG_DEBUG(
"mouse down movement without selection, in NO_SELECTION state!");
1196 if (mpos.x >= 0 && mpos.x <=
m_realSize.GetWidth()){
1198 }
else if (mpos.x < 0) {
1204 if (mpos.y >= 0 && mpos.y <=
m_realSize.GetHeight()){
1206 }
else if (mpos.y < 0) {
1208 }
else if (mpos.y >
m_realSize.GetHeight()) {
1219 DEBUG_DEBUG(
"WARNING: mouse move in new point state")
1237 if (mouse.MiddleIsDown())
1243 if (mouse.ShiftDown()) {
1268 unsigned int selPointNr;
1270 SetCursor(wxCursor(wxCURSOR_ARROW));
1286 if (!
m_img.get())
return;
1290 wxPoint unScrolledMousePos;
1291 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1292 &unScrolledMousePos.x, & unScrolledMousePos.y);
1301 unsigned int selPointNr = 0;
1320 DEBUG_DEBUG(
"click on new space, select new point");
1333 DEBUG_ERROR(
"invalid state " << clickState <<
" on mouse down");
1343 if (!
m_img.get())
return;
1358 if (!
m_img.get())
return;
1366 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1367 &mpos_.x, & mpos_.y);
1377 if (mouse.LeftUp()) {
1395 DEBUG_DEBUG(
"new Point changed (event fire): x:" << mpos.x <<
" y:" << mpos.y);
1422 DEBUG_DEBUG(
"middle mouse button released, leaving scroll mode")
1429 DEBUG_DEBUG(
"middle mouse button pressed, entering scroll mode")
1430 if (!
m_img.get())
return;
1441 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y, &mpos_.x, & mpos_.y);
1458 if (!
m_img.get())
return;
1460 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1461 &mpos_.x, & mpos_.y);
1467 if (mouse.RightUp())
1484 DEBUG_DEBUG(
"Emitting right click (rmb release)");
1493 if ( ProcessEvent( ev ) == FALSE ) {
1494 wxLogWarning( _(
"Could not process event!") );
1521 int w = size.GetWidth();
1522 int h = size.GetHeight();
1530 wxSize csize = GetSize();
1531 DEBUG_DEBUG(
"csize: " << csize.GetWidth() <<
"x" << csize.GetHeight() <<
"image: " << w <<
"x" <<
h);
1532 double s1 = (double)csize.GetWidth()/w;
1533 double s2 = (double)csize.GetHeight()/
h;
1535 return s1 < s2 ? s1 : s2;
1545 DEBUG_TRACE(
"size: " << e.GetSize().GetWidth() <<
"x" << e.GetSize().GetHeight());
1556 if (!
m_img.get())
return;
1560 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_LEFT ) delta.x = -1;
1561 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_RIGHT ) delta.x = 1;
1562 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_UP ) delta.y = -1;
1563 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_DOWN ) delta.y = 1;
1564 if ( (delta.x != 0 || delta.y != 0 ) && (e.ShiftDown() || e.CmdDown())) {
1566 double speed = (double) GetClientSize().GetWidth()/10;
1567 delta.x = (int) (delta.x * speed);
1568 delta.y = (int) (delta.y * speed);
1569 if (e.ShiftDown()) {
1574 }
else if (e.CmdDown()) {
1577 }
else if (delta.x != 0 || delta.y != 0 ) {
1615 else if (e.m_keyCode ==
'a') {
1616 DEBUG_DEBUG(
"adding point with a key, faking right click");
1622 else if (e.m_keyCode==WXK_ESCAPE) {
1627 bool forward =
false;
1628 switch (e.GetKeyCode())
1651 e.SetEventObject(
this);
1653 <<
" origin: id:" << e.GetId() <<
" obj: "
1654 << e.GetEventObject());
1667 if (!
m_img.get())
return;
1668 if (e.m_keyCode == WXK_SHIFT || e.m_keyCode == WXK_CONTROL) {
1669 DEBUG_DEBUG(
"shift or control down, reseting scoll position");
1740 GetViewStart( &x, &y );
1742 wxSize winSize = GetClientSize();
1744 imgSize.x =
bitmap.GetWidth();
1745 imgSize.y =
bitmap.GetHeight();
1747 if (x + delta.x < 0) {
1750 if (y + delta.y < 0) {
1754 int right = x + delta.x + winSize.x ;
1755 if (right > imgSize.x) {
1756 delta.x = imgSize.x - right;
1761 int bottom = y + delta.y + winSize.y ;
1762 if (bottom > imgSize.y) {
1763 delta.y = imgSize.y - bottom;
1774 if (delta.x == 0 && delta.y == 0) {
1778 GetViewStart( &x, &y );
1799 return m_img->get8BitImage();
1815 : wxXmlResourceHandler()
1824 cp->Create(m_parentAsWindow,
1826 GetPosition(), GetSize(),
1837 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)
const cmsHPROFILE GetMonitorProfile() const
returns the monitor profile, if no monitor profile was found the sRGB profile is used instead ...
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)
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 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