IVT

Functions for drawing 2D primitives into images. More...
Functions  
void  DrawPoint (CByteImage *pImage, const Vec2d &point, int r=255, int g=255, int b=255) 
Draws a point into a CByteImage. More...  
void  DrawPoint (CByteImage *pImage, int x, int y, int r=255, int g=255, int b=255) 
Draws a point into a CByteImage. More...  
void  DrawPointBlended (CByteImage *pImage, const Vec2d &point, int r=255, int g=255, int b=255, float blend=1.0f) 
Draws a point into a CByteImage, with blending. More...  
void  DrawPointBlended (CByteImage *pImage, int x, int y, int r=255, int g=255, int b=255, float blend=1.0f) 
Draws a point into a CByteImage, with blending. More...  
void  DrawPoints (CByteImage *pImage, const CVec2dArray &points, int r=255, int g=255, int b=255) 
Draws a list of points of type CVec2dArray into a CByteImage. More...  
void  DrawRegion (CByteImage *pImage, const MyRegion ®ion, int r=255, int g=255, int b=255, int thickness=1) 
Draws a rectangle into a CByteImage. More...  
void  DrawCircle (CByteImage *pImage, float mx, float my, float radius, int r=255, int g=255, int b=255, int thickness=1, bool bAntiAlias=false) 
Draws a circle into a CByteImage. More...  
void  DrawCircle (CByteImage *pImage, const Vec2d ¢er, float radius, int r=255, int g=255, int b=255, int thickness=1, bool bAntiAlias=false) 
Draws a circle into a CByteImage. More...  
void  DrawCircle (CByteImage *pImage, const Circle2d &circle, int r=255, int g=255, int b=255, int thickness=1, bool bAntiAlias=false) 
Draws a circle into a CByteImage. More...  
void  DrawEllipse (CByteImage *pImage, const Ellipse2d &ellipse, int r=255, int g=255, int b=255, int thickness=1) 
Draws an ellipse into a CByteImage. More...  
void  DrawLine (CByteImage *pImage, const PointPair2d &line, int r=255, int g=255, int b=255, int thickness=1) 
Draws a line segment into a CByteImage, given its two end points. More...  
void  DrawLine (CByteImage *pImage, const Vec2d &p1, const Vec2d &p2, int r=255, int g=255, int b=255, int thickness=1) 
Draws a line segment into a CByteImage, given its two end points. More...  
void  DrawLinePolar (CByteImage *pImage, float theta, float r, int color_r, int color_g, int color_b, int thickness=1) 
Draws a straight line into a CByteImage, given its parameters in polar form. More...  
void  DrawLineNormal (CByteImage *pImage, float nx, float ny, float c, int r, int g, int b, int thickness=1) 
Draws a line into a CByteImage, given its parameters in normal form. More...  
void  DrawLine (CByteImage *pImage, const StraightLine2d &line, int r, int g, int b, int thickness=1) 
Draws a line into a CByteImage, given its representation as StraightLine2d. More...  
void  DrawCross (CByteImage *pImage, const Vec2d &point, int length, int r, int g, int b) 
Draws a small cross into a CByteImage. More...  
void  DrawPolygon (CByteImage *pImage, const Vec2d *pPoints, int nPoints, int r, int g, int b, int thickness=1) 
Draws a polygon into a CByteImage. More...  
void  DrawPolygon (CByteImage *pImage, const CVec2dArray &points, int r, int g, int b, int thickness=1) 
Draws a polygon into a CByteImage. More...  
void  DrawRectangle (CByteImage *pImage, const Rectangle2d &rectangle, int r, int g, int b, int thickness=1) 
Draws a rectangle into a CByteImage. More...  
Functions for drawing 2D primitives into images.
void PrimitivesDrawer::DrawCircle  (  CByteImage *  pImage, 
float  mx,  
float  my,  
float  radius,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 , 

bool  bAntiAlias = false 

) 
Draws a circle into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Circle points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  mx  The xcoordinate of the center of the circle. 
[in]  my  The xcoordinate of the center of the circle. 
[in]  radius  The radius of the circle. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. 
[in]  bAntiAlias  If set to true, antialiasing will be applied for drawing. 
Definition at line 417 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawCircle  (  CByteImage *  pImage, 
const Vec2d &  center,  
float  radius,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 , 

bool  bAntiAlias = false 

) 
Draws a circle into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Circle points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
Internally, the function PrimitivesDrawer::DrawCircle(CByteImage*, float, float, float, int, int, int, int, bool) is called.
[out]  pImage  The target image. 
[in]  center  The center of the circle. 
[in]  radius  The radius of the circle. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. 
[in]  bAntiAlias  If set to true, antialiasing will be applied for drawing. 
Definition at line 539 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawCircle  (  CByteImage *  pImage, 
const Circle2d &  circle,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 , 

bool  bAntiAlias = false 

) 
Draws a circle into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Circle points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
Internally, the function PrimitivesDrawer::DrawCircle(CByteImage*, float, float, float, int, int, int, int, bool) is called.
[out]  pImage  The target image. 
[in]  circle  The circle representation. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. 
[in]  bAntiAlias  If set to true, antialiasing will be applied for drawing. 
Definition at line 544 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawCross  (  CByteImage *  pImage, 
const Vec2d &  point,  
int  length,  
int  r,  
int  g,  
int  b  
) 
Draws a small cross into a CByteImage.
The cross consists of two line segments (a vertical and a horizontal one) of same size intersecting each other in the center of the cross.
The function is safe, i.e. it checks for image boundaries. Points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  point  The center of the cross. 
[in]  length  The length of each of the two lines of the cross. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
Definition at line 615 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawEllipse  (  CByteImage *  pImage, 
const Ellipse2d &  ellipse,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 

) 
Draws an ellipse into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Ellipse points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  ellipse  This parameter specifies the location, orientation and shape of the ellipse. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. 
Definition at line 990 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawLine  (  CByteImage *  pImage, 
const PointPair2d &  line,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 

) 
Draws a line segment into a CByteImage, given its two end points.
The function is safe, i.e. it checks for image boundaries. Line points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
Internally, the function DrawLine(CByteImage*, const Vec2d&, const Vec2d&, int, int, int, int) is called.
[out]  pImage  The target image. 
[in]  line  This parameter specifies the two end points of the straight line segment. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the line. 
Definition at line 298 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawLine  (  CByteImage *  pImage, 
const Vec2d &  p1,  
const Vec2d &  p2,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 

) 
Draws a line segment into a CByteImage, given its two end points.
The function is safe, i.e. it checks for image boundaries. Line points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  p1  The first end point of the straight line segment. 
[in]  p2  The second end point of the straight line segment. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the line. 
Definition at line 201 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawLine  (  CByteImage *  pImage, 
const StraightLine2d &  line,  
int  r,  
int  g,  
int  b,  
int  thickness = 1 

) 
Draws a line into a CByteImage, given its representation as StraightLine2d.
The function is safe, i.e. it checks for image boundaries. Line points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
Internally, the function PrimitivesDrawer::DrawLineNormal(CByteImage*, float, float, float, int, int, int) is called.
[out]  pImage  The target image. 
[in]  line  The line representation. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the line. 
Definition at line 610 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawLineNormal  (  CByteImage *  pImage, 
float  nx,  
float  ny,  
float  c,  
int  r,  
int  g,  
int  b,  
int  thickness = 1 

) 
Draws a line into a CByteImage, given its parameters in normal form.
The equation of the straight line reads:
The function is safe, i.e. it checks for image boundaries. Line points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  nx  The xcomponent of the normal vector. 
[in]  ny  The ycomponent of the normal vector. 
[in]  c  If nx and ny are normalized, this parameter specifies the distance of the straight line to the origin in pixels. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the line. 
Definition at line 549 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawLinePolar  (  CByteImage *  pImage, 
float  theta,  
float  r,  
int  color_r,  
int  color_g,  
int  color_b,  
int  thickness = 1 

) 
Draws a straight line into a CByteImage, given its parameters in polar form.
The equation of the straight line reads:
.
The function is safe, i.e. it checks for image boundaries. Line points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
Internally, the function PrimitivesDrawer::DrawLineNormal(CByteImage*, float, float, float, int, int, int) is called.
[out]  pImage  The target image. 
[in]  theta  The angle of the normal to the line in radians. theta = 0.0f draws a vertical line. 
[in]  r  The distance of the straight line to the origin in pixels. 
[in]  color_r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  color_g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  color_b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the line. 
Definition at line 605 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPoint  (  CByteImage *  pImage, 
const Vec2d &  point,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 

) 
Draws a point into a CByteImage.
The function is safe, i.e. it checks for image boundaries. If the point is outside the image, this function returns.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  point  The location of the point to be drawn. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
Definition at line 82 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPoint  (  CByteImage *  pImage, 
int  x,  
int  y,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 

) 
Draws a point into a CByteImage.
The function is safe, i.e. it checks for image boundaries. If the point is outside the image, this function returns.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  x  The xcoordinate of the point to be drawn. 
[in]  y  The ycoordinate of the point to be drawn. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
Definition at line 87 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPointBlended  (  CByteImage *  pImage, 
const Vec2d &  point,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

float  blend = 1.0f 

) 
Draws a point into a CByteImage, with blending.
The function is safe, i.e. it checks for image boundaries. If the point is outside the image, this function returns.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  point  The location of the point to be drawn. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  blend  The parameter for adjusting the amount of blending. It must be 0.0f <= blend <= 1.0f. blend = 1.0f means that no transparency will be applied. 
Definition at line 116 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPointBlended  (  CByteImage *  pImage, 
int  x,  
int  y,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

float  blend = 1.0f 

) 
Draws a point into a CByteImage, with blending.
The function is safe, i.e. it checks for image boundaries. If the point is outside the image, this function returns.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  x  The xcoordinate of the point to be drawn. 
[in]  y  The ycoordinate of the point to be drawn. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  blend  The parameter for adjusting the amount of blending. It must be 0.0f <= blend <= 1.0f. blend = 1.0f means that no transparency will be applied. 
Definition at line 121 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPoints  (  CByteImage *  pImage, 
const CVec2dArray &  points,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 

) 
Draws a list of points of type CVec2dArray into a CByteImage.
The function is safe, i.e. it checks for image boundaries. If the point is outside the image, this function returns.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  points  The list of type CVec2dArray, containing the points to be drawn. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
Definition at line 170 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPolygon  (  CByteImage *  pImage, 
const Vec2d *  pPoints,  
int  nPoints,  
int  r,  
int  g,  
int  b,  
int  thickness = 1 

) 
Draws a polygon into a CByteImage.
The provided points must build a polygon in the given order.
The function is safe, i.e. it checks for image boundaries. Polygon points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  pPoints  An array of points containing the points of the polygon in order. 
[in]  nPoints  The number of points. Must be >= 3. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. The polygon will be closed if the first and last point are not equal. If set to 1 the polygon is filled, otherwise must be >= 1. 
Definition at line 954 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawPolygon  (  CByteImage *  pImage, 
const CVec2dArray &  points,  
int  r,  
int  g,  
int  b,  
int  thickness = 1 

) 
Draws a polygon into a CByteImage.
The provided points must build a polygon in the given order.
The function is safe, i.e. it checks for image boundaries. Polygon points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
This is a convenience function calling DrawPolygon(CByteImage*, const Vec2d*, int, int, int, int, int);
[out]  pImage  The target image. 
[in]  points  The list of points containing the points of the polygon in order. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. The polygon will be closed if the first and last point are not equal. If set to 1 the polygon is filled, otherwise must be >= 1. 
Definition at line 976 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawRectangle  (  CByteImage *  pImage, 
const Rectangle2d &  rectangle,  
int  r,  
int  g,  
int  b,  
int  thickness = 1 

) 
Draws a rectangle into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Polygon points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  rectangle  The rectangle representation. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. The polygon will be closed if the first and last point are not equal. If set to 1 the polygon is filled, otherwise must be >= 1. 
Definition at line 1096 of file PrimitivesDrawer.cpp.
void PrimitivesDrawer::DrawRegion  (  CByteImage *  pImage, 
const MyRegion &  region,  
int  r = 255 , 

int  g = 255 , 

int  b = 255 , 

int  thickness = 1 

) 
Draws a rectangle into a CByteImage.
The function is safe, i.e. it checks for image boundaries. Rectangle points lying outside the image will not be drawn.
All types of CByteImage are supported (CByteImage::eGrayScale, CByteImage::eRGB24, CByteImage::eRGB24Split).
[out]  pImage  The target image. 
[in]  region  This parameter specifies the location and size of the rectangle. 
[in]  r  The red component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  g  The green component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  b  The blue component (RGB) of the color to be used for drawing. It must be 0 <= r <= 255. 
[in]  thickness  This parameter specifies the thickness of the lines. 
Definition at line 179 of file PrimitivesDrawer.cpp.