28 #include "hugin_config.h"
35 #include <vigra/inspectimage.hxx>
36 #include <vigra/transformimage.hxx>
37 #include <vigra/basicimageview.hxx>
57 SetEventType( EVT_CPEVENT );
58 SetEventObject( (wxWindow *) NULL );
64 SetEventType(EVT_CPEVENT);
71 SetEventType( EVT_CPEVENT );
72 SetEventObject( win );
79 SetEventType( EVT_CPEVENT );
80 SetEventObject( win );
87 SetEventType( EVT_CPEVENT );
88 SetEventObject( win );
96 SetEventType(EVT_CPEVENT);
105 SetEventType(EVT_CPEVENT);
113 SetEventType(EVT_CPEVENT);
121 SetEventType(EVT_CPEVENT);
159 dc.DrawLine(p + wxPoint(-l, 0),
161 dc.DrawLine(p + wxPoint(2, 0),
162 p + wxPoint(l+1, 0));
163 dc.DrawLine(p + wxPoint(0, -l),
165 dc.DrawLine(p + wxPoint(0, 2),
166 p + wxPoint(0, l+1));
178 bool drawMag =
false;
181 bgColor = wxTheColourDatabase->Find(wxT(
"RED"));
182 textColor = wxTheColourDatabase->Find(wxT(
"WHITE"));
187 bgColor = wxTheColourDatabase->Find(wxT(
"YELLOW"));
188 textColor = wxTheColourDatabase->Find(wxT(
"BLACK"));
192 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
193 dc.SetBrush(wxBrush(wxT(
"BLACK"),wxBRUSHSTYLE_TRANSPARENT));
198 hugin_utils::FDiff2D pointInput2;
206 const wxRect lineRect(p, p2);
207 if (!visibleRect.Intersects(lineRect))
218 if (!visibleRect.Contains(p))
237 box.setSize(2*l, 2*l);
241 if(box.width()<=0 || box.height()<=0)
246 vigra::FindAverage<vigra::UInt8> average;
247 vigra::RGBToGrayAccessor<vigra::RGBValue<vigra::UInt8> > lumac;
253 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
257 dc.SetPen(wxPen(wxT(
"BLACK"), 1, wxPENSTYLE_SOLID));
288 wxSize clientSize =
m_control->GetClientSize();
291 wxFont font(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT);
293 wxPoint pClient(p.x - vx0, p.y - vy0);
295 int maxDistUR =
std::min(clientSize.x - pClient.x, pClient.y);
296 int maxDistLL =
std::min(pClient.x, clientSize.y - pClient.y);
297 int maxDistLR =
std::min(clientSize.x - pClient.x, clientSize.y - pClient.y);
302 wxPoint tul = p + wxPoint(toff,toff);
308 dc.GetTextExtent(
m_label, &tw, &th);
316 int w = toff + magBitmap.GetWidth()+3;
318 if ( maxDistLR > w + db )
320 ulMag = p + wxPoint(toff,toff);
324 if (maxDistLL > w + db)
326 ulMag = p + wxPoint(-w, toff);
330 if (maxDistUR > w + db)
332 ulMag = p + wxPoint(toff, -w);
336 ulMag = p + wxPoint(-w, -w);
341 dc.DrawBitmap(magBitmap, ulMag);
342 dc.SetPen(wxPen(wxT(
"BLACK"), 1, wxPENSTYLE_SOLID));
343 dc.SetBrush(wxBrush(wxT(
"WHITE"),wxBRUSHSTYLE_TRANSPARENT));
346 int bw = magBitmap.GetWidth();
347 int bh = magBitmap.GetHeight();
348 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
349 ulMag.x+bw+1, ulMag.y+bh);
350 dc.DrawLine(ulMag.x+bw, ulMag.y+bh,
351 ulMag.x+bw, ulMag.y-2);
352 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
353 dc.DrawLine(ulMag.x-1, ulMag.y-1,
354 ulMag.x+bw+1, ulMag.y-1);
355 dc.DrawLine(ulMag.x-1, ulMag.y+bh,
356 ulMag.x-1, ulMag.y-2);
360 int w = toff+tw+2*tB;
361 if ( maxDistLR > w + db && (!drawMag) )
363 tul = p + wxPoint(toff,toff);
367 if (maxDistLL > w + db)
369 tul = p + wxPoint(-w, toff);
373 if (maxDistUR > w + db)
375 tul = p + wxPoint(toff, -(toff) - (th+2*tB));
379 tul = p + wxPoint(-w, -(toff) - (th+2*tB));
385 dc.SetPen(wxPen(textColour, 1, wxPENSTYLE_SOLID));
386 dc.SetBrush(wxBrush(bgColour, wxBRUSHSTYLE_SOLID));
387 dc.DrawRectangle(tul.x, tul.y, tw+2*tB+1, th+2*tB);
388 labelPos.SetLeft(tul.x);
389 labelPos.SetTop(tul.y);
390 labelPos.SetWidth(tw+2*tB+1);
391 labelPos.SetHeight(th+2*tB);
393 dc.SetTextForeground(textColour);
394 dc.DrawText(
m_label, tul + wxPoint(tB,tB));
425 wxPoint* points=
new wxPoint[len+1];
426 for(
size_t i=0; i<len+1; i++)
450 dc.DrawLines(len+1, points);
451 dc.DestroyClippingRegion();
465 hugin_utils::FDiff2D p1, p2, dp;
479 int image_dimension=
std::min(image_width, image_height);
487 if(length > 0.05f * image_dimension && length < 0.75f * image_dimension)
501 wxPoint* points=
new wxPoint[2*line_length+1];
502 for(
size_t i=0; i<2*line_length+1; i++)
504 hugin_utils::FDiff2D p = p1 + dp*f*(((double)i - line_length) / (2.0f*line_length));
514 dc.DrawLines(2*line_length+1, points);
515 dc.DestroyClippingRegion();
672 const wxString& name)
674 wxScrolledWindow::Create(parent,
id, pos, size, style, name);
679 m_showSearchArea =
false;
680 m_searchRectWidth = 0;
681 m_showTemplateArea =
false;
682 m_templateRectWidth = 0;
684 m_imgRotation = ROT0;
690 #if defined(__WXMSW__)
692 m_CPSelectCursor =
new wxCursor(cursorPath, wxBITMAP_TYPE_CUR);
694 m_CPSelectCursor =
new wxCursor(wxCURSOR_CROSS);
696 SetCursor(*m_CPSelectCursor);
699 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"BLUE")));
700 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
702 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GREEN")));
703 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
705 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"CYAN")));
706 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
707 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GOLD")));
708 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
710 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"NAVY")));
711 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
713 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"DARK TURQUOISE")));
714 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
716 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"SALMON")));
717 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
719 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"MAROON")));
720 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
722 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"KHAKI")));
723 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
725 m_searchRectWidth = 120;
726 m_mouseInWindow =
false;
727 m_forceMagnifier =
false;
728 m_timer.SetOwner(
this);
743 this->SetCursor(wxNullCursor);
750 wxSize vSize = GetClientSize();
754 if (
bitmap.GetWidth() < vSize.GetWidth()) {
755 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
756 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
757 dc.DrawRectangle(
bitmap.GetWidth(), 0,
758 vSize.GetWidth() -
bitmap.GetWidth(),vSize.GetHeight());
761 if (
bitmap.GetHeight() < vSize.GetHeight()) {
762 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
763 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
764 dc.DrawRectangle(0,
bitmap.GetHeight(),
765 vSize.GetWidth(), vSize.GetHeight() -
bitmap.GetHeight());
767 dc.DrawBitmap(
bitmap,0,0);
770 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
771 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
777 wxRect visibleRect(GetViewStart(), vSize);
778 visibleRect.Inflate(20);
779 for(
size_t i=0; i<
m_points.size(); i++)
783 m_points[i].Draw(dc, visibleRect,
false);
797 dsp.
Draw(dc, visibleRect,
false,
true);
800 dc.SetLogicalFunction(wxINVERT);
801 dc.SetPen(wxPen(wxT(
"RED"), 1, wxPENSTYLE_SOLID));
802 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
804 upperLeft =
scale(upperLeft);
808 dc.DrawRectangle(upperLeft.x-width, upperLeft.y-width, 2*width, 2*width);
809 dc.SetLogicalFunction(wxCOPY);
826 dc.SetLogicalFunction(wxINVERT);
827 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
828 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
831 upperLeft =
scale(upperLeft);
836 dc.SetLogicalFunction(wxCOPY);
848 typedef vigra::RGBValue<vigra::UInt8> VT;
853 int magWidth = wxConfigBase::Get()->Read(wxT(
"/CPEditorPanel/MagnifierWidth"),61l);
857 wxImage img(magWidth, magWidth);
858 vigra::BasicImageView<VT> magImg((VT*)img.GetData(), magWidth,magWidth);
859 vigra::BImage maskImg(magWidth, magWidth);
881 vigra::FindMinMax<vigra::UInt8> minmax;
886 vigra::linearRangeMapping(
887 VT(minmax.min), VT(minmax.max),
888 VT(0, 0, 0), VT(255, 255, 255))
894 for(
int x=0; x < magWidth; x++) {
895 VT p =magImg(x,hw+1);
896 vigra::UInt8 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
902 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
912 img = img.Rotate90(
true);
915 img = img.Rotate180();
918 img = img.Rotate90(
false);
961 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
999 if (img.GetWidth() == 0) {
1002 imageSize = wxSize(img.GetWidth(), img.GetHeight());
1021 wxImageResizeQuality resizeQuality = wxIMAGE_QUALITY_NORMAL;
1022 if (
std::max(img.GetWidth(), img.GetHeight()) > (ULONG_MAX >> 16))
1028 resizeQuality = wxIMAGE_QUALITY_BOX_AVERAGE;
1038 img = img.Rotate90(
true);
1041 img = img.Rotate180();
1044 img = img.Rotate90(
false);
1070 dcp.
SetLabel(wxString::Format(wxT(
"%lu"), (
unsigned long int)
m_points.size()));
1106 DEBUG_DEBUG(
"trying to select invalid point nr: " << nr <<
". Nr of points: " <<
m_points.size());
1125 point =
scale(point);
1129 wxSize sz = GetClientSize();
1130 int scrollx = x - sz.GetWidth()/2;
1131 int scrolly = y - sz.GetHeight()/2;
1132 Scroll(scrollx, scrolly);
1135 GetViewStart(&sx, &sy);
1136 DEBUG_DEBUG(
"relative coordinages: " << x-sx <<
"," << y-sy);
1137 WarpPointer(x-sx,y-sy);
1146 for(
int i=
m_points.size()-1; i>=0; i--)
1148 if(
m_points[i].isOccupiedLabel(mousePos))
1155 for(std::vector<DisplayedControlPoint>::const_iterator it=
m_points.begin(); it!=
m_points.end(); ++it)
1157 if(it->isOccupiedPos(p))
1170 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)");
1502 wxClientDC dc(
this);
1509 if ( ProcessEvent( ev ) == FALSE ) {
1510 wxLogWarning( _(
"Could not process event!") );
1537 int w = size.GetWidth();
1538 int h = size.GetHeight();
1546 wxSize csize = GetSize();
1547 DEBUG_DEBUG(
"csize: " << csize.GetWidth() <<
"x" << csize.GetHeight() <<
"image: " << w <<
"x" <<
h);
1548 double s1 = (double)csize.GetWidth()/w;
1549 double s2 = (double)csize.GetHeight()/
h;
1551 return s1 < s2 ? s1 : s2;
1561 DEBUG_TRACE(
"size: " << e.GetSize().GetWidth() <<
"x" << e.GetSize().GetHeight());
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(),
1843 GetStyle(wxT(
"style")),
1853 return IsOfClass(node, wxT(
"CPImageCtrl"));
wxDEFINE_EVENT(EVT_QUEUE_PROGRESS, wxCommandEvent)
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.
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