28 #include "hugin_config.h"
35 #include <vigra/inspectimage.hxx>
36 #include <vigra/transformimage.hxx>
37 #include <vigra/basicimageview.hxx>
53 #if defined _WIN32 && defined Hugin_shared
62 SetEventObject( (wxWindow *) NULL );
76 SetEventObject( win );
84 SetEventObject( win );
92 SetEventObject( win );
163 dc.DrawLine(p + wxPoint(-l, 0),
165 dc.DrawLine(p + wxPoint(2, 0),
166 p + wxPoint(l+1, 0));
167 dc.DrawLine(p + wxPoint(0, -l),
169 dc.DrawLine(p + wxPoint(0, 2),
170 p + wxPoint(0, l+1));
182 bool drawMag =
false;
185 bgColor = wxTheColourDatabase->Find(wxT(
"RED"));
186 textColor = wxTheColourDatabase->Find(wxT(
"WHITE"));
191 bgColor = wxTheColourDatabase->Find(wxT(
"YELLOW"));
192 textColor = wxTheColourDatabase->Find(wxT(
"BLACK"));
196 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
197 dc.SetBrush(wxBrush(wxT(
"BLACK"),wxBRUSHSTYLE_TRANSPARENT));
202 hugin_utils::FDiff2D pointInput2;
210 const wxRect lineRect(p, p2);
211 if (!visibleRect.Intersects(lineRect))
222 if (!visibleRect.Contains(p))
241 box.setSize(2*l, 2*l);
245 if(box.width()<=0 || box.height()<=0)
250 vigra::FindAverage<vigra::UInt8> average;
251 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> > lumac;
257 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
261 dc.SetPen(wxPen(wxT(
"BLACK"), 1, wxPENSTYLE_SOLID));
292 wxSize clientSize =
m_control->GetClientSize();
295 wxFont font(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT);
297 wxPoint pClient(p.x - vx0, p.y - vy0);
299 int maxDistUR =
std::min(clientSize.x - pClient.x, pClient.y);
300 int maxDistLL =
std::min(pClient.x, clientSize.y - pClient.y);
301 int maxDistLR =
std::min(clientSize.x - pClient.x, clientSize.y - pClient.y);
306 wxPoint tul = p + wxPoint(toff,toff);
312 dc.GetTextExtent(
m_label, &tw, &th);
320 int w = toff + magBitmap.GetWidth()+3;
322 if ( maxDistLR > w + db )
324 ulMag = p + wxPoint(toff,toff);
328 if (maxDistLL > w + db)
330 ulMag = p + wxPoint(-w, toff);
334 if (maxDistUR > w + db)
336 ulMag = p + wxPoint(toff, -w);
340 ulMag = p + wxPoint(-w, -w);
345 dc.DrawBitmap(magBitmap, ulMag);
346 dc.SetPen(wxPen(wxT(
"BLACK"), 1, wxPENSTYLE_SOLID));
347 dc.SetBrush(wxBrush(wxT(
"WHITE"),wxBRUSHSTYLE_TRANSPARENT));
350 int bw = magBitmap.GetWidth();
351 int bh = magBitmap.GetHeight();
352 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
353 ulMag.x+bw+1, ulMag.y+bh);
354 dc.DrawLine(ulMag.x+bw, ulMag.y+bh,
355 ulMag.x+bw, ulMag.y-2);
356 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
357 dc.DrawLine(ulMag.x-1, ulMag.y-1,
358 ulMag.x+bw+1, ulMag.y-1);
359 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
360 ulMag.x-1, ulMag.y-2);
364 int w = toff+tw+2*tB;
365 if ( maxDistLR > w + db && (!drawMag) )
367 tul = p + wxPoint(toff,toff);
371 if (maxDistLL > w + db)
373 tul = p + wxPoint(-w, toff);
377 if (maxDistUR > w + db)
379 tul = p + wxPoint(toff, -(toff) - (th+2*tB));
383 tul = p + wxPoint(-w, -(toff) - (th+2*tB));
389 dc.SetPen(wxPen(textColour, 1, wxPENSTYLE_SOLID));
390 dc.SetBrush(wxBrush(bgColour, wxBRUSHSTYLE_SOLID));
391 dc.DrawRectangle(tul.x, tul.y, tw+2*tB+1, th+2*tB);
392 labelPos.SetLeft(tul.x);
393 labelPos.SetTop(tul.y);
394 labelPos.SetWidth(tw+2*tB+1);
395 labelPos.SetHeight(th+2*tB);
397 dc.SetTextForeground(textColour);
398 dc.DrawText(
m_label, tul + wxPoint(tB,tB));
429 wxPoint* points=
new wxPoint[len+1];
430 for(
size_t i=0; i<len+1; i++)
454 dc.DrawLines(len+1, points);
455 dc.DestroyClippingRegion();
469 hugin_utils::FDiff2D p1, p2, dp;
483 int image_dimension=
std::min(image_width, image_height);
491 if(length > 0.05f * image_dimension && length < 0.75f * image_dimension)
505 wxPoint* points=
new wxPoint[2*line_length+1];
506 for(
size_t i=0; i<2*line_length+1; i++)
508 hugin_utils::FDiff2D p = p1 + dp*f*(((double)i - line_length) / (2.0f*line_length));
518 dc.DrawLines(2*line_length+1, points);
519 dc.DestroyClippingRegion();
676 const wxString& name)
678 wxScrolledWindow::Create(parent,
id, pos, size, style, name);
683 m_showSearchArea =
false;
684 m_searchRectWidth = 0;
685 m_showTemplateArea =
false;
686 m_templateRectWidth = 0;
688 m_imgRotation = ROT0;
694 #if defined(__WXMSW__)
696 m_CPSelectCursor =
new wxCursor(cursorPath, wxBITMAP_TYPE_CUR);
698 m_CPSelectCursor =
new wxCursor(wxCURSOR_CROSS);
700 SetCursor(*m_CPSelectCursor);
703 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"BLUE")));
704 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
706 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GREEN")));
707 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
709 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"CYAN")));
710 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
711 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GOLD")));
712 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
714 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"NAVY")));
715 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
717 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"DARK TURQUOISE")));
718 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
720 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"SALMON")));
721 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
723 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"MAROON")));
724 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
726 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"KHAKI")));
727 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
729 m_searchRectWidth = 120;
730 m_mouseInWindow =
false;
731 m_forceMagnifier =
false;
732 m_timer.SetOwner(
this);
747 this->SetCursor(wxNullCursor);
754 wxSize vSize = GetClientSize();
758 if (
bitmap.GetWidth() < vSize.GetWidth()) {
759 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
760 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
761 dc.DrawRectangle(
bitmap.GetWidth(), 0,
762 vSize.GetWidth() -
bitmap.GetWidth(),vSize.GetHeight());
765 if (
bitmap.GetHeight() < vSize.GetHeight()) {
766 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
767 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
768 dc.DrawRectangle(0,
bitmap.GetHeight(),
769 vSize.GetWidth(), vSize.GetHeight() -
bitmap.GetHeight());
771 dc.DrawBitmap(
bitmap,0,0);
774 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
775 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
781 wxRect visibleRect(GetViewStart(), vSize);
782 visibleRect.Inflate(20);
783 for(
size_t i=0; i<
m_points.size(); i++)
787 m_points[i].Draw(dc, visibleRect,
false);
801 dsp.
Draw(dc, visibleRect,
false,
true);
804 dc.SetLogicalFunction(wxINVERT);
805 dc.SetPen(wxPen(wxT(
"RED"), 1, wxPENSTYLE_SOLID));
806 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
808 upperLeft =
scale(upperLeft);
812 dc.DrawRectangle(upperLeft.x-width, upperLeft.y-width, 2*width, 2*width);
813 dc.SetLogicalFunction(wxCOPY);
830 dc.SetLogicalFunction(wxINVERT);
831 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
832 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
835 upperLeft =
scale(upperLeft);
840 dc.SetLogicalFunction(wxCOPY);
852 typedef vigra::RGBValue<vigra::UInt8> VT;
857 int magWidth = wxConfigBase::Get()->Read(wxT(
"/CPEditorPanel/MagnifierWidth"),61l);
861 wxImage img(magWidth, magWidth);
862 vigra::BasicImageView<VT> magImg((VT*)img.GetData(), magWidth,magWidth);
863 vigra::BImage maskImg(magWidth, magWidth);
885 vigra::FindMinMax<vigra::UInt8> minmax;
890 vigra::linearRangeMapping(
891 VT(minmax.min), VT(minmax.max),
892 VT(0, 0, 0), VT(255, 255, 255))
898 for(
int x=0; x < magWidth; x++) {
899 VT p =magImg(x,hw+1);
900 vigra::UInt8 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
906 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
916 img = img.Rotate90(
true);
919 img = img.Rotate180();
922 img = img.Rotate90(
false);
965 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
1003 if (img.GetWidth() == 0) {
1006 imageSize = wxSize(img.GetWidth(), img.GetHeight());
1025 wxImageResizeQuality resizeQuality = wxIMAGE_QUALITY_NORMAL;
1026 if (
std::max(img.GetWidth(), img.GetHeight()) > (ULONG_MAX >> 16))
1032 resizeQuality = wxIMAGE_QUALITY_BOX_AVERAGE;
1042 img = img.Rotate90(
true);
1045 img = img.Rotate180();
1048 img = img.Rotate90(
false);
1074 dcp.
SetLabel(wxString::Format(wxT(
"%lu"), (
unsigned long int)
m_points.size()));
1110 DEBUG_DEBUG(
"trying to select invalid point nr: " << nr <<
". Nr of points: " <<
m_points.size());
1129 point =
scale(point);
1133 wxSize sz = GetClientSize();
1134 int scrollx = x - sz.GetWidth()/2;
1135 int scrolly = y - sz.GetHeight()/2;
1136 Scroll(scrollx, scrolly);
1139 GetViewStart(&sx, &sy);
1140 DEBUG_DEBUG(
"relative coordinages: " << x-sx <<
"," << y-sy);
1141 WarpPointer(x-sx,y-sy);
1150 for(
int i=
m_points.size()-1; i>=0; i--)
1152 if(
m_points[i].isOccupiedLabel(mousePos))
1159 for(std::vector<DisplayedControlPoint>::const_iterator it=
m_points.begin(); it!=
m_points.end(); ++it)
1161 if(it->isOccupiedPos(p))
1174 wxClientDC dc(
this);
1178 dc.SetPen(wxPen(*wxWHITE, 2, wxPENSTYLE_LONG_DASH));
1179 dc.SetBrush(*wxTRANSPARENT_BRUSH);
1182 dc.DrawRectangle(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);
1187 if (!
m_img.get())
return;
1188 wxPoint unScrolledMousePos;
1189 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1190 &unScrolledMousePos.x, & unScrolledMousePos.y);
1192 bool doUpdate =
false;
1202 if (mouse.LeftIsDown() && ! mouse.ShiftDown()) {
1205 DEBUG_DEBUG(
"mouse down movement without selection, in NO_SELECTION state!");
1208 if (mpos.x >= 0 && mpos.x <=
m_realSize.GetWidth()){
1210 }
else if (mpos.x < 0) {
1216 if (mpos.y >= 0 && mpos.y <=
m_realSize.GetHeight()){
1218 }
else if (mpos.y < 0) {
1220 }
else if (mpos.y >
m_realSize.GetHeight()) {
1231 DEBUG_DEBUG(
"WARNING: mouse move in new point state")
1249 if (mouse.MiddleIsDown())
1255 if (mouse.ShiftDown()) {
1280 unsigned int selPointNr;
1282 SetCursor(wxCursor(wxCURSOR_ARROW));
1298 if (!
m_img.get())
return;
1302 wxPoint unScrolledMousePos;
1303 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1304 &unScrolledMousePos.x, & unScrolledMousePos.y);
1313 unsigned int selPointNr = 0;
1332 DEBUG_DEBUG(
"click on new space, select new point");
1345 DEBUG_ERROR(
"invalid state " << clickState <<
" on mouse down");
1355 if (!
m_img.get())
return;
1370 if (!
m_img.get())
return;
1378 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1379 &mpos_.x, & mpos_.y);
1389 if (mouse.LeftUp()) {
1407 DEBUG_DEBUG(
"new Point changed (event fire): x:" << mpos.x <<
" y:" << mpos.y);
1434 DEBUG_DEBUG(
"middle mouse button released, leaving scroll mode")
1441 DEBUG_DEBUG(
"middle mouse button pressed, entering scroll mode")
1442 if (!
m_img.get())
return;
1453 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y, &mpos_.x, & mpos_.y);
1470 if (!
m_img.get())
return;
1472 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1473 &mpos_.x, & mpos_.y);
1479 if (mouse.RightUp())
1496 DEBUG_DEBUG(
"Emitting right click (rmb release)");
1506 wxClientDC dc(
this);
1513 if ( ProcessEvent( ev ) == FALSE ) {
1514 wxLogWarning( _(
"Could not process event!") );
1541 int w = size.GetWidth();
1542 int h = size.GetHeight();
1550 wxSize csize = GetSize();
1551 DEBUG_DEBUG(
"csize: " << csize.GetWidth() <<
"x" << csize.GetHeight() <<
"image: " << w <<
"x" <<
h);
1552 double s1 = (double)csize.GetWidth()/w;
1553 double s2 = (double)csize.GetHeight()/
h;
1555 return s1 < s2 ? s1 : s2;
1565 DEBUG_TRACE(
"size: " << e.GetSize().GetWidth() <<
"x" << e.GetSize().GetHeight());
1576 if (!
m_img.get())
return;
1580 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_LEFT ) delta.x = -1;
1581 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_RIGHT ) delta.x = 1;
1582 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_UP ) delta.y = -1;
1583 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_DOWN ) delta.y = 1;
1584 if ( (delta.x != 0 || delta.y != 0 ) && (e.ShiftDown() || e.CmdDown())) {
1586 double speed = (double) GetClientSize().GetWidth()/10;
1587 delta.x = (int) (delta.x * speed);
1588 delta.y = (int) (delta.y * speed);
1589 if (e.ShiftDown()) {
1594 }
else if (e.CmdDown()) {
1597 }
else if (delta.x != 0 || delta.y != 0 ) {
1635 else if (e.m_keyCode ==
'a') {
1636 DEBUG_DEBUG(
"adding point with a key, faking right click");
1642 else if (e.m_keyCode==WXK_ESCAPE) {
1647 bool forward =
false;
1648 switch (e.GetKeyCode())
1671 e.SetEventObject(
this);
1673 <<
" origin: id:" << e.GetId() <<
" obj: "
1674 << e.GetEventObject());
1687 if (!
m_img.get())
return;
1688 if (e.m_keyCode == WXK_SHIFT || e.m_keyCode == WXK_CONTROL) {
1689 DEBUG_DEBUG(
"shift or control down, reseting scoll position");
1760 GetViewStart( &x, &y );
1762 wxSize winSize = GetClientSize();
1764 imgSize.x =
bitmap.GetWidth();
1765 imgSize.y =
bitmap.GetHeight();
1767 if (x + delta.x < 0) {
1770 if (y + delta.y < 0) {
1774 int right = x + delta.x + winSize.x ;
1775 if (right > imgSize.x) {
1776 delta.x = imgSize.x - right;
1781 int bottom = y + delta.y + winSize.y ;
1782 if (bottom > imgSize.y) {
1783 delta.y = imgSize.y - bottom;
1794 if (delta.x == 0 && delta.y == 0) {
1798 GetViewStart( &x, &y );
1819 return m_img->get8BitImage();
1835 : wxXmlResourceHandler()
1844 cp->Create(m_parentAsWindow,
1846 GetPosition(), GetSize(),
1847 GetStyle(wxT(
"style")),
1857 return IsOfClass(node, wxT(
"CPImageCtrl"));
void ScrollDelta(const wxPoint &delta)
scroll the window by delta pixels
static const int NO_IMAGE
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
virtual void OnDraw(wxDC &dc)
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()
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
void update()
initiate redraw
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
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.
#define EVT_CPEVENT(func)
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