26#ifndef _MaskImageCtrl_H
27#define _MaskImageCtrl_H
30#include <wx/overlay.h>
222 return T(
m_realSize.GetHeight()-1 - p.y, p.x);
243 return T(p.y,
m_realSize.GetHeight()-1 - p.x);
base class, which stores one mask polygon
xrc handler for mask editor
MaskImageCtrlXmlHandler()
virtual wxObject * DoCreateResource()
virtual bool CanHandle(wxXmlNode *node)
unsigned int m_activeMask
void setActiveMask(unsigned int newMask, bool doUpdate=true)
mark mask with image as beeing editing
hugin_utils::FDiff2D m_cropCenter
MaskEditorState m_maskEditState
void SetUserColourPointUnselected(wxColour newColour)
void setImage(const std::string &filename, HuginBase::MaskPolygonVector newMask, HuginBase::MaskPolygonVector masksToDraw, ImageRotation rot)
set the current image and mask list, this loads also the image from cache
void UpdateCrop(hugin_utils::FDiff2D delta)
bool SelectPointsInsideMouseRect(HuginBase::UIntSet &points, const bool considerSelectedOnly)
double getScale()
return scale factor, 0 for autoscale
int scale(int x) const
scale of width/height
std::string m_imageFilename
void OnPaint(wxPaintEvent &e)
drawing routine
void SetUserColourPolygonPositive(wxColour newColour)
T applyRotInv(const T &p) const
double invtransform(double x) const
void setScale(double factor)
set the scaling factor for mask editing display.
HuginBase::MaskPolygonVector getNewMask() const
returns the vector of all mask (including new created mask)
void setDrawingActiveMasks(bool newDrawActiveMasks)
set if active masks should be drawn
void setNewMasks(HuginBase::MaskPolygonVector newMasks, HuginBase::MaskPolygonVector masksToDraw)
updates masks for currently selected image
HuginBase::MaskPolygonVector m_imageMask
MaskEditorPanel * m_editPanel
void startNewPolygon()
starts creating a new polygon
wxColor m_colour_polygon_positive
ImageCache::EntryPtr m_img
ImageRotation
image rotation.
void DrawSelectionRectangle()
void OnLeftMouseDblClick(wxMouseEvent &mouse)
event handler for left double click
void FindPolygon(hugin_utils::FDiff2D p)
void Init(MaskEditorPanel *parent)
vigra::Rect2D getCrop()
returns the current crop rect
double calcAutoScaleFactor(wxSize size)
calculate new scale factor for this image
void DrawPolygon(wxDC &dc, HuginBase::MaskPolygon poly, bool isSelected, bool drawMarker)
void OnKeyUp(wxKeyEvent &e)
event handler for keyboard
ClickPos GetClickPos(vigra::Point2D pos)
void OnRightMouseUp(wxMouseEvent &mouse)
event handler when right mouse button is released
void OnKillFocus(wxFocusEvent &e)
event handler, when editor lost focus, mainly cancels creating new polygon
double getScaleFactor() const
get scale factor (calculates factor when fit to window is active)
HuginBase::MaskPolygonVector m_masksToDraw
void OnMouseMove(wxMouseEvent &mouse)
event handler when mouse is moving
void OnSizeFinished(wxTimerEvent &e)
handler called at end of all resize
void OnMiddleMouseUp(wxMouseEvent &mouse)
event handler for middle mouse button, end scrolling
void OnLeftMouseDown(wxMouseEvent &mouse)
event handler when left mouse button is pressed
int transform(int x) const
convert image coordinate to screen coordinates, considers additional added border
wxColour m_color_selection
wxPoint transform(const hugin_utils::FDiff2D &p) const
wxColor m_colour_point_selected
void OnLeftMouseUp(wxMouseEvent &mouse)
event handler when right mouse button is released
ImageRotation m_imgRotation
void rescaleImage()
rescale the image
double scale(double x) const
wxSize DoGetBestSize() const override
returns size of currently scaled image
HuginBase::MaskPolygon m_editingMask
wxColor m_colour_point_unselected
void SetMaskMode(bool newMaskMode)
sets the control to mask (newMaskMode=true) or crop (newMaskMode=false) mode
void OnChar(wxKeyEvent &e)
event handler for scrolling with keyboard
ImageRotation getCurrentRotation()
returns the current rotation of displayed image
hugin_utils::FDiff2D invtransform(const wxPoint &p) const
void OnMouseWheel(wxMouseEvent &mouse)
event handler for mouse wheel
wxBitmap m_disabledBitmap
void selectAllMarkers()
select all points of active mask
void SetUserColourPointSelected(wxColour newColour)
void setPreviewOnly()
if called, the mouse handlers are deactivated
void setCrop(HuginBase::SrcPanoImage::CropMode newCropMode, vigra::Rect2D newCropRect, bool isCentered, hugin_utils::FDiff2D center, bool isCircleCrop)
updates the crop mode and crop rect
T applyRot(const T &p) const
void SetUserColourPolygonNegative(wxColour newColour)
sets the colour for different parts
void OnSize(wxSizeEvent &e)
handler called when size of control was changed
void OnCaptureLost(wxMouseCaptureLostEvent &e)
event handler, when mouse capture is lost, e.g.
HuginBase::UIntSet m_selectedPoints
void OnScroll(wxScrollWinEvent &e)
event handler for remember scroll position
void OnRightMouseDown(wxMouseEvent &mouse)
event handler when right mouse button is pressed
MaskEditorState
different states of the editor
double transform(double x) const
int invtransform(int x) const
translate screen coordinates to image coordinates, considers additional added border
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
wxColor m_colour_polygon_negative
HuginBase::SrcPanoImage::CropMode m_cropMode
void OnMiddleMouseDown(wxMouseEvent &mouse)
event handler for middle mouse button, start scrolling
std::vector< MaskPolygon > MaskPolygonVector
const int maskOffset
polygon can exceed the image maximal maskOffset pixels in each direction bigger polygons will be clip...
std::set< unsigned int > UIntSet
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.