|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiDraw.h>
Inheritance diagram for lti::draw< T >:


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 |
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.
|
|||||||||
|
default constructor
|
|
|||||||||
|
destructor
|
|
||||||||||||||||||||
|
draw an arc from 'pA' to 'pB', clockwise around center 'p1'.
Implements lti::drawBase< T >. |
|
||||||||||||||||||||
|
draw an arrow from point p1 to point p2
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||||||||||
|
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 >. |
|
||||||||||||||||||||||||||||||||
|
draw a rotated box.
|
|
||||||||||||||||||||||||||||
|
draw a box.
Reimplemented from lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
||||||||||||||||||||||||
|
draw a box
|
|
||||||||||||||||||||
|
draw a box
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||
|
draw a rotated box
|
|
||||||||||||||||
|
draw a box
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||||||
|
draw a circle with circle center (x,y) and radius 'r'
|
|
||||||||||||||||||||
|
draw a circle with circle center 'p1' and radius 'r'
Implements lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
|||||||||
|
fills the canvas with the actual color
|
|
||||||||||||||||||||||||
|
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 |
|
||||||||||||||||||||||||
|
Draws a symbol at the given location. Used by the marker() methods. Implements lti::drawBase< T >. |
|
||||||||||||||||||||||||
|
Draws a symbol at the given location. Used by the marker() methods. |
|
||||||||||||||||
|
Draws a symbol set with the method setStyle() at the given position. Used by the marker() methods. |
|
||||||||||||||||||||||||||||
|
draw an ellipse with center 'p1' and main axes 'aX' and 'aY'
Implements lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
||||||||||||||||||||||||
|
draw an ellipse with center 'p1' and main axes 'aX' and 'aY'
Implements lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
||||||||||||||||||||||||||||
|
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. |
|
||||||||||||||||
|
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. |
|
||||||||||||||||||||
|
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.
|
|
|||||||||
|
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 >. |
|
|||||||||
|
Get color being used.
|
|
|||||||||
|
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 >. |
|
||||||||||||||||
|
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 >. |
|
||||||||||||||||
|
Draws a horizontal line from (p1.x,p1.y) to (p2.x,p1.y).
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||
|
Draws a horizontal line from (x1,y) to (x2,y).
Implements lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
||||||||||||||||
|
Returns "true" if the point is within the image.
|
|
||||||||||
|
Returns "true" if the point is within the image.
|
|
||||||||||||||
|
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.
|
|
||||||||||||||||
|
Draw a line from the point p to point p2.
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||||||
|
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 >. |
|
||||||||||
|
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 >. |
|
||||||||||||||||
|
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 >. |
|
||||||||||||||||||||
|
draw an integer 's' must be given as quota of image height (0.0 to 1.0).
Implements lti::drawBase< T >. |
|
||||||||||||||||||||||||
|
draw an integer 's' must be given as quota of image height (0.0 to 1.0).
|
|
||||||||||||||||||||
|
draw an integer 's' must be given as quota of image height (0.0 to 1.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 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 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 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)
|
|
||||||||||||||||||||||||
|
draw a polygon represented by the given polygonPoints list optionally, it can be rotated by the given angle and shifted
|
|
||||||||||||||||||||||||||||||||
|
draw a rectangle.
|
|
||||||||||||||||||||||||||||
|
draw a rectangle.
Implements lti::drawBase< T >. |
|
||||||||||||||||||||||||
|
draw a rectangle
|
|
||||||||||||||||||||
|
draw a rectangle
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||
|
draw a rotated rectangle
|
|
||||||||||||||||
|
draw a rectangle
Reimplemented from lti::drawBase< T >. |
|
||||||||||
|
scale each pixel value with the given constant
|
|
||||||||||||||||||||
|
draw the contents of the vector using the whole image
|
|
||||||||||||||||||||
|
draw the contents of the vector using the whole image
|
|
||||||||||||||||||||
|
draw the contents of the vector using the whole image
|
|
||||||||||||||||
|
draw a list of locations
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||
|
draw a rectLocation
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||
|
draw a location.
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||
|
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().
Reimplemented from lti::drawBase< T >. |
|
||||||||||
|
Set pixel at p in the color set by setColor().
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||
|
Set pixel at x,y in the color set by setColor().
Implements lti::drawBase< T >. |
|
||||||||||
|
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 >. |
|
||||||||||
|
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 >. |
|
||||||||||
|
Specifies gray-level to be used.
Implements lti::drawBase< T >. |
|
||||||||||||||||||||
|
Draw the text string txt at position x,y.
Implements lti::drawBase< T >. |
|
||||||||||||||||||||||||||||||||
|
Draw the given text at the position
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
|
|
||||||||||||||||||||||||||||
|
Draw the given text at the position
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
|
|
||||||||||||||||||||
|
This is need for drawing filled rotated ellipses.
|
|
||||||||||
|
Indicates in which image will be drawn.
Reimplemented in lti::draw3D< T >, and lti::draw3D< rgbPixel >. |
|
||||||||||||||||
|
Draws a vertical line from (p1.x,p1.y) to (p1.x,p2.y).
Reimplemented from lti::drawBase< T >. |
|
||||||||||||||||||||
|
Draws a vertical line from (x,y1) to (x,y2).
Implements lti::drawBase< T >. Reimplemented in lti::patternDraw< T >. |
|
|||||
|
Color in use.
|
|
|||||
|
the "actual" image
|