LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::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 lti::matrix. More...

#include <ltiDraw.h>

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

List of all members.

Public Member Functions

 draw ()
 ~draw ()
const char * getTypeName () const
Canvas



virtual void use (matrix< T > &img)
virtual matrix< T > & getCanvas ()
virtual const matrix< T > & getCanvas () const
point getCanvasSize ()
Color and Pen-Style Tool selection



void setColor (const T &px)
void setColor (const char *color)
void setGray (const float k)
const T & getColor () const
Whole canvas operators



void scale (const double factor)
void clear ()
void fill (const point &seed)
void fill (const int x, const int y)
void fillUntil (const point &seed, const T &stopColor)
void fillUntil (const int x, const int y, const T &stopColor)
Points and Lines



void set (const int x, const int y)
void set (const point &p)
template<class U >
void set (const hPoint2D< U > &p)
void line (const int fx, const int fy, const int tx, const int ty)
void line (const point &p1, const point &p2)
void line (const tline< int > &l)
template<class U >
void line (const hPoint2D< U > &p)
void lineTo (const int x, const int y)
void lineTo (const point &p)
void verticalLine (const int x, const int y1, const int y2)
void verticalLine (const point &p1, const point &p2)
void horizontalLine (const int x1, const int x2, const int y)
void horizontalLine (const point &p1, const point &p2)
Simple polygons and other geometric primitives



void arrow (const int fx, const int fy, const int tx, const int ty, const float &size=0.2f)
void arrow (const point &p1, const point &p2, const float &size=0.2f)
void box (const trectangle< int > &r, const bool &filled=false)
void box (const trectangle< int > &r, const float angle, const bool &filled)
void box (const point &upperLeft, const point &bottomRight, const bool &filled=false)
void box (const point &upperLeft, const point &bottomRight, const float angle, const bool &filled=false)
void box (const int xl, const int yu, const int xr, const int yb, const bool &filled=false)
void box (const int xl, const int yu, const int xr, const int yb, const float angle, const bool &filled=false)
void rectangle (const trectangle< int > &r, const bool &filled=false)
void rectangle (const trectangle< int > &r, const float angle, const bool &filled)
void rectangle (const point &upperLeft, const point &bottomRight, const bool &filled=false)
void rectangle (const point &upperLeft, const point &bottomRight, const float angle, const bool &filled=false)
void rectangle (const int xl, const int yu, const int xr, const int yb, const bool &filled=false)
void rectangle (const int xl, const int yu, const int xr, const int yb, const float angle, const bool &filled=false)
void polygon (const polygonPoints &poly, const bool filled=false, const float angle=0.0f, const point &shift=point(0, 0))
void circle (const point &p1, const int r, const bool &filled=false)
void circle (const int x, const int y, const int r, const bool &filled=false)
void ellipse (const point &p1, const int aX, const int aY, const bool &filled=false)
void ellipse (const point &p1, const int aX, const int aY, const float &angle, const bool &filled=false)
void arc (const point &p1, const point &pA, const point &pB)
Tools for other lti::objects



void set (const pointList &c, const point &offset=point(0, 0))
void set (const location &loc, const bool showAngleLine=false)
void set (const rectLocation &loc, const bool showAngleLine=false)
void set (const std::list< location > &locs, const bool showAngleLine=false)
void set (const dvector &vct, const T &axisColor, const bool &forceAxis0=true)
void set (const fvector &vct, const T &axisColor, const bool &forceAxis0=true)
void set (const ivector &vct, const T &axisColor, const bool &forceAxis0=true)
void grid (const point &delta, const bool interval=true)
void overlay (const channel &overlay, const int x=0, const int y=0)
void overlay (const channel &overlay, const point &p)
void overlay (const channel8 &overlay, const int x=0, const int y=0)
void overlay (const channel8 &overlay, const point &p)
Simple text drawing tools



void number (const int num, const point &p1=point(0, 0), const float &s=0.03125f)
void number (const int num, const int x, const int y, const float &s)
void number (const int num, const int x, const int y)
void text (const std::string txt, const point &upperleft=point(0, 0), const point &scale=point(1, 1), const float opaqueness=1.0f, const bool horizontal=true)
void text (const std::string txt, const int x, const int y, const point &scale, const float opaqueness, const bool horizontal)
void text (const std::string txt, const int x, const int y)

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

matrix< T > * img
actColor

Detailed Description

template<class T>
class lti::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 lti::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:

 lti::draw<lti::channel::value_type> drawer;  // drawer for channels
 lti::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>
lti::draw< T >::draw (  ) 

default constructor

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

destructor


Member Function Documentation

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

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

Implements lti::drawBase< T >.

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

draw an arrow from point p1 to point p2

Reimplemented from lti::drawBase< T >.

template<class T>
void lti::draw< T >::arrow ( const int  fx,
const int  fy,
const int  tx,
const 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 lti::drawBase< T >.

Referenced by lti::draw< rgbPixel >::arrow().

template<class T>
void lti::draw< T >::box ( const int  xl,
const int  yu,
const int  xr,
const int  yb,
const float  angle,
const bool &  filled = false 
) [inline]

draw a rotated box.

Deprecated:
use rectangle(int, int, int, int, float, const bool&) instead!
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 box
filled if true box is filled
template<class T>
void lti::draw< T >::box ( const int  xl,
const int  yu,
const int  xr,
const int  yb,
const bool &  filled = false 
) [inline, virtual]

draw a box.

Deprecated:
use rectangle(int, int, int, int, const bool&) instead!
Parameters:
xl left x-coordinate.
yu upper y-coordinate.
xr right x-coordinate.
yb bottom y-coordinate.
filled if true box is filled

Reimplemented from lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

template<class T>
void lti::draw< T >::box ( const point upperLeft,
const point bottomRight,
const float  angle,
const bool &  filled = false 
) [inline]

draw a box

Deprecated:
use rectangle(const point&, const point&, float, const bool&) instead!
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 box
filled true if the box must be filled, false if only the border needs to be drawn.
See also:
box(int,int,int,int,const bool&)
template<class T>
void lti::draw< T >::box ( const point upperLeft,
const point bottomRight,
const bool &  filled = false 
) [inline, virtual]

draw a box

Deprecated:
use rectangle(const point&, const point&, const bool&) instead!
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 box must be filled, false if only the border needs to be drawn.
See also:
box(int,int,int,int,const bool&)

Reimplemented from lti::drawBase< T >.

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

draw a rotated box

Deprecated:
use rectangle(const rectangle&, const float, const bool&) instead!
Parameters:
r rectangle (with orientation 0)
angle rotation angle at the middle point of the box
filled true if the box must be filled, false if only the border needs to be drawn.
template<class T>
void lti::draw< T >::box ( const trectangle< int > &  r,
const bool &  filled = false 
) [inline, virtual]

draw a box

Deprecated:
use rectangle(const rectangle&, const bool&) instead!
Parameters:
r rectangle (with orientation 0)
filled true if the box must be filled, false if only the border needs to be drawn.

Reimplemented from lti::drawBase< T >.

Referenced by lti::draw< rgbPixel >::box().

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

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

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

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

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

Referenced by lti::draw< rgbPixel >::circle().

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

fills the canvas with the actual color

template<class T>
bool lti::draw< T >::correctLine ( int &  x,
int &  y,
const int  x2,
const 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 lti::draw< T >::drawSymbol ( const int  x,
const int  y,
const int  w,
const char *  style 
) [protected, virtual]

Draws a symbol at the given location.

Used by the marker() methods.

Implements lti::drawBase< T >.

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

Draws a symbol at the given location.

Used by the marker() methods.

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

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

Used by the marker() methods.

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

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

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

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

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

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

template<class T>
void lti::draw< T >::enterPX ( const point 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 lti::draw< T >::fill ( const int  x,
const 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 lti::draw< T >::fill ( const point 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.

Referenced by lti::draw< rgbPixel >::fill().

template<class T>
void lti::draw< T >::fillUntil ( const int  x,
const 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 lti::draw< T >::fillUntil ( const point seed,
const T &  stopColor 
)

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

Referenced by lti::draw< rgbPixel >::fillUntil().

template<class T>
virtual const matrix<T>& lti::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 lti::exception will be thrown
template<class T>
virtual matrix<T>& lti::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 lti::exception will be thrown
template<class T>
point lti::draw< T >::getCanvasSize (  )  [virtual]

returns the size of the canvas

Implements lti::drawBase< T >.

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

Get color being used.

template<class T>
const char* lti::draw< T >::getTypeName (  )  const [virtual]
template<class T>
void lti::draw< T >::grid ( const point delta,
const 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 lti::drawBase< T >.

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

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

Reimplemented from lti::drawBase< T >.

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

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

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

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

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

References lti::genericMatrix< T >::columns(), and lti::genericMatrix< T >::rows().

template<class T >
bool lti::draw< T >::inCanvas ( const point p  )  const [inline, protected]
template<class T>
template<class U >
void lti::draw< T >::line ( const hPoint2D< U > &  p  )  [inline]

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

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

Draw a line.

See also:
line(int,int,int,int)
template<class T>
void lti::draw< T >::line ( const point p1,
const point p2 
) [inline, virtual]

Draw a line from the point p to point p2.

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

Reimplemented from lti::drawBase< T >.

template<class T>
void lti::draw< T >::line ( const int  fx,
const int  fy,
const int  tx,
const 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.

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.

Referenced by lti::draw< rgbPixel >::line().

template<class T>
void lti::draw< T >::lineTo ( const point 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 lti::drawBase< T >.

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

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 lti::drawBase< T >.

Referenced by lti::draw< rgbPixel >::lineTo().

template<class T>
void lti::draw< T >::number ( const int  num,
const int  x,
const 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 lti::drawBase< T >.

template<class T>
void lti::draw< T >::number ( const int  num,
const int  x,
const 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 lti::draw< T >::number ( const int  num,
const point p1 = point(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

Referenced by lti::draw< rgbPixel >::number().

template<class T>
void lti::draw< T >::overlay ( const channel8 overlay,
const point 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 lti::draw< T >::overlay ( const channel8 overlay,
const int  x = 0,
const 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 lti::draw< T >::overlay ( const channel overlay,
const point 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 lti::draw< T >::overlay ( const channel overlay,
const int  x = 0,
const 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 lti::draw< T >::polygon ( const polygonPoints poly,
const bool  filled = false,
const float  angle = 0.0f,
const point shift = point(0, 0) 
)

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.
template<class T>
void lti::draw< T >::rectangle ( const int  xl,
const int  yu,
const int  xr,
const int  yb,
const float  angle,
const 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 lti::draw< T >::rectangle ( const int  xl,
const int  yu,
const int  xr,
const int  yb,
const 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 lti::drawBase< T >.

template<class T>
void lti::draw< T >::rectangle ( const point upperLeft,
const point bottomRight,
const float  angle,
const 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,const bool&)
template<class T>
void lti::draw< T >::rectangle ( const point upperLeft,
const point bottomRight,
const 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,const bool&)

Reimplemented from lti::drawBase< T >.

template<class T>
void lti::draw< T >::rectangle ( const trectangle< int > &  r,
const float  angle,
const 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 lti::draw< T >::rectangle ( const trectangle< int > &  r,
const 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 lti::drawBase< T >.

Referenced by lti::draw< rgbPixel >::box(), and lti::draw< rgbPixel >::rectangle().

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

scale each pixel value with the given constant

template<class T>
void lti::draw< T >::set ( const ivector vct,
const T &  axisColor,
const 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 lti::draw< T >::set ( const fvector vct,
const T &  axisColor,
const 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 lti::draw< T >::set ( const dvector vct,
const T &  axisColor,
const 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 lti::draw< T >::set ( const std::list< location > &  locs,
const bool  showAngleLine = false 
) [inline, virtual]

draw a list of locations

Reimplemented from lti::drawBase< T >.

template<class T>
void lti::draw< T >::set ( const rectLocation loc,
const 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 lti::drawBase< T >.

template<class T>
void lti::draw< T >::set ( const location loc,
const 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 lti::drawBase< T >.

template<class T>
void lti::draw< T >::set ( const pointList c,
const point offset = point(0,0) 
) [inline, virtual]

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

Reimplemented from lti::drawBase< T >.

template<class T>
template<class U >
void lti::draw< T >::set ( const hPoint2D< U > &  p  )  [inline]

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

Parameters:
p coordinates of the pixel to be set

Reimplemented from lti::drawBase< T >.

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

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

Parameters:
p coordinates of the pixel to be set

Reimplemented from lti::drawBase< T >.

template<class T>
void lti::draw< T >::set ( const int  x,
const 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 lti::drawBase< T >.

Referenced by lti::draw< rgbPixel >::set().

template<class T>
void lti::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 lti::drawBase< T >.

template<class T>
void lti::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 lti::drawBase< T >.

Reimplemented in lti::scene3D< T >, and lti::scene3D< rgbPixel >.

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

Specifies gray-level to be used.

Implements lti::drawBase< T >.

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

Draw the text string txt at position x,y.

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

Implements lti::drawBase< T >.

template<class T>
void lti::draw< T >::text ( const std::string  txt,
const int  x,
const int  y,
const point scale,
const float  opaqueness,
const 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 lti::draw< T >::text ( const std::string  txt,
const point upperleft = point(0, 0),
const point scale = point(1, 1),
const float  opaqueness = 1.0f,
const 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

Referenced by lti::draw< rgbPixel >::text().

template<class T>
static point lti::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 lti::draw< T >::use ( matrix< T > &  img  )  [virtual]

Indicates in which image will be drawn.

Reimplemented in lti::draw3D< T >, and lti::draw3D< rgbPixel >.

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

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

Reimplemented from lti::drawBase< T >.

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

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

Implements lti::drawBase< T >.

Reimplemented in lti::patternDraw< T >.


Member Data Documentation

template<class T>
T lti::draw< T >::actColor [protected]

Color in use.

template<class T>
matrix<T>* lti::draw< T >::img [protected]

the "actual" image


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

Generated on Sat Apr 10 15:27:13 2010 for LTI-Lib by Doxygen 1.6.1