latest version v1.9 - last update 10 Apr 2010 |
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>
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 |
T | actColor |
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.
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 >.
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 >.
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().
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] |
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.
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 >.
void lti::draw< T >::box | ( | const point & | upperLeft, | |
const point & | bottomRight, | |||
const float | angle, | |||
const bool & | filled = false | |||
) | [inline] |
draw a box
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. |
void lti::draw< T >::box | ( | const point & | upperLeft, | |
const point & | bottomRight, | |||
const bool & | filled = false | |||
) | [inline, virtual] |
draw a box
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. |
Reimplemented from lti::drawBase< T >.
void lti::draw< T >::box | ( | const trectangle< int > & | r, | |
const float | angle, | |||
const bool & | filled | |||
) | [inline] |
void lti::draw< T >::box | ( | const trectangle< int > & | r, | |
const bool & | filled = false | |||
) | [inline, virtual] |
draw a box
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().
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'
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().
void lti::draw< T >::clear | ( | ) |
fills the canvas with the actual color
bool lti::draw< T >::correctLine | ( | int & | x, | |
int & | y, | |||
const int | x2, | |||
const int | y2 | |||
) | [protected] |
void lti::draw< T >::drawSymbol | ( | const int | x, | |
const int | y, | |||
const int | w, | |||
const char * | style | |||
) | [protected, virtual] |
void lti::draw< T >::drawSymbol | ( | const int | x, | |
const int | y, | |||
const int | w, | |||
const typename drawBase< T >::eMarkerType | t | |||
) | [protected] |
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.
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 >.
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 >.
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.
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.
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().
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.
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().
get a read-only reference to the image currently being used.
get a reference to the image currently being used.
returns the size of the canvas
Implements lti::drawBase< T >.
const T& lti::draw< T >::getColor | ( | ) | const |
Get color being used.
const char* lti::draw< T >::getTypeName | ( | ) | const [virtual] |
get name of this type
Reimplemented from lti::drawBase< T >.
Reimplemented in lti::draw3D< T >, lti::patternDraw< T >, lti::scene3D< T >, lti::draw3D< rgbPixel >, and lti::scene3D< rgbPixel >.
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 >.
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 >.
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 >.
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().
Returns "true" if the point is within the image.
References lti::genericMatrix< T >::columns(), lti::genericMatrix< T >::rows(), lti::tpoint< T >::x, and lti::tpoint< T >::y.
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.
void lti::draw< T >::line | ( | const point & | p1, | |
const point & | p2 | |||
) | [inline, virtual] |
Draw a line from the point p to point p2.
Reimplemented from lti::drawBase< 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().
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 >.
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().
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).
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 >.
void lti::draw< T >::number | ( | const int | num, | |
const int | x, | |||
const int | y, | |||
const float & | s | |||
) |
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).
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().
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()
overlay | channel to be overlayed | |
p | position where overlay will be placed |
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()
overlay | channel8 to be overlayed | |
x | position at x (the column) | |
y | position at y (the row) |
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)
overlay | channel to be overlayed | |
p | position where overlay will be placed |
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)
overlay | channel to be overlayed | |
x | position at x (the column) | |
y | position at y (the row) |
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
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. |
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.
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 >.
void lti::draw< T >::rectangle | ( | const point & | upperLeft, | |
const point & | bottomRight, | |||
const float | angle, | |||
const bool & | filled = false | |||
) | [inline] |
draw a rectangle
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. |
void lti::draw< T >::rectangle | ( | const point & | upperLeft, | |
const point & | bottomRight, | |||
const bool & | filled = false | |||
) | [inline, virtual] |
draw a rectangle
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. |
Reimplemented from lti::drawBase< T >.
void lti::draw< T >::rectangle | ( | const trectangle< int > & | r, | |
const float | angle, | |||
const bool & | filled | |||
) | [inline] |
void lti::draw< T >::rectangle | ( | const trectangle< int > & | r, | |
const bool & | filled = false | |||
) | [inline, virtual] |
draw a rectangle
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().
void lti::draw< T >::scale | ( | const double | factor | ) |
scale each pixel value with the given constant
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
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 |
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
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 |
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
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 |
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 >.
void lti::draw< T >::set | ( | const rectLocation & | loc, | |
const bool | showAngleLine = false | |||
) | [inline, virtual] |
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 >.
void lti::draw< T >::set | ( | const location & | loc, | |
const bool | showAngleLine = false | |||
) | [inline, virtual] |
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 >.
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 >.
Set pixel at p in the color set by setColor().
p | coordinates of the pixel to be set |
Reimplemented from lti::drawBase< T >.
Set pixel at p in the color set by setColor().
p | coordinates of the pixel to be set |
Reimplemented from lti::drawBase< T >.
void lti::draw< T >::set | ( | const int | x, | |
const int | y | |||
) | [virtual] |
Set pixel at x,y in the color set by setColor().
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().
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 >.
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 >.
void lti::draw< T >::setGray | ( | const float | k | ) | [virtual] |
Specifies gray-level to be used.
Implements lti::drawBase< 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.
Implements lti::drawBase< 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.
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 |
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.
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().
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.
Indicates in which image will be drawn.
Reimplemented in lti::draw3D< T >, and lti::draw3D< rgbPixel >.
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 >.
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 >.