this class is used to draw polygons on an image could be vectorial or not More...
#include <Outline2ToQImage.h>
Classes | |
class | Param |
Static Public Member Functions | |
static void | dumpOutline2VecPNG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, std::vector< std::vector< std::string > > &labelVecVec, Param &pp) |
static void | dumpOutline2VecPNG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, std::vector< std::string > &labelVec, Param &pp) |
static void | dumpOutline2VecPNG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, Param &pp) |
static void | dumpOutline2VecPNG (const char *imageName, std::vector< std::vector< vcg::Point2f > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, Param &pp) |
static void | dumpOutline2VecSVG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, std::vector< std::vector< std::string > > &labelVecVec, std::vector< std::vector< vcg::Similarity2f > > &labelTrVecVec, std::vector< std::vector< float > > &labelRadVec, Param &pp) |
static void | dumpOutline2VecSVG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, std::vector< std::string > &labelVec, Param &pp) |
static void | dumpOutline2VecSVG (const char *imageName, std::vector< std::vector< std::vector< vcg::Point2f > > > &polyVecVec, std::vector< vcg::Similarity2f > &trVec, Param &pp) |
static void | dumpOutline2VecSVG (const char *imageName, std::vector< std::vector< vcg::Point2f > > &outline2Vec, std::vector< vcg::Similarity2f > &trVec, Param &pp) |
static vcg::Point2f | GetIncenter (const std::vector< std::vector< vcg::Point2f > > &polyVec, const vcg::Similarity2f &tra1, float &radius, int resolution=100) |
static float | MM2PT (const float valueMM, float dpi) |
static void | multiOutline2VecToSingleOutline2Vec (const std::vector< std::vector< vcg::Point2f > > &multipolyVec, const std::vector< vcg::Similarity2f > &trVec, const std::vector< int > &indVec, int ind, std::vector< std::vector< vcg::Point2f > > &polyVec, std::vector< vcg::Similarity2f > &trPolyVec) |
static void | multiRectSetToSingleOutline2Vec (std::vector< vcg::Box2f > &rectVec, std::vector< vcg::Similarity2f > &trVec, std::vector< int > &indVec, int ind, std::vector< std::vector< vcg::Point2f > > &polyVec, std::vector< vcg::Similarity2f > &trPolyVec) |
static void | rectSetToOutline2Vec (std::vector< vcg::Box2f > &rectVec, std::vector< std::vector< vcg::Point2f > > &polyVec) |
Static Private Member Functions | |
static void | DrawPolygonMask (const std::vector< std::vector< vcg::Point2f > > &polyVec, QImage &img, vcg::Similarity2f &ret, const vcg::Similarity2f &trans) |
static int | getMaxMaskRadius (int x, int y, QImage &img) |
this class is used to draw polygons on an image could be vectorial or not
this class is used to pass global parameters to the polygonal dumper
Definition at line 15 of file Outline2ToQImage.h.
void Outline2Dumper::DrawPolygonMask | ( | const std::vector< std::vector< vcg::Point2f > > & | polyVec, |
QImage & | img, | ||
vcg::Similarity2f & | ret, | ||
const vcg::Similarity2f & | trans | ||
) | [static, private] |
this class draw a black mask fora given polygon, cenetered and scaled to fit with the image size, it return the transformation to tranform back the polygon to 2D space
RASTERIZE THE POLYGON
find the BB
SET THE TRANSFORMATION TO CENTER WRT BBOX
SET TO RETURN BACK
DRAW THE POLYGON
Definition at line 100 of file Outline2ToQImage.cpp.
static void Outline2Dumper::dumpOutline2VecPNG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
std::vector< std::vector< std::string > > & | labelVecVec, | ||
Param & | pp | ||
) | [static] |
write a polygon on a PNG file, format of the polygon is vector of vector of contours...nested contours are holes takes the name of the image in input, the set of polygons, the set of per polygons transformation, the label to be written and the global parameter for drawing style
static void Outline2Dumper::dumpOutline2VecPNG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
std::vector< std::string > & | labelVec, | ||
Param & | pp | ||
) | [static] |
static void Outline2Dumper::dumpOutline2VecPNG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
Param & | pp | ||
) | [static] |
static void Outline2Dumper::dumpOutline2VecPNG | ( | const char * | imageName, |
std::vector< std::vector< vcg::Point2f > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
Param & | pp | ||
) | [static] |
static void Outline2Dumper::dumpOutline2VecSVG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
std::vector< std::vector< std::string > > & | labelVecVec, | ||
std::vector< std::vector< vcg::Similarity2f > > & | labelTrVecVec, | ||
std::vector< std::vector< float > > & | labelRadVec, | ||
Param & | pp | ||
) | [static] |
takes the name of the image in input, the set of polygons, the set of per polygons transformation, the label to be written and the global parameter for drawing style
static void Outline2Dumper::dumpOutline2VecSVG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
std::vector< std::string > & | labelVec, | ||
Param & | pp | ||
) | [static] |
static void Outline2Dumper::dumpOutline2VecSVG | ( | const char * | imageName, |
std::vector< std::vector< std::vector< vcg::Point2f > > > & | polyVecVec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
Param & | pp | ||
) | [static] |
static void Outline2Dumper::dumpOutline2VecSVG | ( | const char * | imageName, |
std::vector< std::vector< vcg::Point2f > > & | outline2Vec, | ||
std::vector< vcg::Similarity2f > & | trVec, | ||
Param & | pp | ||
) | [static] |
vcg::Point2f Outline2Dumper::GetIncenter | ( | const std::vector< std::vector< vcg::Point2f > > & | polyVec, |
const vcg::Similarity2f & | tra1, | ||
float & | radius, | ||
int | resolution = 100 |
||
) | [static] |
return the point inside the polygon with the bigger distance to the border, this is used to write labels within the polygon, it handle polygons with holes too
INITIALIZE THE IMAGE
DRAW THE MASK
THEN FIND THE CENTROID
THEN GO OVER ALL VERTICES
flipped because of same artifacts of Mquads
if is outside
SECOND TRANSFORMATION
Definition at line 201 of file Outline2ToQImage.cpp.
int Outline2Dumper::getMaxMaskRadius | ( | int | x, |
int | y, | ||
QImage & | img | ||
) | [static, private] |
return the max radius of a point inside a polygon ,given the mask image actually it evaluate the maximum bounding box
if is outside
check on borders
if is outside
Definition at line 165 of file Outline2ToQImage.cpp.
static float Outline2Dumper::MM2PT | ( | const float | valueMM, |
float | dpi | ||
) | [inline, static] |
Definition at line 18 of file Outline2ToQImage.h.
void Outline2Dumper::multiOutline2VecToSingleOutline2Vec | ( | const std::vector< std::vector< vcg::Point2f > > & | multipolyVec, |
const std::vector< vcg::Similarity2f > & | trVec, | ||
const std::vector< int > & | indVec, | ||
int | ind, | ||
std::vector< std::vector< vcg::Point2f > > & | polyVec, | ||
std::vector< vcg::Similarity2f > & | trPolyVec | ||
) | [static] |
Definition at line 42 of file Outline2ToQImage.cpp.
void Outline2Dumper::multiRectSetToSingleOutline2Vec | ( | std::vector< vcg::Box2f > & | rectVec, |
std::vector< vcg::Similarity2f > & | trVec, | ||
std::vector< int > & | indVec, | ||
int | ind, | ||
std::vector< std::vector< vcg::Point2f > > & | polyVec, | ||
std::vector< vcg::Similarity2f > & | trPolyVec | ||
) | [static] |
Definition at line 21 of file Outline2ToQImage.cpp.
void Outline2Dumper::rectSetToOutline2Vec | ( | std::vector< vcg::Box2f > & | rectVec, |
std::vector< std::vector< vcg::Point2f > > & | polyVec | ||
) | [static] |
Definition at line 6 of file Outline2ToQImage.cpp.