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();
651 const wxString& name)
653 wxScrolledWindow::Create(parent,
id, pos, size, style, name);
669 #if defined(__WXMSW__)
678 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"BLUE")));
679 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
681 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GREEN")));
682 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
684 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"CYAN")));
685 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
686 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"GOLD")));
687 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
689 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"NAVY")));
690 textColours.push_back(wxTheColourDatabase->Find(wxT(
"WHITE")));
692 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"DARK TURQUOISE")));
693 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
695 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"SALMON")));
696 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
698 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"MAROON")));
699 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
701 pointColors.push_back(wxTheColourDatabase->Find(wxT(
"KHAKI")));
702 textColours.push_back(wxTheColourDatabase->Find(wxT(
"BLACK")));
736 this->SetCursor(wxNullCursor);
743 wxSize vSize = GetClientSize();
747 if (
bitmap.GetWidth() < vSize.GetWidth()) {
748 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
749 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
750 dc.DrawRectangle(
bitmap.GetWidth(), 0,
751 vSize.GetWidth() -
bitmap.GetWidth(),vSize.GetHeight());
754 if (
bitmap.GetHeight() < vSize.GetHeight()) {
755 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
756 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
757 dc.DrawRectangle(0,
bitmap.GetHeight(),
758 vSize.GetWidth(), vSize.GetHeight() -
bitmap.GetHeight());
760 dc.DrawBitmap(
bitmap,0,0);
763 dc.SetPen(wxPen(GetBackgroundColour(), 1, wxPENSTYLE_SOLID));
764 dc.SetBrush(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID));
770 wxRect visibleRect(GetViewStart(), vSize);
771 visibleRect.Inflate(20);
772 for(
size_t i=0; i<
m_points.size(); i++)
776 m_points[i].Draw(dc, visibleRect,
false);
790 dsp.
Draw(dc, visibleRect,
false,
true);
793 dc.SetLogicalFunction(wxINVERT);
794 dc.SetPen(wxPen(wxT(
"RED"), 1, wxPENSTYLE_SOLID));
795 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
797 upperLeft =
scale(upperLeft);
801 dc.DrawRectangle(upperLeft.x-width, upperLeft.y-width, 2*width, 2*width);
802 dc.SetLogicalFunction(wxCOPY);
819 dc.SetLogicalFunction(wxINVERT);
820 dc.SetPen(wxPen(wxT(
"WHITE"), 1, wxPENSTYLE_SOLID));
821 dc.SetBrush(wxBrush(wxT(
"WHITE"), wxBRUSHSTYLE_TRANSPARENT));
824 upperLeft =
scale(upperLeft);
829 dc.SetLogicalFunction(wxCOPY);
841 typedef vigra::RGBValue<vigra::UInt8> VT;
846 int magWidth = wxConfigBase::Get()->Read(wxT(
"/CPEditorPanel/MagnifierWidth"),61l);
850 wxImage img(magWidth, magWidth);
851 vigra::BasicImageView<VT> magImg((VT*)img.GetData(), magWidth,magWidth);
852 vigra::BImage maskImg(magWidth, magWidth);
874 vigra::FindMinMax<vigra::UInt8> minmax;
879 vigra::linearRangeMapping(
880 VT(minmax.min), VT(minmax.max),
881 VT(0, 0, 0), VT(255, 255, 255))
887 for(
int x=0; x < magWidth; x++) {
888 VT p =magImg(x,hw+1);
889 vigra::UInt8 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
895 v = 0.3/255*p.red() + 0.6/255*p.green() + 0.1/255*p.blue() < 0.5 ? 255 : 0;
905 img = img.Rotate90(
true);
908 img = img.Rotate180();
911 img = img.Rotate90(
false);
954 m_img = ImageCache::EntryPtr(
new ImageCache::Entry);
992 if (img.GetWidth() == 0) {
995 imageSize = wxSize(img.GetWidth(), img.GetHeight());
1014 wxImageResizeQuality resizeQuality = wxIMAGE_QUALITY_NORMAL;
1015 if (
std::max(img.GetWidth(), img.GetHeight()) > (ULONG_MAX >> 16))
1021 resizeQuality = wxIMAGE_QUALITY_BOX_AVERAGE;
1031 img = img.Rotate90(
true);
1034 img = img.Rotate180();
1037 img = img.Rotate90(
false);
1063 dcp.
SetLabel(wxString::Format(wxT(
"%lu"), (
unsigned long int)
m_points.size()));
1099 DEBUG_DEBUG(
"trying to select invalid point nr: " << nr <<
". Nr of points: " <<
m_points.size());
1118 point =
scale(point);
1122 wxSize sz = GetClientSize();
1123 int scrollx = x - sz.GetWidth()/2;
1124 int scrolly = y - sz.GetHeight()/2;
1125 Scroll(scrollx, scrolly);
1128 GetViewStart(&sx, &sy);
1129 DEBUG_DEBUG(
"relative coordinages: " << x-sx <<
"," << y-sy);
1130 WarpPointer(x-sx,y-sy);
1139 for(
int i=
m_points.size()-1; i>=0; i--)
1141 if(
m_points[i].isOccupiedLabel(mousePos))
1148 for(std::vector<DisplayedControlPoint>::const_iterator it=
m_points.begin(); it!=
m_points.end(); ++it)
1150 if(it->isOccupiedPos(p))
1163 wxClientDC dc(
this);
1167 dc.SetPen(wxPen(*wxWHITE, 2, wxPENSTYLE_LONG_DASH));
1168 dc.SetBrush(*wxTRANSPARENT_BRUSH);
1171 dc.DrawRectangle(p1.x,p1.y,p2.x-p1.x,p2.y-p1.y);
1176 if (!
m_img.get())
return;
1177 wxPoint unScrolledMousePos;
1178 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1179 &unScrolledMousePos.x, & unScrolledMousePos.y);
1181 bool doUpdate =
false;
1191 if (mouse.LeftIsDown() && ! mouse.ShiftDown()) {
1194 DEBUG_DEBUG(
"mouse down movement without selection, in NO_SELECTION state!");
1197 if (mpos.x >= 0 && mpos.x <=
m_realSize.GetWidth()){
1199 }
else if (mpos.x < 0) {
1205 if (mpos.y >= 0 && mpos.y <=
m_realSize.GetHeight()){
1207 }
else if (mpos.y < 0) {
1209 }
else if (mpos.y >
m_realSize.GetHeight()) {
1220 DEBUG_DEBUG(
"WARNING: mouse move in new point state")
1238 if (mouse.MiddleIsDown())
1244 if (mouse.ShiftDown()) {
1269 unsigned int selPointNr;
1271 SetCursor(wxCursor(wxCURSOR_ARROW));
1287 if (!
m_img.get())
return;
1291 wxPoint unScrolledMousePos;
1292 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1293 &unScrolledMousePos.x, & unScrolledMousePos.y);
1302 unsigned int selPointNr = 0;
1321 DEBUG_DEBUG(
"click on new space, select new point");
1334 DEBUG_ERROR(
"invalid state " << clickState <<
" on mouse down");
1344 if (!
m_img.get())
return;
1359 if (!
m_img.get())
return;
1367 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1368 &mpos_.x, & mpos_.y);
1378 if (mouse.LeftUp()) {
1396 DEBUG_DEBUG(
"new Point changed (event fire): x:" << mpos.x <<
" y:" << mpos.y);
1423 DEBUG_DEBUG(
"middle mouse button released, leaving scroll mode")
1430 DEBUG_DEBUG(
"middle mouse button pressed, entering scroll mode")
1431 if (!
m_img.get())
return;
1442 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y, &mpos_.x, & mpos_.y);
1459 if (!
m_img.get())
return;
1461 CalcUnscrolledPosition(mouse.GetPosition().x, mouse.GetPosition().y,
1462 &mpos_.x, & mpos_.y);
1468 if (mouse.RightUp())
1485 DEBUG_DEBUG(
"Emitting right click (rmb release)");
1495 wxClientDC dc(
this);
1502 if ( ProcessEvent( ev ) == FALSE ) {
1503 wxLogWarning( _(
"Could not process event!") );
1530 int w = size.GetWidth();
1531 int h = size.GetHeight();
1539 wxSize csize = GetSize();
1540 DEBUG_DEBUG(
"csize: " << csize.GetWidth() <<
"x" << csize.GetHeight() <<
"image: " << w <<
"x" <<
h);
1541 double s1 = (double)csize.GetWidth()/w;
1542 double s2 = (double)csize.GetHeight()/
h;
1544 return s1 < s2 ? s1 : s2;
1554 DEBUG_TRACE(
"size: " << e.GetSize().GetWidth() <<
"x" << e.GetSize().GetHeight());
1565 if (!
m_img.get())
return;
1569 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_LEFT ) delta.x = -1;
1570 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_RIGHT ) delta.x = 1;
1571 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_UP ) delta.y = -1;
1572 if ((!e.CmdDown()) && e.GetKeyCode() == WXK_DOWN ) delta.y = 1;
1573 if ( (delta.x != 0 || delta.y != 0 ) && (e.ShiftDown() || e.CmdDown())) {
1575 double speed = (double) GetClientSize().GetWidth()/10;
1576 delta.x = (int) (delta.x * speed);
1577 delta.y = (int) (delta.y * speed);
1578 if (e.ShiftDown()) {
1583 }
else if (e.CmdDown()) {
1586 }
else if (delta.x != 0 || delta.y != 0 ) {
1624 else if (e.m_keyCode ==
'a') {
1625 DEBUG_DEBUG(
"adding point with a key, faking right click");
1631 else if (e.m_keyCode==WXK_ESCAPE) {
1636 bool forward =
false;
1637 switch (e.GetKeyCode())
1660 e.SetEventObject(
this);
1662 <<
" origin: id:" << e.GetId() <<
" obj: "
1663 << e.GetEventObject());
1676 if (!
m_img.get())
return;
1677 if (e.m_keyCode == WXK_SHIFT || e.m_keyCode == WXK_CONTROL) {
1678 DEBUG_DEBUG(
"shift or control down, reseting scoll position");
1749 GetViewStart( &x, &y );
1751 wxSize winSize = GetClientSize();
1753 imgSize.x =
bitmap.GetWidth();
1754 imgSize.y =
bitmap.GetHeight();
1756 if (x + delta.x < 0) {
1759 if (y + delta.y < 0) {
1763 int right = x + delta.x + winSize.x ;
1764 if (right > imgSize.x) {
1765 delta.x = imgSize.x - right;
1770 int bottom = y + delta.y + winSize.y ;
1771 if (bottom > imgSize.y) {
1772 delta.y = imgSize.y - bottom;
1783 if (delta.x == 0 && delta.y == 0) {
1787 GetViewStart( &x, &y );
1808 return m_img->get8BitImage();
1824 : wxXmlResourceHandler()
1833 cp->Create(m_parentAsWindow,
1835 GetPosition(), GetSize(),
1836 GetStyle(wxT(
"style")),
1846 return IsOfClass(node, wxT(
"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
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.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
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