STIRA  0.1
Public Member Functions | Static Public Member Functions | List of all members
stira::imagetools::DrawImageTools Class Reference

Class with operations on image objects; This class draws within an existing image without creating a new image object. More...

#include <DrawImageTools.h>

Public Member Functions

 DrawImageTools ()
 constructor
 
 ~DrawImageTools ()
 destructor
 

Static Public Member Functions

static void DrawSquare (Image *pImageInOut, common::Point< int > myCenterPoint, int halfLength, ColorValue newColor)
 
static void DrawRectangle (ArrayGrid< double > *pGridInOut, common::Point< int > myTopLeftPoint, common::Point< int > myBottomRightPoint, double newValue, bool fillSurface)
 
static void DrawRectangle (ArrayGrid< double > *pGridInOut, common::RectangularROI< int > rroi, double newValue, bool fillSurface)
 
static void DrawRectangle (Image *pImageInOut, common::Point< int > myTopLeftPoint, common::Point< int > myBottomRightPoint, double newValue, bool fillSurface)
 
static void DrawRectangle (Image *pImageInOut, common::RectangularROI< int > rroi, double newValue, bool fillSurface)
 
static void DrawRectangle (Image *pImageInOut, common::Point< int > myTopLeftPoint, common::Point< int > myBottomRightPoint, ColorValue newColorValue, bool fillSurface)
 
static void DrawRectangle (Image *pImageInOut, common::RectangularROI< int > rroi, ColorValue newColorValue, bool fillSurface)
 
static void DrawDisk (Image *pImageInOut, common::Point< int > myCenterPoint, double radius, ColorValue newColor=ColorValue(255, 0, 0, TYPE_RGB))
 
static void DrawDisk (ArrayGrid< double > *pGridInOut, common::Point< int > myCenterPoint, double radius, double newValue)
 
static void Plot8CirclePoints (Image *pImage, int xCenter, int yCenter, int x, int y, ColorValue cv)
 
static void DrawCircle (Image *pImageInOut, common::Point< int > myCenterPoint, double radius, ColorValue newColor=ColorValue(255, 0, 0, TYPE_RGB))
 
static void DrawPolygon (Image *pImageInOut, common::Polygon myPolygon, ColorValue newColor)
 
static void DrawPolygon (ArrayGrid< double > *pGridInOut, common::Polygon myPolygon, double newValue)
 
static std::vector< common::Point< int > > DrawLine (Image *pImageInOut, int xStart, int xStop, int yStart, int yStop, ColorValue newColor=ColorValue(255, 0, 0, TYPE_RGB))
 
static std::vector< common::Point< int > > DrawLine (Image *pImageInOut, common::Point< int > startPoint, common::Point< int > stopPoint, ColorValue newColor=ColorValue(255, 0, 0, TYPE_RGB))
 
static std::vector< common::Point< int > > DrawLine (ArrayGrid< double > *pGridInOut, common::Point< int > startPoint, common::Point< int > stopPoint, double newValue)
 
static void DrawArrow (Image *pImage, common::Point< int > p, common::Point< int > q, ColorValue cv, const float scale=0.2)
 
static void DrawPoint (Image *pImageInOut, int x, int y, ColorValue newColor)
 
static void DrawPoint (Image *pImageInOut, common::Point< int > myPoint, ColorValue newColor)
 
static void DrawPoint (ArrayGrid< double > *pGridInOut, common::Point< int > myPoint, double newValue)
 
static void DrawPoint (ArrayGrid< double > *pGridInOut, int x, int y, double newValue)
 
static void DrawPoints (ArrayGrid< double > *pGridInOut, std::vector< common::Point< int > > vPoints, double newValue)
 
static void DrawPoints (Image *pImageInOut, std::vector< common::Point< int > > vPoints, ColorValue newColor)
 
static ImageDrawBoolOnInput (ArrayGrid< double > *pGrid, ArrayGrid< bool > *pGridBool, ColorValue cv=ColorValue(255, 0, 0, TYPE_RGB))
 

Detailed Description

Class with operations on image objects; This class draws within an existing image without creating a new image object.

Member Function Documentation

Image * stira::imagetools::DrawImageTools::DrawBoolOnInput ( ArrayGrid< double > *  pGrid,
ArrayGrid< bool > *  pGridBool,
ColorValue  cv = ColorValue( 255, 0, 0, TYPE_RGB ) 
)
static

Creates a greyscale image with color points where pGridBool has value true

Parameters
pGridinput grid on which the greyscale image will be based
pGridBoolthe boolean mask of points to draw in the specified color
cvthe color value to use to draw the points with value "true" in the pGridBool

References stira::imagedata::Image::AddBand(), stira::imagedata::ArrayGrid< T >::Clone(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::ArrayGrid< T >::GetWidth(), and stira::imagedata::Image::SetColor().

void stira::imagetools::DrawImageTools::DrawCircle ( Image pImageInOut,
common::Point< int >  myCenterPoint,
double  radius,
ColorValue  newColor = ColorValue( 255, 0, 0, TYPE_RGB ) 
)
static

Draws a circle contour of given color in an image Reference: http://www.tutorialspoint.com/computer_graphics/circle_generation_algorithm.htm

Parameters
pImageInOutimage to draw on
myCenterPointcentral point of circle to draw
radiusradius of circle to draw
newColorcolor of circle

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::DrawDisk ( Image pImageInOut,
common::Point< int >  myCenterPoint,
double  radius,
ColorValue  newColor = ColorValue( 255, 0, 0, TYPE_RGB ) 
)
static

Draws a filled disk of given color in an image

Parameters
pImageInOutimage to draw on
myCenterPointcentral point of circle to draw
radiusradius of circle to draw
newColorcolor of circle

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::DrawDisk ( ArrayGrid< double > *  pGridInOut,
common::Point< int >  myCenterPoint,
double  radius,
double  newValue 
)
static

Draws a filled disk of given color in an ArrayGrid

Parameters
pGridInOutgrid to draw on
myCenterPointcentral point of circle to draw
radiusradius of circle to draw
newValuevalue of pixels inside the circle

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

std::vector< Point< int > > stira::imagetools::DrawImageTools::DrawLine ( Image pImageInOut,
int  xStart,
int  xStop,
int  yStart,
int  yStop,
ColorValue  newColor = ColorValue( 255, 0, 0, TYPE_RGB ) 
)
static

Draws a line of given color in an image

Parameters
pImageInOutimage to draw on
xStartx coordinate of start point on line to draw
xStopx coordinate of stop point on line to draw
yStarty coordinate of start point on line to draw
yStopy coordinate of stop point on line to draw
newColorcolor of line

References stira::common::DrawFigures::BresenhamDrawLine().

Referenced by DrawLine(), and stira::imageanalysis::HOG::VisualizeHogDescriptor().

std::vector< Point< int > > stira::imagetools::DrawImageTools::DrawLine ( Image pImageInOut,
common::Point< int >  startPoint,
common::Point< int >  stopPoint,
ColorValue  newColor = ColorValue( 255, 0, 0, TYPE_RGB ) 
)
static

Draws a line of given color in an image

Parameters
pImageInOutimage to draw on
startPointstart point of line to draw
stopPointstop point of line to draw
newColorcolor of line

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

std::vector< common::Point< int > > stira::imagetools::DrawImageTools::DrawLine ( ArrayGrid< double > *  pGridInOut,
common::Point< int >  startPoint,
common::Point< int >  stopPoint,
double  newValue 
)
static

Draws a line of given color in an image

Parameters
pImageInOutimage to draw on
startPointstart point of line to draw
stopPointstop point of line to draw
newColorcolor of line

References stira::common::DrawFigures::BresenhamDrawLine(), DrawLine(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::DrawPoint ( Image pImageInOut,
int  x,
int  y,
ColorValue  newColor 
)
static

Draws a point of given color in an image

Parameters
pImageInOutimage to draw on
xx coordinate of point
yy coordinate of point
newColorcolor to draw point in

References stira::imagedata::Image::SetColor().

void stira::imagetools::DrawImageTools::DrawPoint ( Image pImageInOut,
common::Point< int >  myPoint,
ColorValue  newColor 
)
static

Draws a point of given color in an image

Parameters
pImageInOutimage to draw on
myPointpoint to draw
newColorcolor to draw point in

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::DrawPoint ( ArrayGrid< double > *  pGridInOut,
common::Point< int >  myPoint,
double  newValue 
)
static

Draws a point of given color in an ArrayGrid

Parameters
pGridInOutgrid to draw on
myPointpoint to draw
newValueintensity to draw point in

References stira::imagedata::ArrayGrid< T >::SetValue().

void stira::imagetools::DrawImageTools::DrawPoint ( ArrayGrid< double > *  pGridInOut,
int  x,
int  y,
double  newValue 
)
static

Draws a point of given color in an ArrayGrid

Parameters
pGridInOutgrid to draw on
xx coordinate of point to draw
yy coordinate of point to draw
newValueintensity to draw point in

References stira::imagedata::ArrayGrid< T >::SetValue().

void stira::imagetools::DrawImageTools::DrawPoints ( ArrayGrid< double > *  pGridInOut,
std::vector< common::Point< int > >  vPoints,
double  newValue 
)
static

Draws a vector of points of given color in an image

Parameters
pGridInOutgrid to draw on
vPointsvector of points to draw
newValuenew value to set for the selected points

References stira::imagedata::ArrayGrid< T >::SetValue().

static void stira::imagetools::DrawImageTools::DrawPoints ( Image pImageInOut,
std::vector< common::Point< int > >  vPoints,
ColorValue  newColor 
)
static

Draws a vector of points of given color in an image

Parameters
pImageInOutimage to draw on
vPointsvector of points to draw
newColorcolor of square
void stira::imagetools::DrawImageTools::DrawPolygon ( Image pImageInOut,
common::Polygon  myPolygon,
ColorValue  newColor 
)
static

Draws a polygon contour of given color in an image

Parameters
pImageInOutimage to draw on
myPolygonpolygon object to draw
newColorcolor of polygon

References stira::common::Polygon::GetNumberOfVertices(), stira::common::Polygon::GetVertex(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::DrawPolygon ( ArrayGrid< double > *  pGridInOut,
common::Polygon  myPolygon,
double  newValue 
)
static

Draws a polygon contour of given intensity on grid

Parameters
pGridInOutgrid to draw on
myPolygonpolygon object to draw
newValuevalue of polygon lines

References stira::common::Polygon::GetNumberOfVertices(), and stira::common::Polygon::GetVertexInt().

void stira::imagetools::DrawImageTools::DrawRectangle ( ArrayGrid< double > *  pGridInOut,
common::Point< int >  myTopLeftPoint,
common::Point< int >  myBottomRightPoint,
double  newValue,
bool  fillSurface 
)
static

Draws a rectangle of given intensity on grid

Parameters
pGridInOutgrid to draw on
myTopLeftPointtop left point of rectangle to draw
myBottomRightPointbottom right point of rectangle to draw
newValuevalue to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::imagedata::ArrayGrid< T >::SetValue(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

Referenced by stira::imageanalysis::HOG::VisualizeHogDescriptor().

void stira::imagetools::DrawImageTools::DrawRectangle ( ArrayGrid< double > *  pGridInOut,
common::RectangularROI< int >  rroi,
double  newValue,
bool  fillSurface 
)
static

Draws a rectangle of given intensity on grid

Parameters
pGridInOutgrid to draw on
rroirectangle ROI to draw
newValuevalue to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::common::RectangularROI< T >::GetBottomRightCorner(), and stira::common::RectangularROI< T >::GetTopLeftCorner().

void stira::imagetools::DrawImageTools::DrawRectangle ( Image pImageInOut,
common::Point< int >  myTopLeftPoint,
common::Point< int >  myBottomRightPoint,
double  newValue,
bool  fillSurface 
)
static

Draws a rectangle of given color (all bands same value) on an image

Parameters
pGridInOutgrid to draw on
myTopLeftPointtop left point of rectangle to draw
myBottomRightPointbottom right point of rectangle to draw
newValuevalue to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::imagedata::Image::GetBands(), and stira::imagedata::Image::GetNumberOfBands().

void stira::imagetools::DrawImageTools::DrawRectangle ( Image pImageInOut,
common::RectangularROI< int >  rroi,
double  newValue,
bool  fillSurface 
)
static

Draws a rectangle of given color (all bands same value) on an image

Parameters
pImageInOutimage to draw on
rroirectangle ROI to draw
newValuevalue to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::imagedata::Image::GetBands(), and stira::imagedata::Image::GetNumberOfBands().

void stira::imagetools::DrawImageTools::DrawRectangle ( Image pImageInOut,
common::Point< int >  myTopLeftPoint,
common::Point< int >  myBottomRightPoint,
ColorValue  newColorValue,
bool  fillSurface 
)
static

Draws a rectangle of given color on an image

Parameters
pImageInOutimage to draw on
myTopLeftPointtop left point of rectangle to draw
myBottomRightPointbottom right point of rectangle to draw
newColorValuecolor to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::imagedata::ColorValue::c, stira::imagedata::Image::GetBands(), and stira::imagedata::Image::GetNumberOfBands().

void stira::imagetools::DrawImageTools::DrawRectangle ( Image pImageInOut,
common::RectangularROI< int >  rroi,
ColorValue  newColorValue,
bool  fillSurface 
)
static

Draws a rectangle of given color on an image

Parameters
pImageInOutimage to draw on
rroirectangle ROI to draw
newColorValuecolor to set inside the rectangle
fillSurfaceflag whether or not the rectangle should be filled; if false, only the circumference is drawn

References stira::imagedata::ColorValue::c, stira::imagedata::Image::GetBands(), and stira::imagedata::Image::GetNumberOfBands().

void stira::imagetools::DrawImageTools::DrawSquare ( Image pImageInOut,
common::Point< int >  myCenterPoint,
int  halfLength,
ColorValue  newColor 
)
static

Draws a square of given color in an image

Parameters
pImageInOutimage to draw on
myCenterPointcentral point of square to draw
halfLengthhalf of side of square to draw
newColorcolor of square

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

void stira::imagetools::DrawImageTools::Plot8CirclePoints ( Image pImage,
int  xCenter,
int  yCenter,
int  x,
int  y,
ColorValue  cv 
)
static

Helper function for the DrawCircle method if (a,b) is on the circle, then also (-a,b), (a,-b), (-a,-b), (b,a), (-b,a), (b,-a), (-b,-a) are on that circle Reference: http://www.tutorialspoint.com/computer_graphics/circle_generation_algorithm.htm

Parameters
pImageInOutimage to draw on
xCenterx coordinate of central point of circle to draw
yCentery coordinate of central point of circle to draw
xx coordinate of point on circle
yy coordinate of point on circle
cvcolor to draw circle points in

References stira::imagedata::Image::SetColor().


The documentation for this class was generated from the following files: