CVR-Lib last update 20 Sep 2009

cvr::draw< T > Class Template Reference

Object for drawing a number of geometric figures and lists thereof, simple texts and a few other types with graphic representation in a cvr::matrix. More...

#include <cvrDraw.h>

Inheritance diagram for cvr::draw< T >:

Inheritance graph
[legend]
Collaboration diagram for cvr::draw< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 draw ()
 draw (const draw< T > &other)
 ~draw ()
const std::string & name () const
virtual draw< T > * clone () const
virtual draw< T > * newInstance () const
virtual void use (matrix< T > &img)
virtual matrix< T > & getCanvas ()
virtual const matrix< T > & getCanvas () const
ipoint getCanvasSize ()
void setColor (const T &px)
void setColor (const char *color)
void setGray (const float k)
const T & getColor () const
void scale (const double factor)
void clear ()
void fill (const ipoint &seed)
void fill (int x, int y)
void fillUntil (const ipoint &seed, const T &stopColor)
void fillUntil (int x, int y, const T &stopColor)
void set (int x, int y)
void set (const ipoint &p)
void line (int fx, int fy, int tx, int ty)
void line (const ipoint &p1, const ipoint &p2)
void line (const cvr::line< int > &l)
void lineTo (int x, int y)
void lineTo (const ipoint &p)
virtual void moveTo (int x, int y)
void verticalLine (int x, int y1, int y2)
void verticalLine (const ipoint &p1, const ipoint &p2)
void horizontalLine (int x1, int x2, int y)
void horizontalLine (const ipoint &p1, const ipoint &p2)
void arrow (int fx, int fy, int tx, int ty, const float &size=0.2f)
void arrow (const ipoint &p1, const ipoint &p2, const float &size=0.2f)
void rectangle (const cvr::rectangle< int > &r, bool filled=false)
void rectangle (const cvr::rectangle< int > &r, const float angle, bool filled)
void rectangle (const ipoint &upperLeft, const ipoint &bottomRight, bool filled=false)
void rectangle (const ipoint &upperLeft, const ipoint &bottomRight, const float angle, bool filled=false)
void rectangle (int xl, const int yu, int xr, int yb, bool filled=false)
void rectangle (int xl, const int yu, int xr, int yb, const float angle, bool filled=false)
void polygon (const ipolygonPoints &poly, bool filled=false, const float angle=0.0f, const ipoint &shift=ipoint(0, 0))
void circle (const ipoint &p1, int r, bool filled=false)
void circle (int x, int y, int r, bool filled=false)
void ellipse (const ipoint &p1, int aX, int aY, bool filled=false)
void ellipse (const ipoint &p1, int aX, int aY, const float &angle, bool filled=false)
void arc (const ipoint &p1, const ipoint &pA, const ipoint &pB)
void set (const ipointList &c, const ipoint &offset=ipoint(0, 0))
void set (const location &loc, bool showAngleLine=false)
void set (const rectLocation &loc, bool showAngleLine=false)
void set (const affineLocation &loc, bool approximateEllipse=false, bool showAngleLine=false)
void set (const list< location > &locs, bool showAngleLine=false)
void set (const list< affineLocation > &locs, bool approximateEllipse=false, bool showAngleLine=false)
void set (const dvector &vct, const T &axisColor, bool forceAxis0=true)
void set (const fvector &vct, const T &axisColor, bool forceAxis0=true)
void set (const ivector &vct, const T &axisColor, bool forceAxis0=true)
void grid (const ipoint &delta, bool interval=true)
void overlay (const channel &overlay, int x=0, int y=0)
void overlay (const channel &overlay, const ipoint &p)
void overlay (const channel8 &overlay, int x=0, int y=0)
void overlay (const channel8 &overlay, const ipoint &p)
void number (int num, const ipoint &p1=ipoint(0, 0), const float &s=0.03125f)
void number (int num, int x, int y, const float &s)
void number (int num, int x, int y)
void text (const std::string txt, const ipoint &upperleft=ipoint(0, 0), const ipoint &scale=ipoint(1, 1), const float opaqueness=1.0f, bool horizontal=true)
void text (const std::string txt, int x, int y, const ipoint &scale, const float opaqueness, bool horizontal)
void text (const std::string txt, int x, int y)

Protected Member Functions

bool inCanvas (const ipoint &p) const
bool inCanvas (int x, int y) const
bool correctLine (int &x, int &y, int x2, int y2)
void enterPX (const ipoint &p, int *x1, int *x2, int &miny, int &maxy)
void drawSymbol (int x, int y)
void drawSymbol (int x, int y, int w, typename drawBase< T >::eMarkerType t)
void drawSymbol (int x, int y, int w, const char *style)

Static Protected Member Functions

static ipoint turnPoint (const float x, const float y, float angle)

Protected Attributes

matrix< T > * img_
actColor_


Detailed Description

template<class T>
class cvr::draw< T >

Object for drawing a number of geometric figures and lists thereof, simple texts and a few other types with graphic representation in a cvr::matrix.

There are also methods to draw Matlab-style markers instead of single pixels for points (see marker()).

The type T of this template class corresponds to the type T of the matrix.

Example:

if you want to draw on a channel, you can create an instance of the draw-object this way:

 cvr::draw<cvr::channel::value_type> drawer;  // drawer for channels
 cvr::channel canvas(256,256,0.0f);   // a channel to draw on

 drawer.use(canvas);                  // draw on canvas
 drawer.setColor(0.5f);               // use gray
 drawer.line(0,0,255,255);            // draw a line from to upper-left
                                      // to the bottom-right corner.

Constructor & Destructor Documentation

template<class T>
cvr::draw< T >::draw (  ) 

default constructor

template<class T>
cvr::draw< T >::draw ( const draw< T > &  other  ) 

copy constructor

template<class T>
cvr::draw< T >::~draw (  ) 

destructor


Member Function Documentation

template<class T>
void cvr::draw< T >::arc ( const ipoint p1,
const ipoint pA,
const ipoint pB 
) [virtual]

draw an arc from 'pA' to 'pB', clockwise around center 'p1'.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::arrow ( const ipoint p1,
const ipoint p2,
const float &  size = 0.2f 
) [inline, virtual]

draw an arrow from point p1 to point p2

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::arrow ( int  fx,
int  fy,
int  tx,
int  ty,
const float &  size = 0.2f 
) [virtual]

draw an arrow.

arrow tip will be at (tx, ty). If size<1.0 then tipsize will be the relative portion of arrow length. If size>1.0 then tipsize will be (int)size, independent of arrow length.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::circle ( int  x,
int  y,
int  r,
bool  filled = false 
) [inline]

draw a circle with circle center (x, y) and radius 'r'

template<class T>
void cvr::draw< T >::circle ( const ipoint p1,
int  r,
bool  filled = false 
) [virtual]

draw a circle with circle center 'p1' and radius 'r'

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::clear (  ) 

fills the canvas with the actual color

template<class T>
virtual draw<T>* cvr::draw< T >::clone (  )  const [virtual]

Creates a copy of this object.

Implements cvr::object.

template<class T>
bool cvr::draw< T >::correctLine ( int &  x,
int &  y,
int  x2,
int  y2 
) [protected]

Checks if the line-segment between (x, y) and (x2, y2) lies within the image.

If (x, y) lays out of the image boudaries it will be "transformed" to a point in the image

template<class T>
void cvr::draw< T >::drawSymbol ( int  x,
int  y,
int  w,
const char *  style 
) [protected, virtual]

Draws a symbol at the given location.

Used by the marker() methods.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::drawSymbol ( int  x,
int  y,
int  w,
typename drawBase< T >::eMarkerType  t 
) [protected]

Draws a symbol at the given location.

Used by the marker() methods.

template<class T>
void cvr::draw< T >::drawSymbol ( int  x,
int  y 
) [protected]

Draws a symbol set with the method setStyle() at the given position.

Used by the marker() methods.

template<class T>
void cvr::draw< T >::ellipse ( const ipoint p1,
int  aX,
int  aY,
const float &  angle,
bool  filled = false 
) [virtual]

draw an ellipse with center 'p1' and main axes 'aX' and 'aY'

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::ellipse ( const ipoint p1,
int  aX,
int  aY,
bool  filled = false 
) [virtual]

draw an ellipse with center 'p1' and main axes 'aX' and 'aY'

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::enterPX ( const ipoint p,
int *  x1,
int *  x2,
int &  miny,
int &  maxy 
) [inline, protected]

This is need for drawing filled rotated ellipses this enters a point into the point list, the first one into x1 the second one into x2 if any more come, they are merged into the closest one.

The vectors x1 and x2 can be seen as input- or output point lists, while miny and maxy contain the range of y values used until now.

You must ensure that the x1 and x2 arrays are bigger than the value contained in p.y.

template<class T>
void cvr::draw< T >::fill ( int  x,
int  y 
) [inline]

fill the canvas with the current color, starting at the given seed until a color different to the original one at the seed is found.

This is similar to the fill tools usually found in paint programs.

template<class T>
void cvr::draw< T >::fill ( const ipoint seed  ) 

fill the canvas with the current color, starting at the given seed until a color different to the original one at the seed is found.

This is similar to the fill tools usually found in paint programs.

template<class T>
void cvr::draw< T >::fillUntil ( int  x,
int  y,
const T &  stopColor 
) [inline]

fillUntil fill the canvas with the current color, starting at the given seed until the stop color is reached.

template<class T>
void cvr::draw< T >::fillUntil ( const ipoint seed,
const T &  stopColor 
)

fillUntil fills the canvas with the current color, starting at the given seed until the stop color is reached.

template<class T>
virtual const matrix<T>& cvr::draw< T >::getCanvas (  )  const [virtual]

get a read-only reference to the image currently being used.

Warning:
if you haven't set any image yet (see use()), an cvr::exception will be thrown

template<class T>
virtual matrix<T>& cvr::draw< T >::getCanvas (  )  [virtual]

get a reference to the image currently being used.

Warning:
if you haven't set any image yet (see use()), an cvr::exception will be thrown

template<class T>
ipoint cvr::draw< T >::getCanvasSize (  )  [virtual]

returns the size of the canvas

Implements cvr::drawBase< T >.

template<class T>
const T& cvr::draw< T >::getColor (  )  const

Get color being used.

template<class T>
void cvr::draw< T >::grid ( const ipoint delta,
bool  interval = true 
) [virtual]

Draws a grid in the image.

The interpretation of delta depends on the value of interval. if interval is true, the values are taken as number of pixels between two grid lines in x and y direction. Otherwise, it is used as number of grid lines.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::horizontalLine ( const ipoint p1,
const ipoint p2 
) [virtual]

Draws a horizontal line from (p1.x, p1.y) to (p2.x, p1.y).

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::horizontalLine ( int  x1,
int  x2,
int  y 
) [virtual]

Draws a horizontal line from (x1, y) to (x2, y).

Implements cvr::drawBase< T >.

template<class T>
bool cvr::draw< T >::inCanvas ( int  x,
int  y 
) const [inline, protected]

Returns "true" if the point is within the image.

template<class T>
bool cvr::draw< T >::inCanvas ( const ipoint p  )  const [inline, protected]

Returns "true" if the point is within the image.

template<class T>
void cvr::draw< T >::line ( const cvr::line< int > &  l  )  [inline]

Draw a line.

See also:
line(int, int, int, int)

template<class T>
void cvr::draw< T >::line ( const ipoint p1,
const ipoint p2 
) [inline, virtual]

Draw a line from the point p to point p2.

Parameters:
p1 initial point
p2 final point
See also:
line(int, int, int, int)

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::line ( int  fx,
int  fy,
int  tx,
int  ty 
) [virtual]

Draw a line from the point (fx, fy) to point (tx, ty).

The "last point" will be defined with the last "set", "line" or "lineTo" method.

Parameters:
fx x coordinate of initial point.
fy y coordinate of initial point.
tx x coordinate of final point.
ty y coordinate of final point.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::lineTo ( const ipoint p  )  [inline, virtual]

Draw a line from the last point to the point p.

The "last point" will be defined with the last "set", "point", "line" or "lineTo" method.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::lineTo ( int  x,
int  y 
) [virtual]

the homogeneus point p represents also a line, which equation is given by p.x*x + p.y*y + p.h*1 = 0.

This line is drawn with this member Draw a line from the last point to (x, y). The "last point" will be defined with the last "set", "point", "line" or "lineTo" method.

Implements cvr::drawBase< T >.

template<class T>
virtual void cvr::draw< T >::moveTo ( int  x,
int  y 
) [virtual]

Doesn't draw anything, only sets the last position to the given coordinates.

This can be useful before using lineTo()

Implements cvr::drawBase< T >.

template<class T>
const std::string& cvr::draw< T >::name (  )  const [virtual]

Gets the name of this object's class.

Reimplemented from cvr::drawBase< T >.

template<class T>
virtual draw<T>* cvr::draw< T >::newInstance (  )  const [virtual]

Creates a new instance of the object's class.

Implements cvr::object.

template<class T>
void cvr::draw< T >::number ( int  num,
int  x,
int  y 
) [inline, virtual]

draw an integer num at position 'x'/'y' with size 's'.

's' must be given as quota of image height (0.0 to 1.0).

See also:
text()
Parameters:
num the number to be written
x the column where the number will be drawn
y the row where the number will be drawn

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::number ( int  num,
int  x,
int  y,
const float &  s 
)

draw an integer num at position 'x'/'y' with size 's'.

's' must be given as quota of image height (0.0 to 1.0).

See also:
text()
Parameters:
num the number to be written
x the column where the number will be drawn
y the row where the number will be drawn
s scale factor as quota of image height

template<class T>
void cvr::draw< T >::number ( int  num,
const ipoint p1 = ipoint(0, 0),
const float &  s = 0.03125f 
)

draw an integer num at position 'p1' with size 's'.

's' must be given as quota of image height (0.0 to 1.0).

See also:
text()
Parameters:
num the number to be written
p1 the position where the number will be drawn
s scale factor as quota of image height

template<class T>
void cvr::draw< T >::overlay ( const channel8 overlay,
const ipoint p 
)

overlay the given channel8 using the actual color The new pixel color is calculated as ((255-c)*old_pixel_color+c*used_color)/255, where c is the channel color and used_color is the color set with setColor()

Parameters:
overlay channel to be overlayed
p position where overlay will be placed

template<class T>
void cvr::draw< T >::overlay ( const channel8 overlay,
int  x = 0,
int  y = 0 
)

overlay the given channel8 using the actual color The new pixel color is calculated as ((255-c)*old_pixel_color+c*used_color)/255, where c is the channel color and used_color is the color set with setColor()

Parameters:
overlay channel8 to be overlayed
x position at x (the column)
y position at y (the row)

template<class T>
void cvr::draw< T >::overlay ( const channel overlay,
const ipoint p 
)

overlay the given channel using the actual color The new pixel color is calculated as (1-c)*old_pixel_color+c*used_color, where c is the channel color and used_color is the color set with setColor().

The given channel will be overlayed at the given position (default 0,0)

Parameters:
overlay channel to be overlayed
p position where overlay will be placed

template<class T>
void cvr::draw< T >::overlay ( const channel overlay,
int  x = 0,
int  y = 0 
)

overlay the given channel using the actual color The new pixel color is calculated as (1-c)*old_pixel_color+c*used_color, where c is the channel color and used_color is the color set with setColor().

The given channel will be overlayed at the given position (default 0,0)

Parameters:
overlay channel to be overlayed
x position at x (the column)
y position at y (the row)

template<class T>
void cvr::draw< T >::polygon ( const ipolygonPoints poly,
bool  filled = false,
const float  angle = 0.0f,
const ipoint shift = ipoint(0, 0) 
) [virtual]

draw a polygon represented by the given polygonPoints list optionally, it can be rotated by the given angle and shifted

Parameters:
poly the polygon vertices
filled true if the polygon must be filled, false otherwise
angle rotation angle on the mean point of the vertices
shift shift amount to the polygon points.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::rectangle ( int  xl,
const int  yu,
int  xr,
int  yb,
const float  angle,
bool  filled = false 
)

draw a rectangle.

Parameters:
xl left x-coordinate.
yu upper y-coordinate.
xr right x-coordinate.
yb bottom y-coordinate.
angle rotation angle at the middle point of the rectangle
filled if true rectangle is filled

template<class T>
void cvr::draw< T >::rectangle ( int  xl,
const int  yu,
int  xr,
int  yb,
bool  filled = false 
) [virtual]

draw a rectangle.

Parameters:
xl left x-coordinate.
yu upper y-coordinate.
xr right x-coordinate.
yb bottom y-coordinate.
filled if true rectangle is filled

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::rectangle ( const ipoint upperLeft,
const ipoint bottomRight,
const float  angle,
bool  filled = false 
) [inline]

draw a rectangle

Parameters:
upperLeft upper left corner of the rectangle with orientation 0
bottomRight bottom right corner of the rectangle with orientation 0
angle rotation angle at the middle point of the rectangle
filled true if the rectangle must be filled, false if only the border needs to be drawn.
See also:
rectangle(int, int, int, int, bool)

template<class T>
void cvr::draw< T >::rectangle ( const ipoint upperLeft,
const ipoint bottomRight,
bool  filled = false 
) [inline, virtual]

draw a rectangle

Parameters:
upperLeft upper left corner of the rectangle with orientation 0
bottomRight bottom right corner of the rectangle with orientation 0
filled true if the rectangle must be filled, false if only the border needs to be drawn.
See also:
rectangle(int, int, int, int, bool)

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::rectangle ( const cvr::rectangle< int > &  r,
const float  angle,
bool  filled 
) [inline]

draw a rotated rectangle

Parameters:
r rectangle (with orientation 0)
angle rotation angle at the middle point of the rectangle
filled true if the rectangle must be filled, false if only the border needs to be drawn.

template<class T>
void cvr::draw< T >::rectangle ( const cvr::rectangle< int > &  r,
bool  filled = false 
) [inline, virtual]

draw a rectangle

Parameters:
r rectangle (with orientation 0)
filled true if the rectangle must be filled, false if only the border needs to be drawn.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::scale ( const double  factor  ) 

scale each pixel value with the given constant

template<class T>
void cvr::draw< T >::set ( const ivector vct,
const T &  axisColor,
bool  forceAxis0 = true 
)

draw the contents of the vector using the whole image

Parameters:
vct the vector to be shown
axisColor color for the axis. The vector will be drawn in the default color (see setColor())
forceAxis0 if true, both axis will be shown, i.e. the value 0 for the vector will be always shown. If false, only the required value-range will be shown

template<class T>
void cvr::draw< T >::set ( const fvector vct,
const T &  axisColor,
bool  forceAxis0 = true 
)

draw the contents of the vector using the whole image

Parameters:
vct the vector to be shown
axisColor color for the axis. The vector will be drawn in the default color (see setColor())
forceAxis0 if true, both axis will be shown, i.e. the value 0 for the vector will be always shown. If false, only the required value-range will be shown

template<class T>
void cvr::draw< T >::set ( const dvector vct,
const T &  axisColor,
bool  forceAxis0 = true 
)

draw the contents of the vector using the whole image

Parameters:
vct the vector to be shown
axisColor color for the axis. The vector will be drawn in the default color (see setColor())
forceAxis0 if true, both axis will be shown, i.e. the value 0 for the vector will be always shown. If false, only the required value-range will be shown

template<class T>
void cvr::draw< T >::set ( const list< affineLocation > &  locs,
bool  approximateEllipse = false,
bool  showAngleLine = false 
) [inline, virtual]

draw a list of locations

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const list< location > &  locs,
bool  showAngleLine = false 
) [inline, virtual]

draw a list of locations

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const affineLocation loc,
bool  approximateEllipse = false,
bool  showAngleLine = false 
) [inline, virtual]

draw an affineLocation.

Parameters:
loc affineLocation
approximateEllipse if true, an ellipse is drawn, otherwise the transformed square
showAngleLine if true, a line from the middle point of the location (given by loc.position) with the angle given by loc.angle will be drawn.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const rectLocation loc,
bool  showAngleLine = false 
) [inline, virtual]

draw a rectLocation

Parameters:
loc location with position, angle and radius
showAngleLine if true, a line from the middle point of the location (given by loc.position) with the angle given by loc.angle will be drawn.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const location loc,
bool  showAngleLine = false 
) [inline, virtual]

draw a location.

Parameters:
loc location with position, angle and radius
showAngleLine if true, a line from the middle point of the location (given by loc.position) with the angle given by loc.angle will be drawn.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const ipointList c,
const ipoint offset = ipoint(0, 0) 
) [inline, virtual]

Sets pixels at all points in c, moved by he given offset.

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( const ipoint p  )  [inline, virtual]

Set pixel at p in the color set by setColor().

Parameters:
p coordinates of the pixel to be set

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::set ( int  x,
int  y 
) [virtual]

Set pixel at x, y in the color set by setColor().

Parameters:
x x-coordinate of the pixel to be set.
y y-coordinate of the pixel to be set.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::setColor ( const char *  color  )  [virtual]

Specifies color to be used.

If the template type is rgbPixel this means an actual color. For other template types, this sets a gray-level. Here, MATLAB style specifiers are used. See setStyle(const char*) for details.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::setColor ( const T &  px  )  [virtual]

Specifies color to be used.

If the template type is rgbPixel this means an actual color. For other template types, this sets a gray-level.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::setGray ( const float  k  )  [virtual]

Specifies gray-level to be used.

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::text ( const std::string  txt,
int  x,
int  y 
) [inline, virtual]

Draw the text string txt at position x, y.

See also:
text(const std::string, int, int, const point&, const float, bool)

Implements cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::text ( const std::string  txt,
int  x,
int  y,
const ipoint scale,
const float  opaqueness,
bool  horizontal 
)

Draw the given text at the position upperleft with a specified scale.

scale.x and scale.y must have values greater than zero. The original size of one character is 8x8. With the parameter opaqueness you can make transparent text. Opaqueness = 1.0f means no transparency. If horizontal is true the text is writen from left to right.

Parameters:
txt the output text
x the x coordinate in the image where the text will be written
y the y coordinate in the image where the text will be written
scale a point with the (integer) scaling factor greater or equal one for each coordinate. Note that you can use different scales for the width and height of the caracters
opaqueness value in percent (between 0.0f and 1.0f)
horizontal true left to rigth, false top to bottom

template<class T>
void cvr::draw< T >::text ( const std::string  txt,
const ipoint upperleft = ipoint(0, 0),
const ipoint scale = ipoint(1, 1),
const float  opaqueness = 1.0f,
bool  horizontal = true 
)

Draw the given text at the position upperleft with a specified scale.

scale.x and scale.y must have values greater than zero. The original size of one character is 8x8. With the parameter opaqueness you can make transparent text. Opaqueness = 1.0f means no transparency. If horizontal is true the text is writen from left to right.

Parameters:
txt the output text
upperleft the coordinates in the image where the text will be written
scale a point with the (integer) scaling factor greater or equal one for each coordinate. Note that you can use different scales for the width and height of the caracters
opaqueness value in percent (between 0.0f and 1.0f)
horizontal true left to rigth, false top to bottom

template<class T>
static ipoint cvr::draw< T >::turnPoint ( const float  x,
const float  y,
float  angle 
) [inline, static, protected]

This is need for drawing filled rotated ellipses.

template<class T>
virtual void cvr::draw< T >::use ( matrix< T > &  img  )  [virtual]

Indicates in which image will be drawn.

template<class T>
void cvr::draw< T >::verticalLine ( const ipoint p1,
const ipoint p2 
) [virtual]

Draws a vertical line from (p1.x, p1.y) to (p1.x, p2.y).

Reimplemented from cvr::drawBase< T >.

template<class T>
void cvr::draw< T >::verticalLine ( int  x,
int  y1,
int  y2 
) [virtual]

Draws a vertical line from (x, y1) to (x, y2).

Implements cvr::drawBase< T >.


Member Data Documentation

template<class T>
T cvr::draw< T >::actColor_ [protected]

Color in use.

template<class T>
matrix<T>* cvr::draw< T >::img_ [protected]

the "actual" image


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

Generated on Sun Sep 20 22:08:41 2009 for CVR-Lib by Doxygen 1.5.8