#include <Mask.h>
Public Types | |
| enum | MaskType { Mask_negative = 0, Mask_positive = 1, Mask_Stack_negative = 2, Mask_Stack_positive = 3, Mask_negative_lens = 4 } |
| enumeration with type of possible masks More... | |
Public Member Functions | |
| MaskPolygon () | |
| constructor | |
| bool | isInside (const FDiff2D p) const |
| checks if given point is inside of the stored polygon | |
| int | getWindingNumber (const FDiff2D p) const |
| returns the winding number of the polygon around point p | |
| int | getTotalWindingNumber () const |
| returns the total winding number of the polygon | |
| MaskType | getMaskType () const |
| returns mask type | |
| void | setMaskType (const MaskType newType) |
| sets mask type | |
| bool | isPositive () const |
| returns true, if mask type is positive | |
| VectorPolygon | getMaskPolygon () const |
| returns vector with coordinates of the polygon | |
| void | setMaskPolygon (const VectorPolygon newMask) |
| set complete vector with all corrdinates of the polygon | |
| unsigned int | getImgNr () const |
| returns the associated image number, only used when loading a project, otherwise discarded | |
| void | setImgNr (const unsigned int newImgNr) |
| sets the associated image number, only used when loading a project, otherwise discarded | |
| void | setInverted (const bool inverted) |
| set mask to normal or inverted | |
| bool | isInverted () const |
| returns if mask is inverted | |
| void | addPoint (const FDiff2D p) |
| adds point at the end to the polygon | |
| void | insertPoint (const unsigned int index, const FDiff2D p) |
| insert point at the position index into the polygon | |
| void | removePoint (const unsigned int index) |
| removes point at the position index from the polygon | |
| void | movePointTo (const unsigned int index, const FDiff2D p) |
| moves the point at position index to the new absolute position p | |
| void | movePointBy (const unsigned int index, const FDiff2D diff) |
| relativ moves the point at position index by diff | |
| void | scale (const double factorx, const double factory) |
| scales all polygon coordinates by factorx for x position and factory for y position | |
| void | scale (const double factor) |
| scales x and y axis equally by factor | |
| void | transformPolygon (const PTools::Transform &trans) |
| transforms the polygon coordinates by the given transformation | |
| bool | clipPolygon (const vigra::Rect2D rect) |
| clips the polygon to the given rectangle | |
| bool | clipPolygon (const FDiff2D center, const double radius) |
| clips the polygon to the circle with center and radius | |
| void | rotate90 (bool clockwise, unsigned int maskWidth, unsigned int maskHeight) |
| rotate the polygon by 90 degrees | |
| void | subSample (const double max_distance) |
| subsamples the polygon, so that the longest distance between 2 points is max_distance | |
| unsigned int | FindPointNearPos (const FDiff2D p, const double tol) |
| search a point which lies near the polygon line and return the index for inserting the new point | |
| MaskPolygon & | operator= (const MaskPolygon otherPoly) |
| assign operator | |
| const bool | operator== (const MaskPolygon &otherPoly) const |
| comparision operator | |
| bool | parsePolygonString (const std::string polygonStr) |
| parses the x and y positions from the given string | |
| void | printPolygonLine (std::ostream &o, const unsigned int newImgNr) const |
| writes the complete k line which describes the mask to the stream, using the given newImgNr for the i parameter | |
Private Member Functions | |
| void | calcBoundingBox () |
| calculates the bounding box of the polygon to speed up tests | |
Private Attributes | |
| MaskType | m_maskType |
| VectorPolygon | m_polygon |
| unsigned int | m_imgNr |
| bool | m_invert |
| vigra::Rect2D | m_boundingBox |
note: the mask handling (e.g. propagating of positive masks) happens in HuginBase::Panorama::updateMasks which is automatic called after a change to the panorama object by HuginBase::Panorama::changedFinished
Definition at line 54 of file Mask.h.
|
|
enumeration with type of possible masks
|
|
|
constructor
|
|
|
adds point at the end to the polygon
Definition at line 111 of file Mask.cpp. References calcBoundingBox(), hugin_utils::FDiff2D, and m_polygon. Referenced by getTotalWindingNumber(), MaskImageCtrl::OnLeftMouseDown(), MaskImageCtrl::OnLeftMouseUp(), and subSample(). |
|
|
calculates the bounding box of the polygon to speed up tests
Definition at line 208 of file Mask.cpp. References m_boundingBox, and m_polygon. Referenced by addPoint(), insertPoint(), movePointBy(), movePointTo(), removePoint(), scale(), setMaskPolygon(), and transformPolygon(). |
|
||||||||||||
|
clips the polygon to the circle with center and radius
Definition at line 448 of file Mask.cpp. References HuginBase::angle_between(), HuginBase::clip_getIntersectionCircle(), HuginBase::clip_insideCircle(), DEBUG_ASSERT, hugin_utils::FDiff2D, HuginBase::generateArc(), m_polygon, and HuginBase::VectorPolygon. |
|
|
clips the polygon to the given rectangle
Definition at line 327 of file Mask.cpp. References HuginBase::clip_onPlane(), HuginBase::clipBottom, HuginBase::clipLeft, HuginBase::clipRight, HuginBase::clipTop, and m_polygon. |
|
||||||||||||
|
search a point which lies near the polygon line and return the index for inserting the new point
Definition at line 558 of file Mask.cpp. References hugin_utils::FDiff2D, m_polygon, hugin_utils::norm(), hugin_utils::sqr(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by MaskImageCtrl::OnLeftMouseDown(). |
|
|
returns the associated image number, only used when loading a project, otherwise discarded
Definition at line 87 of file Mask.h. Referenced by operator=(). |
|
|
returns vector with coordinates of the polygon
Definition at line 83 of file Mask.h. References HuginBase::VectorPolygon. Referenced by MaskImageCtrl::DrawPolygon(), MaskImageCtrl::OnDraw(), MaskImageCtrl::OnKeyUp(), MaskImageCtrl::OnLeftMouseDblClick(), MaskImageCtrl::OnLeftMouseDown(), MaskImageCtrl::OnLeftMouseUp(), MaskImageCtrl::OnMouseMove(), MaskImageCtrl::OnRightMouseDown(), MaskImageCtrl::OnRightMouseUp(), operator=(), operator==(), and MaskImageCtrl::SelectPointsInsideMouseRect(). |
|
|
returns mask type
Definition at line 77 of file Mask.h. Referenced by MaskImageCtrl::DrawPolygon(), operator=(), and operator==(). |
|
|
returns the total winding number of the polygon
Definition at line 86 of file Mask.cpp. References addPoint(), hugin_utils::FDiff2D, getWindingNumber(), and m_polygon. |
|
|
returns the winding number of the polygon around point p
Definition at line 55 of file Mask.cpp. References hugin_utils::FDiff2D, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by getTotalWindingNumber(), and isInside(). |
|
||||||||||||
|
insert point at the position index into the polygon
Definition at line 117 of file Mask.cpp. References calcBoundingBox(), hugin_utils::FDiff2D, and m_polygon. Referenced by MaskImageCtrl::OnLeftMouseDown(). |
|
|
checks if given point is inside of the stored polygon
Definition at line 42 of file Mask.cpp. References hugin_utils::FDiff2D, getWindingNumber(), m_boundingBox, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by MaskImageCtrl::OnRightMouseDown(). |
|
|
returns if mask is inverted
Definition at line 93 of file Mask.h. Referenced by operator=(). |
|
|
returns true, if mask type is positive
Definition at line 99 of file Mask.cpp. References m_maskType. |
|
||||||||||||
|
relativ moves the point at position index by diff
Definition at line 146 of file Mask.cpp. References calcBoundingBox(), hugin_utils::FDiff2D, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by MaskImageCtrl::OnMouseMove(). |
|
||||||||||||
|
moves the point at position index to the new absolute position p
Definition at line 136 of file Mask.cpp. References calcBoundingBox(), hugin_utils::FDiff2D, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by MaskImageCtrl::OnLeftMouseUp(), MaskImageCtrl::OnMouseMove(), and MaskImageCtrl::OnRightMouseUp(). |
|
|
assign operator
Definition at line 587 of file Mask.cpp. References getImgNr(), getMaskPolygon(), getMaskType(), isInverted(), setImgNr(), setInverted(), setMaskPolygon(), and setMaskType(). |
|
|
comparision operator
Definition at line 598 of file Mask.cpp. References getMaskPolygon(), getMaskType(), m_maskType, and m_polygon. |
|
|
parses the x and y positions from the given string
Definition at line 603 of file Mask.cpp. References hugin_utils::FDiff2D, and m_polygon. Referenced by HuginBase::LoadMaskFromStream(). |
|
||||||||||||
|
writes the complete k line which describes the mask to the stream, using the given newImgNr for the i parameter
Definition at line 620 of file Mask.cpp. References m_maskType, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. Referenced by HuginBase::SaveMaskToStream(). |
|
|
removes point at the position index from the polygon
Definition at line 127 of file Mask.cpp. References calcBoundingBox(), and m_polygon. Referenced by MaskImageCtrl::OnKeyUp(), MaskImageCtrl::OnLeftMouseDblClick(), and MaskImageCtrl::OnRightMouseUp(). |
|
||||||||||||||||
|
rotate the polygon by 90 degrees
Definition at line 539 of file Mask.cpp. References hugin_utils::FDiff2D, m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. |
|
|
scales x and y axis equally by factor
|
|
||||||||||||
|
scales all polygon coordinates by factorx for x position and factory for y position
Definition at line 156 of file Mask.cpp. References calcBoundingBox(), m_polygon, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y. |
|
|
sets the associated image number, only used when loading a project, otherwise discarded
Definition at line 89 of file Mask.h. Referenced by HuginBase::LoadMaskFromStream(), and operator=(). |
|
|
set mask to normal or inverted
Definition at line 91 of file Mask.h. Referenced by operator=(). |
|
|
set complete vector with all corrdinates of the polygon
Definition at line 105 of file Mask.cpp. References calcBoundingBox(), and m_polygon. Referenced by operator=(). |
|
|
sets mask type
Definition at line 79 of file Mask.h. Referenced by HuginBase::LoadMaskFromStream(), and operator=(). |
|
|
subsamples the polygon, so that the longest distance between 2 points is max_distance
Definition at line 181 of file Mask.cpp. References addPoint(), vigra_ext::distance(), hugin_utils::FDiff2D, m_polygon, hugin_utils::norm(), and HuginBase::VectorPolygon. |
|
|
transforms the polygon coordinates by the given transformation
Definition at line 166 of file Mask.cpp. References calcBoundingBox(), hugin_utils::FDiff2D, m_polygon, HuginBase::PTools::Transform::transformImgCoord(), and HuginBase::VectorPolygon. |
|
|
Definition at line 146 of file Mask.h. Referenced by calcBoundingBox(), and isInside(). |
|
|
|
|
|
|
|
|
Definition at line 142 of file Mask.h. Referenced by isPositive(), operator==(), and printPolygonLine(). |
|
|
Definition at line 143 of file Mask.h. Referenced by addPoint(), calcBoundingBox(), clipPolygon(), FindPointNearPos(), getTotalWindingNumber(), getWindingNumber(), insertPoint(), isInside(), movePointBy(), movePointTo(), operator==(), parsePolygonString(), printPolygonLine(), removePoint(), rotate90(), scale(), setMaskPolygon(), subSample(), and transformPolygon(). |
1.3.9.1