Mask.cpp File Reference

#include <iostream>
#include <stdio.h>
#include "Mask.h"
#include <vector>
#include <panotools/PanoToolsInterface.h>
#include <panodata/PTScriptParsing.h>

Include dependency graph for Mask.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  HuginBase

Enumerations

enum  clipSide { clipLeft = 0, clipRight, clipTop, clipBottom }

Functions

bool clip_isSide (const FDiff2D p, const vigra::Rect2D r, const clipSide side)
FDiff2D clip_getIntersection (const FDiff2D p, const FDiff2D q, const vigra::Rect2D r, const clipSide side)
VectorPolygon clip_onPlane (const VectorPolygon polygon, const vigra::Rect2D r, const clipSide side)
bool clip_insideCircle (const FDiff2D p, const FDiff2D center, const double radius)
 check if point is inside circle
std::vector< FDiff2Dclip_getIntersectionCircle (const FDiff2D p, const FDiff2D s, const FDiff2D center, const double radius)
 returns intersection of line and circle
double angle_between (const FDiff2D a, const FDiff2D b)
 calculates angle between vector a and b in radians
void generateArc (VectorPolygon &poly, const FDiff2D s, const FDiff2D center, const double radius, const bool clockwise)
 adds an arc with given radius at the end of the polygon, the point is not added to the arc
void LoadMaskFromStream (std::istream &stream, vigra::Size2D &imageSize, MaskPolygonVector &newMasks, size_t imgNr)
 load the mask from stream
void SaveMaskToStream (std::ostream &stream, vigra::Size2D imageSize, MaskPolygon &maskToWrite, size_t imgNr)
 save the mask into stream


Enumeration Type Documentation

enum clipSide
 

Enumeration values:
clipLeft 
clipRight 
clipTop 
clipBottom 

Definition at line 228 of file Mask.cpp.


Function Documentation

double angle_between const FDiff2D  a,
const FDiff2D  b
 

calculates angle between vector a and b in radians

Definition at line 392 of file Mask.cpp.

References hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::squareLength(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::MaskPolygon::clipPolygon().

FDiff2D clip_getIntersection const FDiff2D  p,
const FDiff2D  q,
const vigra::Rect2D  r,
const clipSide  side
 

Definition at line 252 of file Mask.cpp.

References HuginBase::clipBottom, HuginBase::clipLeft, HuginBase::clipRight, HuginBase::clipTop, hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::clip_onPlane().

std::vector<FDiff2D> clip_getIntersectionCircle const FDiff2D  p,
const FDiff2D  s,
const FDiff2D  center,
const double  radius
 

returns intersection of line and circle

Parameters:
p fist point of line segment
s seconst point of line segment
center center of circle
radius radius of circle
Returns:
vector with all intersection of line between p and s and given circle

Definition at line 356 of file Mask.cpp.

References hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::squareLength(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::MaskPolygon::clipPolygon().

bool clip_insideCircle const FDiff2D  p,
const FDiff2D  center,
const double  radius
 

check if point is inside circle

Returns:
true, if point p is inside circle given by center and radius
Parameters:
p point to test
center center point of circle test
radius radius of circle to test

Definition at line 344 of file Mask.cpp.

References hugin_utils::FDiff2D, and hugin_utils::TDiff2D< T >::squareDistance().

Referenced by HuginBase::MaskPolygon::clipPolygon().

bool clip_isSide const FDiff2D  p,
const vigra::Rect2D  r,
const clipSide  side
 

Definition at line 236 of file Mask.cpp.

References HuginBase::clipBottom, HuginBase::clipLeft, HuginBase::clipRight, HuginBase::clipTop, hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::clip_onPlane().

VectorPolygon clip_onPlane const VectorPolygon  polygon,
const vigra::Rect2D  r,
const clipSide  side
 

Definition at line 295 of file Mask.cpp.

References HuginBase::clip_getIntersection(), HuginBase::clip_isSide(), hugin_utils::FDiff2D, and HuginBase::VectorPolygon.

Referenced by HuginBase::MaskPolygon::clipPolygon().

void generateArc VectorPolygon poly,
const FDiff2D  s,
const FDiff2D  center,
const double  radius,
const bool  clockwise
 

adds an arc with given radius at the end of the polygon, the point is not added to the arc

Parameters:
poly polygon to which the arc should added
s point to which the arc should go
center center of arc
radius radius of arc
clockwise true, if arc should go clockwise; else it goes anti-clockwise

Definition at line 404 of file Mask.cpp.

References hugin_utils::FDiff2D, PI, hugin_utils::TDiff2D< T >::squareDistance(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by HuginBase::MaskPolygon::clipPolygon().

IMPEX void HuginBase::LoadMaskFromStream std::istream stream,
vigra::Size2D &  imageSize,
MaskPolygonVector newMasks,
size_t  imgNr
 

load the mask from stream

Definition at line 634 of file Mask.cpp.

References HuginBase::PTScriptParsing::getIntParam(), HuginBase::PTScriptParsing::getPTParam(), HuginBase::MaskPolygon::parsePolygonString(), HuginBase::MaskPolygon::setImgNr(), and HuginBase::MaskPolygon::setMaskType().

Referenced by main(), MaskEditorPanel::OnMaskLoad(), and MaskEditorPanel::OnMaskPaste().

IMPEX void HuginBase::SaveMaskToStream std::ostream stream,
vigra::Size2D  imageSize,
MaskPolygon &  maskToWrite,
size_t  imgNr
 

save the mask into stream

Definition at line 679 of file Mask.cpp.

References HuginBase::MaskPolygon::printPolygonLine().

Referenced by MaskEditorPanel::OnMaskCopy(), and MaskEditorPanel::OnMaskSave().


Generated on Tue Jul 29 01:25:47 2014 for Hugintrunk by  doxygen 1.3.9.1