TdkCDCanvas Class Reference

Implementation of the TdkCanvas abstract class for the Canvas Draw tecgraf library. More...

#include <TdkCDCanvas.h>

Inheritance diagram for TdkCDCanvas:

TdkCanvas List of all members.

Public Types

enum  Drivers {
  drvIUP, drvNativeWindow, drvClipboard, drvPrinter,
  drvImage, drvImageRGB, drvCGM, drvDGN,
  drvDXF, drvEMF, drvMetafile, drvPS,
  drvWMF
}
enum  TdkCDClipType { TdkCDClipNone, TdkCDClipArea, TdkCDClipPolygon, TdkCDClipRegion }

Public Member Functions

virtual void setWindow (const double &llx, const double &lly, const double &urx, const double &ury)
 Adjusts world (or window) coordinates area (supposing a cartesian reference system).
virtual void setWindow (const TeBox &box)
 Adjusts world (window) coordinates area (supposing a cartesian reference system).
virtual void getWindow (double &llx, double &lly, double &urx, double &ury)
 Returns the world (window) coordinates area (supposing a cartesian reference system).
virtual void getWindow (TeBox &window)
virtual void setViewport (const double &llx, const double &lly, const double &urx, const double &ury)
 Adjusts device coordinates area (supposing a cartesian reference system).
virtual void setViewport (const TeBox &box)
 Adjusts device coordinates area (supposing a cartesian reference system).
virtual void getViewport (double &llx, double &lly, double &urx, double &ury)
 Returns the device coordinates area.
virtual void getViewport (TeBox &viewport)
virtual void viewport2Window (const double &vx, const double &vy, double &wx, double &wy)
 TODO: These methods should be fixed for performance improvement.
virtual void viewport2Window (const double &v, double &w, const bool &xdirection=true)
 Transform device (or viewpoort) value to world (or window) value according to one axis.
virtual void setBackgroundColor (const TeColor &c)
 Sets the background color of the canvas to c. This will affect all buffers in use, painting all them with the specified color.
virtual TdkCanvascopy ()
 TdkCDCanvas (Drivers drv, void *data, bool double_buffer=false, bool with_cache=false)
 TdkCDCanvas (cdCanvas *cv, cdCanvas *back_buffer=NULL, cdCanvas *cache=NULL)
 TdkCDCanvas (void *data, bool double_buffer=true, bool with_cache=false)
 TdkCDCanvas (TdkImageRGB &rgb, const TeBox &world, TeProjection &projection, const TeColor &back_color)
 ~TdkCDCanvas ()
 TdkCDCanvas destructor.
virtual void setRotation (double angle, double cx, double cy)
 set the background color of the canvas
virtual TdkCanvas::TdkPaintMode getPaintMode ()
virtual void setVisual (TdkVisual *v, const TeGeomRep &rep)
 Sets the visual for a given geometry type.
virtual void setPointColor (const int &r, const int &g, const int &b)
 Sets the pen color used to draw point geometries.
virtual void setPointColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the pen color used to draw point geometries.
virtual void setPointColor (const TeColor &color, const int &alpha)
virtual void setPointAlpha (const int &alpha)
 Sets the alpha channel used to draw point geometries.
virtual void setPointType (const int &type)
 Sets the style for draw point geometries.
virtual void setPointSize (const int &size)
 Sets pen size (in pixels) used to draw point geometries.
virtual void setPointChar (const char &c)
virtual void setLineColor (const int &r, const int &g, const int &b)
 Sets the pen color used to draw line geometries.
virtual void setLineColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the pen color used to draw line geometries.
virtual void setLineColor (const TeColor &color, const int &alpha)
virtual void setLineAlpha (const int &alpha)
 Sets the alpha channel used to draw line geometries.
virtual void setLineType (const int &type)
 Sets the style for draw line geometries.
virtual void setLineStyleDashes (double *dashArray, const int &size)
 Sets an array of custom dashes and spaces for this Pen object.
virtual void setLineWidth (const int &width)
 Sets pen width (in pixels) used to draw line geometries .
virtual void setPolygonColor (const int &r, const int &g, const int &b)
 Sets the color used to fill the draw of polygon geometries.
virtual void setPolygonColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the color used to fill the draw of polygon geometries.
virtual void setPolygonColor (const TeColor &color, const int &alpha)
virtual void setPolygonAlpha (const int &alpha)
 Sets the alpha channel used to fill the draw of polygon geometries.
virtual void setPolygonType (const int &type)
 TODO: This is not right. Only CD constants should be passed to CD.
virtual void setPolygonTypeStipple (const int &width, const int &height, unsigned char *fgbg, const int &br, const int &bg, const int &bb)
 Fills the polygon with foreground color or a background color (r, g, b) having a mask matrix fgbg (of '0's and '1's).
virtual void setPolygonTypePattern (const int &width, const int &height, unsigned char *r, unsigned char *g, unsigned char *b)
 Sets the pattern style used to fill the draw of polygon geometries.
virtual void setPolygonBorderColor (const int &r, const int &g, const int &b)
 Sets the pen color used to draw the boundary of polygon geometries.
virtual void setPolygonBorderColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the pen color used to draw the boundary of polygon geometries.
virtual void setPolygonBorderColor (const TeColor &color, const int &alpha)
virtual void setPolygonBorderAlpha (const int &alpha)
 Sets the alpha channel used to draw the boundary of polygon geometries.
virtual void setPolygonBorderType (const int &type)
 Sets the style used to draw the boundary of polygon geometries.
virtual void setPolygonBorderWidth (const int &width)
 Sets pen width (in pixels) used to draw the boundary of polygon geometries .
virtual void setTextColor (const int &r, const int &g, const int &b)
 Sets the color of the text.
virtual void setTextColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the color of the text.
virtual void setTextColor (const TeColor &color, const int &alpha)
virtual void setTextBackgroundColor (const int &r, const int &g, const int &b)
 Sets the background color of the text.
virtual void setTextBackgroundColor (const int &r, const int &g, const int &b, const int &alpha)
 Sets the background color of the text.
virtual void setTextBackgroundColor (const TeColor &color, const int &alpha)
virtual void setTextBackgroundAlpha (const int &alpha)
 Sets the alpha channel used to fill the background of texts.
virtual void setTextBackgroundType (const int &type)
virtual void setTextBorderColor (const int &r, const int &g, const int &b)
virtual void setTextBorderColor (const int &r, const int &g, const int &b, const int &alpha)
virtual void setTextBorderColor (const TeColor &color, const int &alpha)
virtual void setTextBorderAlpha (const int &alpha)
virtual void setTextBorderType (const int &type)
virtual void setTextBorderWidth (const int &width)
virtual void setTextAlpha (const int &alpha)
 Sets the alpha channel used to draw texts.
virtual void setTextFont (const string &font_name)
 Sets the font family of the text.
virtual void setTextSize (const int &size)
 Sets the size of the text.
virtual void setTextBold (const bool &bold=true)
 Sets the bold style for text.
virtual void setTextItalic (const bool &italic=true)
 Sets the italic style for text.
virtual void setTextAngle (const double &angle)
 Adjusts the angle used to draw texts.
virtual void setTextAlign (const double &alignmentHoriz, const double &alignmentVert)
 Sets the alignment of the text.
virtual void getTextAlign (double &alignmentHoriz, double &alignmentVert)
virtual void addBuffer (const int &bufferId)
 Adds a new buffer identified by bufferId. If you try to create another one identified by the same id, it will raise an exception.
virtual void removeBuffer (const int &bufferId)
 Removes the buffer identified by bufferId. If you specify an invalid id, it will be raised an exception.
virtual void writeBuffer (const int &sourceBuff, const int &destinationBuff, const bool &transparent=false, const int &r=0, const int &g=0, const int &b=0, const int &a=0)
 Copies the content of source buffer to a destination buffer (its a pixel a pixel copy). When transparent is set to true, the pixels specified by (r, g, b, a) color will not be copied to the destination buffer.
virtual void drawPointW (const TeCoord2D &coord)
 Draws a point specified in window (world) coordinates.
virtual void drawPointW (const double &x, const double &y)
 Draws a point specified in window (world) coordinates.
virtual void drawPoint (const TeCoord2D &coord)
 Draws a point specified in device coordinates.
virtual void drawPoint (const double &x, const double &y)
 Draws a point specified in device coordinates.
virtual void drawLine (TdkPrimitiveCoord *line, const int &lineSize)
 Draws a line with vertexes specified in device coordinates.
virtual void drawLine (const TeLine2D &line, const bool &showPoint=false)
 Draws a line with vertexes specified in device coordinates.
virtual void drawPolygon (TdkPrimitiveCoord *poly, int *ringSize, const int &nRings)
 Draws a polygon with vertexes specified in device coordinates.
virtual void drawPolygon (const TePolygon &poly, const bool &showPoint=false)
 Draws a polygon with vertexes specified in device coordinates.
virtual void drawCell (const TeCell &cell, const bool &showPoint=false)
 Draws a cell with vertexes specified in device coordinates.
virtual void drawText (const double &x, const double &y, const string &text)
 Draws the text with baseline at (x, y), specified in device coordinates.
virtual void drawRaster (TeRaster *raster, TeRasterTransform *transf, const double &angle=0.0, TdkMathMatrix *matrix=NULL)
 Draws the raster.
virtual void drawImageRGB (const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH)
 Draws at (dstX, dstY) the pixels of a RGB image.
virtual void drawImageRGB (const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a RGB image.
virtual void drawImageRGB (const double &angle, const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a RGB image.
virtual void drawImageRGBA (const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH)
 Draws at (dstX, dstY) the pixels of a RGB-Alpha image.
virtual void drawImageRGBA (const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a RGB-Alpha image.
virtual void drawImageRGBA (const double &angle, const unsigned int &imgW, const unsigned int &imgH, unsigned char *red, unsigned char *green, unsigned char *blue, unsigned char *alpha, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a RGB-Alpha image.
virtual void drawImageMap (const unsigned int &imgW, const unsigned int &imgH, unsigned char *index, long int *colors, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH)
 Draws at (dstX, dstY) the pixels of a palette image.
virtual void drawImageMap (const unsigned int &imgW, const unsigned int &imgH, unsigned char *index, long int *colors, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a palette image.
virtual void drawImageMap (const double &angle, const unsigned int &imgW, const unsigned int &imgH, unsigned char *index, long int *colors, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a palette image.
virtual void drawImageGray (const unsigned int &imgW, const unsigned int &imgH, unsigned char *data, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH)
 Draws at (dstX, dstY) the pixels of a gray image.
virtual void drawImageGray (const unsigned int &imgW, const unsigned int &imgH, unsigned char *data, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a gray image.
virtual void drawImageGray (const double &angle, const unsigned int &imgW, const unsigned int &imgH, unsigned char *data, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const double &srcX, const double &srcY, const unsigned int &srcW=0, const unsigned int &srcH=0)
 Draws at (dstX, dstY) the pixels of a gray image.
virtual void drawLineSegment (const TeCoord2D &c1, const TeCoord2D &c2)
virtual void drawLineSegment (const double &x0, const double &y0, const double &x1, const double &y1)
 Draws a line segment from (x0, y0) to (x1, y1), specified in device coordinates.
virtual void drawRect (const double &llx, const double &lly, const double &urx, const double &ury)
 Draws a rectangle with lower left corner at (llx, lly) and uper right corner at (urx, ury), specified in device coordinates.
virtual void fillRect (const double &llx, const double &lly, const double &urx, const double &ury)
 Fills the rectangle with lower left corner at (llx, lly) and uper right corner at (urx, ury), specified in device coordinates.
virtual void drawEllipse (const double &xc, const double &yc, const double &rx1, const double &ry1, const double &rx2, const double &ry2)
 Draws an ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.
virtual void drawEllipse (const double &xc, const double &yc, const double &rx, const double &ry, const double &angle)
 Draws an ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.
virtual void fillEllipse (const double &xc, const double &yc, const double &rx1, const double &ry1, const double &rx2, const double &ry2)
 Fills the ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.
virtual void fillEllipse (const double &xc, const double &yc, const double &rx, const double &ry, const double &angle)
 Fills the ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.
virtual void drawArc (const double &xc, const double &yc, const double &w, const double &h, const double &startAngle, const double &finalAngle)
 Draws an arc defined by a center at (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startAngle) and the final angle (finalAngle).
virtual void drawSector (const double &xc, const double &yc, const double &w, const double &h, const double &startAngle, const double &finalAngle)
 Draws a sector defined by a center coordinate (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startANgle) and the final angle (finalAngle).
virtual void fillSector (const double &xc, const double &yc, const double &w, const double &h, const double &startAngle, const double &finalAngle)
 Fills the sector defined by a center coordinate (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startANgle) and the final angle (finalAngle).
virtual char * getImage (const double &x, const double &y, const int &w, const int &h, TdkImageType imageType, int &size, const int &quality=75)
 Returns an image from the current canvas buffer content in a specified format (PNG, JPEG, GIF or other).
virtual void getImageGray (const double &x, const double &y, const int &w, const int &h, unsigned char *data)
 Returns a Gray Image from the current canvas buffer content.
virtual void getImageMap (const double &x, const double &y, const int &w, const int &h, unsigned char *index, long int *colors)
 Returns a Palette Image from the current canvas buffer content.
virtual void getImageRGBA (const double &x, const double &y, const int &w, const int &h, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a)
 Returns an RGB-Alpha array from the current canvas buffer content.
virtual void getImageRGB (const double &x, const double &y, const int &w, const int &h, unsigned char *r, unsigned char *g, unsigned char *b)
 Returns an RGB array from the current canvas buffer content.
virtual void drawImage (char *image, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH, const double &dstX, const double &dstY, const TdkImageType &imageType)
 Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).
virtual void drawImage (char *image, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const TdkImageType &imageType)
 Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).
virtual void drawImage (const double &angle, char *image, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH, const double &dstX, const double &dstY, const unsigned int &dstW, const unsigned int &dstH, const TdkImageType &imageType)
 Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).
virtual int setActiveBuffer (const int &bufferId)
 Sets the current buffer used to draw. This method changes the current buffer used to draw, you should specify a valid identifier, otherwise it will be raised an exception.
virtual int getActiveBuffer ()
virtual void repaint ()
 Do a repaint on canvas.
virtual int setPaintMode (const int &mode)
 Adjusts canvas drawing mode: ....
virtual void clear ()
virtual void clearRect (double xmin, double ymin, double xmax, double ymax)
virtual void setCountStep (unsigned int step)
virtual unsigned int getCountStep () const
virtual void flush ()
virtual void invertViewportY (int &y) const
virtual cdCanvas * getCanvas () const
virtual TeRasterParams & getParams ()
virtual bool isGDIPlusContext () const
coordinates transformation
virtual TeProjection * setViewProjection (TeProjection *proj)
virtual void setOrigin (double x, double y)
virtual void translateArea (double xmin, double xmax, double ymin, double ymax, double dx, double dy)
virtual void getTextBoundsW (const string &text, const double &x, const double &y, const double &angle, TdkTextBounds &bounds)
 Returns the bounding box of a text in world coordinates.
virtual void getTextBounds (const string &text, const double &x, const double &y, const double &angle, TdkTextBounds &bounds)
 Returns the bounding box of a text in device coordinates.
virtual void getTextBoundsW (const TeText &text, TdkTextBounds &bounds)
virtual void getTextBounds (const TeText &text, TdkTextBounds &bounds)
virtual void setClipArea (const TeBox &box)
 Establishes a clipping rectangle. Once setClipArea has been called, all future drawing operations will remain within the specified clipping area, until a new setClipArea call takes place. For instance, if a clipping rectangle of 25, 25, 75, 75 has been set within a 100x100 device area, a diagonal line from 0,0 to 99,99 will appear only between 25,25 and 75,75.
virtual void setClipArea (const double &llx, const double &lly, const double &urx, const double &ury)
 Establishes a clipping rectangle. Once setClipArea has been called, all future drawing operations will remain within the specified clipping area, until a new setClipArea call takes place. For instance, if a clipping rectangle of 25, 25, 75, 75 has been set within a 100x100 device area, a diagonal line from 0,0 to 99,99 will appear only between 25,25 and 75,75.
virtual void getClipArea (double &llx, double &lly, double &urx, double &ury)
 Returns the clipping area.
virtual void setClipArea (const TePolygon &poly)
 Establishes a clipping polygon. Once setClipArea has been called, all future drawing operations will remain within the specified polygon clipping area, until a new setClipArea call takes place.
virtual void setClipArea (const TePolygonSet &polys, const TdkClipAreaType &clipType)
virtual void getClipArea (TePolygon &poly)
 Returns the clipping polygon.
virtual void activateClip ()
 Activate clipping mode.
virtual void deactivateClip ()
 Deactivate clipping mode.
virtual void mm2Pixel (const double &mmDx, const double &mmDy, double &pDx, double &pDy)
virtual void pixel2MM (const double &pDx, const double &pDy, double &mmDx, double &mmDy)
virtual void maximizeViewport ()
device information
virtual int getWidth () const
virtual int getHeight () const
virtual void getDimension (double &w, double &h)
virtual void getDimensionMM (double &w, double &h)
virtual void reDim (double w, double h)

Static Public Member Functions

static void activateAntiAlias (bool blActivate)
static bool isAntiAliasActivated (void)
static bool useGDIPlus ()

Static Public Attributes

static const int TDK_DEFAULT_COUNT_STEP = 10000

Protected Member Functions

virtual int getCDClipAreaType (const TdkClipAreaType &clipType)
virtual int getCDTextAlignment (const double &talH, const double &talV)
virtual void setCDTextVisual (const std::string &font, const bool &bold, const bool &italic, const int &size)
virtual bool isCanvasGDIPlus (cdCanvas *cd) const
virtual void calculateDrawImageParams (const double &dstX0, const double &dstY0, const double &dstX1, const double &dstY1, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH, int &dst_w, int &dst_h, int &src_x2, int &src_y2)
virtual void drawTdkImageRGB (TdkImageRGB &image, const double &dstX0, const double &dstY0, const double &dstX1, const double &dstY1, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH)
virtual void drawTdkImageRGBA (TdkImageRGBA &image, const double &dstX0, const double &dstY0, const double &dstX1, const double &dstY1, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH)
virtual void drawTdkImageMap (TdkImageMap &image, const double &dstX0, const double &dstY0, const double &dstX1, const double &dstY1, const double &srcX, const double &srcY, const unsigned int &srcW, const unsigned int &srcH)
virtual bool buildRaster ()
virtual void fillDecoder (TeRaster *raster, TeRasterTransform *transf, TeBox &paintedArea, const double &angle=0., TdkMathMatrix *matrix=NULL)
void processBlocks (TeRaster *raster, const TeRasterParams &parBlock, TeRasterRemap &remap, TeBox &bboxIntersection, TeBox &paintedArea, const int &res, const double &angle=0., TdkMathMatrix *matrix=NULL)
void drawPaintedAreaImage (TdkImageRGB *image, TeBox &paintedArea, const double &angle=0., TdkMathMatrix *matrix=NULL)

Static Protected Member Functions

static bool needToFlipImage ()

Protected Attributes

TeRasterParams params_
TeRaster * backRaster_
bool usingDoubleBuffer_
bool usingCacheBuffer_
cdContext * xor_ctx_
void * xor_data_
cdCanvas * frontCv_
 handle to CD front canvas.
cdCanvas * backCv_
 handle to CD back canvas.
cdCanvas * xorCv_
 handle to the canvas uses to write XOR if GDI+ is used.
cdCanvas * activeCv_
 handle to CD active canvas.
cdCanvas * cacheCv_
 handle to CD active canvas.
TdkCDClipType clipType_
const bool killCdCv_
long int backColor_
long int pointColor_
 current point color.
long int lineColor_
 current line color.
long int polyColor_
 current polygon fill color.
long int polyBorderColor_
 current polygon fill color.
long int txtColor_
 current text color.
long int txtBackgroundColor_
long int txtBorderColor_
int dashSize_
int * dashArray_
bool isPtCharType_
char ptChar_
int ptType_
int ptSize_
int lineType_
int lineWidth_
int polyType_
int polyBorderType_
int polyBorderWidth_
bool usePolyBackgroundColor_
string txtFont_
int txtSize_
bool txtBold_
bool txtItalic_
double txtAlignV_
double txtAlignH_
double txtAngle_
int txtBorderType_
int txtBorderWidth_
int txtBackgroundType_
unsigned int count_
unsigned int countStep_

Private Member Functions

 TdkCDCanvas (const TdkCDCanvas &)
 a copy of the object cannot be taken
virtual cdContext * getCDContext (TdkCDCanvas::Drivers drv)
virtual void createCanvas (TdkCDCanvas::Drivers drv, void *data, bool double_buffer=false, bool with_cache=false)
virtual bool createDoubleBuffer ()
virtual bool createCache ()
virtual void createXorCanvas (cdContext *ctx, void *data)
virtual void createXorCanvas ()
virtual void setDefaultValues ()
 Sets all the class variables to the default values.
virtual void setCDDefaultValues (cdCanvas *cv)
virtual void drawVertex (const TeCoord2D &vtx)
virtual void drawVertexW (const TeCoord2D &vtx)
virtual void setWorldRasterParams ()
virtual void incrementCount (unsigned int inc=1)
virtual void imgRectWindow2Viewport (double wx0, double wy0, double wx1, double wy1, double &vx0, double &vy0, double &vw, double &vh)

Static Private Member Functions

static void initializeGdiPlus ()

Static Private Attributes

static const char * CD_ATTR_NAME_ANTIALIAS = "ANTIALIAS"

Detailed Description

Implementation of the TdkCanvas abstract class for the Canvas Draw tecgraf library.

See also:
http://www.tecgraf.puc-rio.br/cd


Member Enumeration Documentation

enum TdkCDCanvas::Drivers

Enumerator:
drvIUP 
drvNativeWindow 
drvClipboard 
drvPrinter 
drvImage 
drvImageRGB 
drvCGM 
drvDGN 
drvDXF 
drvEMF 
drvMetafile 
drvPS 
drvWMF 

enum TdkCDCanvas::TdkCDClipType

Enumerator:
TdkCDClipNone 
TdkCDClipArea 
TdkCDClipPolygon 
TdkCDClipRegion 


Constructor & Destructor Documentation

TdkCDCanvas::TdkCDCanvas ( Drivers  drv,
void *  data,
bool  double_buffer = false,
bool  with_cache = false 
)

TdkCDCanvas::TdkCDCanvas ( cdCanvas *  cv,
cdCanvas *  back_buffer = NULL,
cdCanvas *  cache = NULL 
)

TdkCDCanvas::TdkCDCanvas ( void *  data,
bool  double_buffer = true,
bool  with_cache = false 
)

TdkCDCanvas::TdkCDCanvas ( TdkImageRGB rgb,
const TeBox &  world,
TeProjection &  projection,
const TeColor &  back_color 
)

Parameters:
rgb  The image representation.
world  The world area (in world coordinates).
projection  The world coordinates projection.
back_color  The back color.

TdkCDCanvas::~TdkCDCanvas (  ) 

TdkCDCanvas destructor.

TdkCDCanvas::TdkCDCanvas ( const TdkCDCanvas  )  [private]

a copy of the object cannot be taken


Member Function Documentation

void TdkCDCanvas::activateAntiAlias ( bool  blActivate  )  [static]

bool TdkCDCanvas::isAntiAliasActivated ( void   )  [static]

void TdkCDCanvas::setWindow ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
) [virtual]

Adjusts world (or window) coordinates area (supposing a cartesian reference system).

Parameters:
llx Lower left abscissa. (Input)
lly Lower left ordinate. (Input)
urx Upper left abscissa. (Input)
ury Upper left ordinate. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::setWindow ( const TeBox &  box  )  [virtual]

Adjusts world (window) coordinates area (supposing a cartesian reference system).

Parameters:
box Bounding box of world. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::getWindow ( double &  llx,
double &  lly,
double &  urx,
double &  ury 
) [virtual]

Returns the world (window) coordinates area (supposing a cartesian reference system).

Parameters:
llx Lower left abscissa. (Output)
lly Lower left ordinate. (Output)
urx Upper left abscissa. (Output)
ury Upper left ordinate. (Output)

Reimplemented from TdkCanvas.

void TdkCDCanvas::getWindow ( TeBox &  window  )  [virtual]

Reimplemented from TdkCanvas.

void TdkCDCanvas::setViewport ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
) [virtual]

Adjusts device coordinates area (supposing a cartesian reference system).

Parameters:
llx Lower left abscissa. (Input)
lly Lower left ordinate. (Input)
urx Upper left abscissa. (Input)
ury Upper left ordinate. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::setViewport ( const TeBox &  box  )  [virtual]

Adjusts device coordinates area (supposing a cartesian reference system).

Parameters:
box Device bounding box. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::getViewport ( double &  llx,
double &  lly,
double &  urx,
double &  ury 
) [virtual]

Returns the device coordinates area.

Parameters:
llx Lower left abscissa. (Output)
lly Lower left ordinate. (Output)
urx Upper left abscissa. (Output)
ury Upper left ordinate. (Output)

Reimplemented from TdkCanvas.

void TdkCDCanvas::getViewport ( TeBox &  viewport  )  [virtual]

Reimplemented from TdkCanvas.

void TdkCDCanvas::viewport2Window ( const double &  vx,
const double &  vy,
double &  wx,
double &  wy 
) [virtual]

TODO: These methods should be fixed for performance improvement.

Reimplemented from TdkCanvas.

void TdkCDCanvas::viewport2Window ( const double &  v,
double &  w,
const bool &  xdirection = true 
) [virtual]

Transform device (or viewpoort) value to world (or window) value according to one axis.

Parameters:
v Viewport (or device) value. (Input)
w World (or window) value. (Output)
xdirection If world and device don't keep aspect ratio you should specify what axis to consider.

Reimplemented from TdkCanvas.

void TdkCDCanvas::setBackgroundColor ( const TeColor &  c  )  [virtual]

Sets the background color of the canvas to c. This will affect all buffers in use, painting all them with the specified color.

Parameters:
c Background color that must be applied to canvas. (Input)

Reimplemented from TdkCanvas.

TdkCanvas * TdkCDCanvas::copy (  )  [virtual]

void TdkCDCanvas::setRotation ( double  angle,
double  cx,
double  cy 
) [virtual]

set the background color of the canvas

TdkCanvas::TdkPaintMode TdkCDCanvas::getPaintMode (  )  [virtual]

void TdkCDCanvas::setVisual ( TdkVisual v,
const TeGeomRep &  rep 
) [virtual]

Sets the visual for a given geometry type.

Parameters:
v Visual that must be applied to a given geometry type. (Input)
rep Geometry type that the visual will be applied (may be: TePOLYGON for polygon geometry, TeLINES for line geometry, TePOINTS for point geometry, TeTEXT = 128 for text geometry, TeCELLS for cell geometry). (Input)
Note:
The parameter transparency_ in visual must be an integer value between 0 and 100, it must be converted to 0-255 internally in each implementation.

Implements TdkCanvas.

void TdkCDCanvas::setPointColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the pen color used to draw point geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPointColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the pen color used to draw point geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPointColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setPointAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to draw point geometries.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPointType ( const int &  type  )  [virtual]

Sets the style for draw point geometries.

Parameters:
style Point style that will be used to draw points. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPointSize ( const int &  s  )  [virtual]

Sets pen size (in pixels) used to draw point geometries.

Parameters:
s Pen size (in pixels). (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::setPointChar ( const char &  c  )  [inline, virtual]

Implements TdkCanvas.

void TdkCDCanvas::setLineColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the pen color used to draw line geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setLineColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the pen color used to draw line geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setLineColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setLineAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to draw line geometries.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setLineType ( const int &  type  )  [virtual]

Sets the style for draw line geometries.

Parameters:
style Line style that will be used to draw lines. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setLineStyleDashes ( double *  dashArray,
const int &  size 
) [virtual]

Sets an array of custom dashes and spaces for this Pen object.

Parameters:
dashArray Pointer to an array of real numbers that specifies the length of the custom dashes and spaces. All elements in the array must be positive.
size Integer that specifies the number of elements in the dashArray array. The integer must be greater than 0 and not greater than the total number of elements in the array

Implements TdkCanvas.

void TdkCDCanvas::setLineWidth ( const int &  width  )  [virtual]

Sets pen width (in pixels) used to draw line geometries .

Parameters:
width Pen size (in pixels). (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the color used to fill the draw of polygon geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the color used to fill the draw of polygon geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setPolygonAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to fill the draw of polygon geometries.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonType ( const int &  type  )  [virtual]

TODO: This is not right. Only CD constants should be passed to CD.

Implements TdkCanvas.

void TdkCDCanvas::setPolygonTypeStipple ( const int &  width,
const int &  height,
unsigned char *  fgbg,
const int &  br,
const int &  bg,
const int &  bb 
) [virtual]

Fills the polygon with foreground color or a background color (r, g, b) having a mask matrix fgbg (of '0's and '1's).

Parameters:
width Number o columns. (Input)
height Number o lines. (Input)
fgbg Mask matrix, when '0' we must use the background color (r,g,b) and when the value is '1' we must use the foreground color set in setPolygonColor. (Input)
br Red background color. (Input)
bg Green background color. (Input)
bb Blue background color. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonTypePattern ( const int &  width,
const int &  height,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b 
) [virtual]

Sets the pattern style used to fill the draw of polygon geometries.

Parameters:
width The width of the pattern (number of columns of RGB array). (Input)
height The height of the pattern (number of lines of RGB array). (Input)
r Pointer to red pixel component array. (Input)
g Pointer to green pixel component array. (Input)
b Pointer to blue pixel component array. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the pen color used to draw the boundary of polygon geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the pen color used to draw the boundary of polygon geometries.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to draw the boundary of polygon geometries.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderType ( const int &  type  )  [virtual]

Sets the style used to draw the boundary of polygon geometries.

Parameters:
style Line style used to draw a polygon boundary. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setPolygonBorderWidth ( const int &  width  )  [virtual]

Sets pen width (in pixels) used to draw the boundary of polygon geometries .

Parameters:
width Pen size (in pixels). (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the color of the text.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the color of the text.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBackgroundColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Sets the background color of the text.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextBackgroundColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Sets the background color of the text.

Parameters:
r Red component color value. (Input)
g Green component color value. (Input)
b Blue component color value. (Input)
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextBackgroundColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBackgroundAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to fill the background of texts.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextBackgroundType ( const int &  type  )  [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderColor ( const int &  r,
const int &  g,
const int &  b 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderColor ( const int &  r,
const int &  g,
const int &  b,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderColor ( const TeColor &  color,
const int &  alpha 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderAlpha ( const int &  alpha  )  [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderType ( const int &  type  )  [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextBorderWidth ( const int &  width  )  [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setTextAlpha ( const int &  alpha  )  [virtual]

Sets the alpha channel used to draw texts.

Parameters:
alpha Must be a value between 0 and 255, where 0 is opaque and 255 is completely transparent. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextFont ( const string &  fontName  )  [virtual]

Sets the font family of the text.

Parameters:
fontName Font name. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextSize ( const int &  size  )  [virtual]

Sets the size of the text.

Parameters:
size Font size. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextBold ( const bool &  bold = true  )  [virtual]

Sets the bold style for text.

Parameters:
bold If true, the text will be draw in bold face otherwise not. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextItalic ( const bool &  italic = true  )  [virtual]

Sets the italic style for text.

Parameters:
italic If true, the text will be draw in italic otherwise not. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextAngle ( const double &  angle  )  [virtual]

Adjusts the angle used to draw texts.

Parameters:
angle Angle in decimal degrees. (Input)

Implements TdkCanvas.

void TdkCDCanvas::setTextAlign ( const double &  alignmentHoriz,
const double &  alignmentVert 
) [virtual]

Sets the alignment of the text.

Parameters:
alignmentVert Vertical alignment. (Input)
alignmentHoriz Horizontal alignment. (Input)

Implements TdkCanvas.

void TdkCDCanvas::getTextAlign ( double &  alignmentHoriz,
double &  alignmentVert 
) [virtual]

Implements TdkCanvas.

virtual void TdkCDCanvas::addBuffer ( const int &  bufferId  )  [inline, virtual]

Adds a new buffer identified by bufferId. If you try to create another one identified by the same id, it will raise an exception.

Parameters:
bufferId The buffer identification associated to the new buffer. Must be a value greater than -1. (Input)
Note:
bufferId must be greater than -1.

Implements TdkCanvas.

virtual void TdkCDCanvas::removeBuffer ( const int &  bufferId  )  [inline, virtual]

Removes the buffer identified by bufferId. If you specify an invalid id, it will be raised an exception.

Parameters:
bufferId The identification of the buffer to be removed. (Input)
Note:
If the buffer is the current one, you should specify a new active (current) buffer, otherwise, you can get an undefined result.

Implements TdkCanvas.

virtual void TdkCDCanvas::writeBuffer ( const int &  sourceBuff,
const int &  destinationBuff,
const bool &  transparent = false,
const int &  r = 0,
const int &  g = 0,
const int &  b = 0,
const int &  a = 0 
) [inline, virtual]

Copies the content of source buffer to a destination buffer (its a pixel a pixel copy). When transparent is set to true, the pixels specified by (r, g, b, a) color will not be copied to the destination buffer.

Parameters:
sourceBuff Source buffer, from wich the pixels will be copied to a destination buffer. (Input)
destinationBuff Destination buffer, to wich the pixels will be copied. (Input)
transparent Indicates if we will have a transparent color during copy, i. e., the pixels with the specified color that will not be copied from the source buffer to the destination. (Input)
r Red component color. (Input)
g Green component color. (Input)
b Blue component color. (Input)
a Alpha component. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawPointW ( const TeCoord2D &  coord  )  [virtual]

Draws a point specified in window (world) coordinates.

Parameters:
coord TerraLib coordinate instance. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::drawPointW ( const double &  x,
const double &  y 
) [virtual]

Draws a point specified in window (world) coordinates.

Parameters:
x Abscissa: horizontal coordinate (x). (Input)
y Ordinate: vertical coordinate (y). (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::drawPoint ( const TeCoord2D &  coord  )  [virtual]

Draws a point specified in device coordinates.

Parameters:
coord TerraLib coordinate instance. (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::drawPoint ( const double &  x,
const double &  y 
) [virtual]

Draws a point specified in device coordinates.

Parameters:
x Abscissa: horizontal coordinate (x). (Input)
y Ordinate: vertical coordinate (y). (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawLine ( TdkPrimitiveCoord line,
const int &  lineSize 
) [inline, virtual]

Draws a line with vertexes specified in device coordinates.

Parameters:
line A pointer to line vertexes. (Input)
lineSize Number of line vertexes. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawLine ( const TeLine2D &  line,
const bool &  showPoint = false 
) [virtual]

Draws a line with vertexes specified in device coordinates.

Parameters:
line TerraLib line instance. (Input)
showPoint If true the line vertexes will be drawn. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawPolygon ( TdkPrimitiveCoord poly,
int *  ringSize,
const int &  nRings 
) [inline, virtual]

Draws a polygon with vertexes specified in device coordinates.

Parameters:
poly A pointer to polygon vertexes. (Input)
ringSize A pointer to an array with each polygon ring size. (Input)
nRings The number of rings in the specified polygon. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawPolygon ( const TePolygon &  poly,
const bool &  showPoint = false 
) [virtual]

Draws a polygon with vertexes specified in device coordinates.

Parameters:
poly TerraLib polygon instance. (Input)
showPoint If true the polygon vertexes will be drawn. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawCell ( const TeCell &  cell,
const bool &  showPoint = false 
) [inline, virtual]

Draws a cell with vertexes specified in device coordinates.

Parameters:
cell TerraLib cell instance. (Input)
showPoint If true the cell vertexes will be drawn. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawText ( const double &  x,
const double &  y,
const string &  text 
) [virtual]

Draws the text with baseline at (x, y), specified in device coordinates.

Parameters:
x Baseline abscissa. (Input)
y Baseline ordinate. (Input)
text Text to write over canvas. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawRaster ( TeRaster *  raster,
TeRasterTransform *  transf,
const double &  angle = 0.0,
TdkMathMatrix matrix = NULL 
) [virtual]

Draws the raster.

Parameters:
raster A pointer to a TerraLib raster instance. (Input)
transf A pointer to the raster transform function. (Input)
angle ????
matrix ????

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGB ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGB ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGB ( const double &  angle,
const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB image.

Parameters:
angle Angle in decimal degrees to rotate the image. (Input)
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGBA ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
unsigned char *  alpha,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB-Alpha image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
alpha Pointer to alpha channel pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGBA ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
unsigned char *  alpha,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB-Alpha image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
alpha Pointer to alpha channel pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageRGBA ( const double &  angle,
const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  red,
unsigned char *  green,
unsigned char *  blue,
unsigned char *  alpha,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a RGB-Alpha image.

Parameters:
angle Angle in decimal degrees to rotate the image. (Input)
imgW Source image width. (Input)
imgH Source image height. (Input)
red Pointer to red pixel component array. (Input)
green Pointer to green pixel component array. (Input)
blue Pointer to blue pixel component array. (Input)
alpha Pointer to alpha channel pixel component array. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageMap ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  index,
long int *  colors,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH 
) [virtual]

Draws at (dstX, dstY) the pixels of a palette image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
index Pointer to the pixel component. (Input)
colors Pointer to the color palette. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageMap ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  index,
long int *  colors,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a palette image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
index Pointer to the pixel component. (Input)
colors Pointer to the color palette. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageMap ( const double &  angle,
const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  index,
long int *  colors,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a palette image.

Parameters:
angle Angle in decimal degrees to rotate the image. (Input)
imgW Source image width. (Input)
imgH Source image height. (Input)
index Pointer to the pixel component. (Input)
colors Pointer to the color palette. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageGray ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  data,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH 
) [virtual]

Draws at (dstX, dstY) the pixels of a gray image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
data Pointer to the pixel component. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageGray ( const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  data,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a gray image.

Parameters:
imgW Source image width. (Input)
imgH Source image height. (Input)
data Pointer to the pixel component. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawImageGray ( const double &  angle,
const unsigned int &  imgW,
const unsigned int &  imgH,
unsigned char *  data,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW = 0,
const unsigned int &  srcH = 0 
) [virtual]

Draws at (dstX, dstY) the pixels of a gray image.

Parameters:
angle Angle in decimal degrees to rotate the image. (Input)
imgW Source image width. (Input)
imgH Source image height. (Input)
data Pointer to the pixel component. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding height for drawing on canvas from the ordinate (dstY). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawLineSegment ( const TeCoord2D &  c1,
const TeCoord2D &  c2 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::drawLineSegment ( const double &  x0,
const double &  y0,
const double &  x1,
const double &  y1 
) [virtual]

Draws a line segment from (x0, y0) to (x1, y1), specified in device coordinates.

Parameters:
x0 Abscissa value indicating the segment begin. (Input)
y0 Ordinate value indicating the segment begin. (Input)
x1 Abscissa value indicating the segment end. (Input)
y1 Ordinate value indicating the segment end. (Input)

Implements TdkCanvas.

void TdkCDCanvas::drawRect ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
) [virtual]

Draws a rectangle with lower left corner at (llx, lly) and uper right corner at (urx, ury), specified in device coordinates.

Parameters:
llx Lower left abscissa. (Input)
lly Lower left ordinate. (Input)
urx Upper right abscissa. (Input)
ury Upper right ordinate. (Input)

Implements TdkCanvas.

void TdkCDCanvas::fillRect ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
) [virtual]

Fills the rectangle with lower left corner at (llx, lly) and uper right corner at (urx, ury), specified in device coordinates.

Parameters:
llx Lower left abscissa. (Input)
lly Lower left ordinate. (Input)
urx Upper right abscissa. (Input)
ury Upper right ordinate. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawEllipse ( const double &  xc,
const double &  yc,
const double &  rx1,
const double &  ry1,
const double &  rx2,
const double &  ry2 
) [inline, virtual]

Draws an ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
rx1 First conjugate radius (in the same device unit). (Input)
ry1 First conjugate radius (in the same device unit). (Input)
rx2 Second conjugate radius (in the same device unit). (Input)
ry2 Second conjugate radius (in the same device unit). (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawEllipse ( const double &  xc,
const double &  yc,
const double &  rx,
const double &  ry,
const double &  angle 
) [inline, virtual]

Draws an ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
rx X axis width (in the same device unit). (Input)
ry Y axis width (in the same device unit). (Input)
angle Angle to rotate the ellipse round "x" axis. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::fillEllipse ( const double &  xc,
const double &  yc,
const double &  rx1,
const double &  ry1,
const double &  rx2,
const double &  ry2 
) [inline, virtual]

Fills the ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
rx1 First conjugate radius (in the same device unit). (Input)
ry1 First conjugate radius (in the same device unit). (Input)
rx2 Second conjugate radius (in the same device unit). (Input)
ry2 Second conjugate radius (in the same device unit). (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::fillEllipse ( const double &  xc,
const double &  yc,
const double &  rx,
const double &  ry,
const double &  angle 
) [inline, virtual]

Fills the ellipse with center at (xc, yc), specified in device coordinates, x axis width r1 and y axis width r2, especified in the same device unit.

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
rx X axis width (in the same device unit). (Input)
ry Y axis width (in the same device unit). (Input)
angle Angle to rotate the ellipse round "x" axis. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawArc ( const double &  xc,
const double &  yc,
const double &  w,
const double &  h,
const double &  startAngle,
const double &  finalAngle 
) [inline, virtual]

Draws an arc defined by a center at (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startAngle) and the final angle (finalAngle).

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
w Width (in the same device unit). (Input)
h Height (in the same device unit). (Input)
startAngle Start angle in decimal degrees. (Input)
finalAngle Final angle in decimal degrees. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawSector ( const double &  xc,
const double &  yc,
const double &  w,
const double &  h,
const double &  startAngle,
const double &  finalAngle 
) [inline, virtual]

Draws a sector defined by a center coordinate (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startANgle) and the final angle (finalAngle).

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
w Width (in the same device unit). (Input)
h Height (in the same device unit). (Input)
startAngle Start angle in decimal degrees. (Input)
finalAngle Final angle in decimal degrees. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::fillSector ( const double &  xc,
const double &  yc,
const double &  w,
const double &  h,
const double &  startAngle,
const double &  finalAngle 
) [inline, virtual]

Fills the sector defined by a center coordinate (xc, yc), specified in device coordinates, width (w), height (h), the start angle (startANgle) and the final angle (finalAngle).

Parameters:
xc Center abscissa. (Input)
yc Center ordinate. (Input)
w Width (in the same device unit). (Input)
h Height (in the same device unit). (Input)
startAngle Start angle in decimal degrees. (Input)
finalAngle Final angle in decimal degrees. (Input)

Implements TdkCanvas.

virtual char* TdkCDCanvas::getImage ( const double &  x,
const double &  y,
const int &  w,
const int &  h,
TdkImageType  imageType,
int &  size,
const int &  quality = 75 
) [inline, virtual]

Returns an image from the current canvas buffer content in a specified format (PNG, JPEG, GIF or other).

Parameters:
x Initial canvas abscissa position to copy pixels from. (Input)
y Initial canvas ordinate position to copy pixels from. (Input)
w Number of columns (width) to copy from canvas. (Input)
h Number of lines (height) to copy from canvas. (Input)
imageType The desired output format. (Input)
size The size of returned image in bytes. (Output)
quality Defines the quality desired. It applies to JPEG image. (Output)

Implements TdkCanvas.

virtual void TdkCDCanvas::getImageGray ( const double &  x,
const double &  y,
const int &  w,
const int &  h,
unsigned char *  data 
) [inline, virtual]

Returns a Gray Image from the current canvas buffer content.

Parameters:
x Initial canvas abscissa position to copy pixels from. (Input)
y Initial canvas ordinate position to copy pixels from. (Input)
w Number of columns (width) to copy from canvas. (Input)
h Number of lines (height) to copy from canvas. (Input)
data Pointer to the pixel array to be written from canvas. (Output)

Implements TdkCanvas.

virtual void TdkCDCanvas::getImageMap ( const double &  x,
const double &  y,
const int &  w,
const int &  h,
unsigned char *  index,
long int *  colors 
) [inline, virtual]

Returns a Palette Image from the current canvas buffer content.

Parameters:
x Initial canvas abscissa position to copy pixels from. (Input)
y Initial canvas ordinate position to copy pixels from. (Input)
w Number of columns (width) to copy from canvas. (Input)
h Number of lines (height) to copy from canvas. (Input)
index Pointer to a red array component to be written from canvas. (Output)
colors Pointer to a green array component to be written from canvas. (Output)

Implements TdkCanvas.

virtual void TdkCDCanvas::getImageRGBA ( const double &  x,
const double &  y,
const int &  w,
const int &  h,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b,
unsigned char *  a 
) [inline, virtual]

Returns an RGB-Alpha array from the current canvas buffer content.

Parameters:
x Initial canvas abscissa position to copy pixels from. (Input)
y Initial canvas ordinate position to copy pixels from. (Input)
w Number of columns (width) to copy from canvas. (Input)
h Number of lines (height) to copy from canvas. (Input)
r Pointer to a red array component to write from canvas. (Output)
g Pointer to a green array component to be written from canvas. (Output)
b Pointer to a blue array component to be written from canvas. (Output)
a Pointer to an alpha array component to be written from canvas. (Output)

Implements TdkCanvas.

void TdkCDCanvas::getImageRGB ( const double &  x,
const double &  y,
const int &  w,
const int &  h,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b 
) [virtual]

Returns an RGB array from the current canvas buffer content.

Parameters:
x Initial canvas abscissa position to copy pixels from. (Input)
y Initial canvas ordinate position to copy pixels from. (Input)
w Number of columns (width) to copy from canvas. (Input)
h Number of lines (height) to copy from canvas. (Input)
r Pointer to a red array component to be writen from canvas. (Output)
g Pointer to a green array component to be written from canvas. (Output)
b Pointer to a blue array component to be written from canvas. (Output)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawImage ( char *  image,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH,
const double &  dstX,
const double &  dstY,
const TdkImageType imageType 
) [inline, virtual]

Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).

Parameters:
image A pointer to an image (PNG, JPEG or other). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
imageType Image type: TePNG, TeJPEG, TeGIF, TeBITMAP or others. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawImage ( char *  image,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const TdkImageType imageType 
) [inline, virtual]

Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).

Parameters:
image A pointer to an image (PNG, JPEG or other). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding width for drawing on canvas from the ordinate (dstY). (Input)
imageType Image type: TePNG, TeJPEG, TeGIF, TeBITMAP or others. (Input)

Implements TdkCanvas.

virtual void TdkCDCanvas::drawImage ( const double &  angle,
char *  image,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH,
const double &  dstX,
const double &  dstY,
const unsigned int &  dstW,
const unsigned int &  dstH,
const TdkImageType imageType 
) [inline, virtual]

Draws at (dstX, dstY) the srcW by srcH area of pixels from (srcX, srcY) in image of type (imageType).

Parameters:
angle Angle in decimal degrees to rotate the image. (Input)
image A pointer to an image (PNG, JPEG or other). (Input)
srcX Initial abscissa position of the pixel on the image to copy to canvas. (Input)
srcY Initial ordinate position of the pixel on the image to copy to canvas. (Input)
srcW Number of columns (width) to copy from srcX position. (Input)
srcH Number of lines (height) to copy from srcY position. (Input)
dstX Baseline abscissa on canvas. (Input)
dstY Baseline ordinate on canvas. (Input)
dstW Bounding width for drawing on canvas from the abscissa (dstX). (Input)
dstH Bounding width for drawing on canvas from the ordinate (dstY). (Input)
imageType Image type: TePNG, TeJPEG, TeGIF, TeBITMAP or others. (Input)

Implements TdkCanvas.

int TdkCDCanvas::setActiveBuffer ( const int &  bufferId  )  [virtual]

Sets the current buffer used to draw. This method changes the current buffer used to draw, you should specify a valid identifier, otherwise it will be raised an exception.

Parameters:
bufferId Buffer identification: it is a key for identify a given buffer. (Input)
Returns:
Return the previous buffer id that was active or -1 if the buffer could not be found.

Reimplemented from TdkCanvas.

int TdkCDCanvas::getActiveBuffer (  )  [virtual]

void TdkCDCanvas::repaint (  )  [virtual]

Do a repaint on canvas.

Implements TdkCanvas.

int TdkCDCanvas::setPaintMode ( const int &  mode  )  [virtual]

Adjusts canvas drawing mode: ....

Parameters:
mode The mode can be one of the following: ..... (Input)

Reimplemented from TdkCanvas.

void TdkCDCanvas::clear (  )  [virtual]

Implements TdkCanvas.

void TdkCDCanvas::clearRect ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
) [virtual]

TeProjection * TdkCDCanvas::setViewProjection ( TeProjection *  proj  )  [virtual]

Reimplemented from TdkCanvas.

void TdkCDCanvas::setOrigin ( double  x,
double  y 
) [virtual]

void TdkCDCanvas::translateArea ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  dx,
double  dy 
) [virtual]

void TdkCDCanvas::getTextBoundsW ( const string &  text,
const double &  x,
const double &  y,
const double &  angle,
TdkTextBounds bounds 
) [virtual]

Returns the bounding box of a text in world coordinates.

Parameters:
text The text to retrieve the bounding box.
box A polygon with all text box coordinates (the box may not be parallel to xy axis). (Output)

Implements TdkCanvas.

void TdkCDCanvas::getTextBounds ( const string &  text,
const double &  x,
const double &  y,
const double &  angle,
TdkTextBounds bounds 
) [virtual]

Returns the bounding box of a text in device coordinates.

Parameters:
text The text to retrieve the bounding box.
box A polygon with all text box coordinates (the box may not be parallel to xy axis). (Output)

Implements TdkCanvas.

void TdkCDCanvas::getTextBoundsW ( const TeText &  text,
TdkTextBounds bounds 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::getTextBounds ( const TeText &  text,
TdkTextBounds bounds 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::setClipArea ( const TeBox &  box  )  [virtual]

Establishes a clipping rectangle. Once setClipArea has been called, all future drawing operations will remain within the specified clipping area, until a new setClipArea call takes place. For instance, if a clipping rectangle of 25, 25, 75, 75 has been set within a 100x100 device area, a diagonal line from 0,0 to 99,99 will appear only between 25,25 and 75,75.

Parameters:
box The box that will delimit the drawing area (in device coordinates). (Input)

Implements TdkCanvas.

void TdkCDCanvas::setClipArea ( const double &  llx,
const double &  lly,
const double &  urx,
const double &  ury 
) [virtual]

Establishes a clipping rectangle. Once setClipArea has been called, all future drawing operations will remain within the specified clipping area, until a new setClipArea call takes place. For instance, if a clipping rectangle of 25, 25, 75, 75 has been set within a 100x100 device area, a diagonal line from 0,0 to 99,99 will appear only between 25,25 and 75,75.

Parameters:
llx Lower left abscissa (in device coordinates). (Input)
lly Lower left ordinate (in device coordinates). (Input)
urx Upper left abscissa (in device coordinates). (Input)
ury Upper left ordinate (in device coordinates). (Input)

Implements TdkCanvas.

void TdkCDCanvas::getClipArea ( double &  llx,
double &  lly,
double &  urx,
double &  ury 
) [virtual]

Returns the clipping area.

Parameters:
llx Lower left abscissa (in device coordinates). (Output)
lly Lower left ordinate (in device coordinates). (Output)
urx Upper left abscissa (in device coordinates). (Output)
ury Upper left ordinate (in device coordinates). (Output)

Implements TdkCanvas.

void TdkCDCanvas::setClipArea ( const TePolygon &  poly  )  [virtual]

Establishes a clipping polygon. Once setClipArea has been called, all future drawing operations will remain within the specified polygon clipping area, until a new setClipArea call takes place.

Parameters:
poly The polygon that will delimit the drawing area (in device coordinates). (Input)

Implements TdkCanvas.

void TdkCDCanvas::setClipArea ( const TePolygonSet &  polys,
const TdkClipAreaType clipType 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::getClipArea ( TePolygon &  poly  )  [virtual]

Returns the clipping polygon.

Parameters:
poly The current clipping polygon (in device coordinates). (Output)

Implements TdkCanvas.

void TdkCDCanvas::activateClip (  )  [virtual]

Activate clipping mode.

Implements TdkCanvas.

void TdkCDCanvas::deactivateClip (  )  [virtual]

Deactivate clipping mode.

Implements TdkCanvas.

void TdkCDCanvas::mm2Pixel ( const double &  mmDx,
const double &  mmDy,
double &  pDx,
double &  pDy 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::pixel2MM ( const double &  pDx,
const double &  pDy,
double &  mmDx,
double &  mmDy 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::maximizeViewport (  )  [virtual]

int TdkCDCanvas::getWidth (  )  const [virtual]

int TdkCDCanvas::getHeight (  )  const [virtual]

void TdkCDCanvas::getDimension ( double &  w,
double &  h 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::getDimensionMM ( double &  w,
double &  h 
) [virtual]

Implements TdkCanvas.

void TdkCDCanvas::reDim ( double  w,
double  h 
) [virtual]

void TdkCDCanvas::setCountStep ( unsigned int  step  )  [virtual]

unsigned int TdkCDCanvas::getCountStep (  )  const [virtual]

void TdkCDCanvas::flush (  )  [virtual]

void TdkCDCanvas::invertViewportY ( int &  y  )  const [virtual]

cdCanvas * TdkCDCanvas::getCanvas (  )  const [virtual]

TeRasterParams & TdkCDCanvas::getParams (  )  [virtual]

bool TdkCDCanvas::useGDIPlus (  )  [static]

bool TdkCDCanvas::isGDIPlusContext (  )  const [virtual]

int TdkCDCanvas::getCDClipAreaType ( const TdkClipAreaType clipType  )  [protected, virtual]

int TdkCDCanvas::getCDTextAlignment ( const double &  talH,
const double &  talV 
) [protected, virtual]

virtual void TdkCDCanvas::setCDTextVisual ( const std::string &  font,
const bool &  bold,
const bool &  italic,
const int &  size 
) [protected, virtual]

bool TdkCDCanvas::isCanvasGDIPlus ( cdCanvas *  cd  )  const [protected, virtual]

bool TdkCDCanvas::needToFlipImage (  )  [static, protected]

void TdkCDCanvas::calculateDrawImageParams ( const double &  dstX0,
const double &  dstY0,
const double &  dstX1,
const double &  dstY1,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH,
int &  dst_w,
int &  dst_h,
int &  src_x2,
int &  src_y2 
) [protected, virtual]

void TdkCDCanvas::drawTdkImageRGB ( TdkImageRGB image,
const double &  dstX0,
const double &  dstY0,
const double &  dstX1,
const double &  dstY1,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH 
) [protected, virtual]

void TdkCDCanvas::drawTdkImageRGBA ( TdkImageRGBA image,
const double &  dstX0,
const double &  dstY0,
const double &  dstX1,
const double &  dstY1,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH 
) [protected, virtual]

void TdkCDCanvas::drawTdkImageMap ( TdkImageMap image,
const double &  dstX0,
const double &  dstY0,
const double &  dstX1,
const double &  dstY1,
const double &  srcX,
const double &  srcY,
const unsigned int &  srcW,
const unsigned int &  srcH 
) [protected, virtual]

bool TdkCDCanvas::buildRaster (  )  [protected, virtual]

void TdkCDCanvas::fillDecoder ( TeRaster *  raster,
TeRasterTransform *  transf,
TeBox &  paintedArea,
const double &  angle = 0.,
TdkMathMatrix matrix = NULL 
) [protected, virtual]

void TdkCDCanvas::processBlocks ( TeRaster *  raster,
const TeRasterParams &  parBlock,
TeRasterRemap &  remap,
TeBox &  bboxIntersection,
TeBox &  paintedArea,
const int &  res,
const double &  angle = 0.,
TdkMathMatrix matrix = NULL 
) [protected]

void TdkCDCanvas::drawPaintedAreaImage ( TdkImageRGB image,
TeBox &  paintedArea,
const double &  angle = 0.,
TdkMathMatrix matrix = NULL 
) [protected]

cdContext * TdkCDCanvas::getCDContext ( TdkCDCanvas::Drivers  drv  )  [private, virtual]

void TdkCDCanvas::createCanvas ( TdkCDCanvas::Drivers  drv,
void *  data,
bool  double_buffer = false,
bool  with_cache = false 
) [private, virtual]

bool TdkCDCanvas::createDoubleBuffer (  )  [private, virtual]

bool TdkCDCanvas::createCache (  )  [private, virtual]

void TdkCDCanvas::createXorCanvas ( cdContext *  ctx,
void *  data 
) [private, virtual]

void TdkCDCanvas::createXorCanvas (  )  [private, virtual]

void TdkCDCanvas::setDefaultValues (  )  [private, virtual]

Sets all the class variables to the default values.

void TdkCDCanvas::setCDDefaultValues ( cdCanvas *  cv  )  [private, virtual]

void TdkCDCanvas::initializeGdiPlus (  )  [static, private]

void TdkCDCanvas::drawVertex ( const TeCoord2D &  vtx  )  [private, virtual]

void TdkCDCanvas::drawVertexW ( const TeCoord2D &  vtx  )  [private, virtual]

void TdkCDCanvas::setWorldRasterParams (  )  [private, virtual]

void TdkCDCanvas::incrementCount ( unsigned int  inc = 1  )  [private, virtual]

void TdkCDCanvas::imgRectWindow2Viewport ( double  wx0,
double  wy0,
double  wx1,
double  wy1,
double &  vx0,
double &  vy0,
double &  vw,
double &  vh 
) [private, virtual]

This method auxiliates the drawImage... methods. It transforms a rectangle in world coordinates to viewport coordinates and instead of giving the coordinates of the opposite corner of the rectangle is computes the rectangle dimensions and is needed by the cdPutImageRect... functions.


Member Data Documentation

const int TdkCDCanvas::TDK_DEFAULT_COUNT_STEP = 10000 [static]

TeRasterParams TdkCDCanvas::params_ [protected]

TeRaster* TdkCDCanvas::backRaster_ [protected]

bool TdkCDCanvas::usingDoubleBuffer_ [protected]

bool TdkCDCanvas::usingCacheBuffer_ [protected]

cdContext* TdkCDCanvas::xor_ctx_ [protected]

void* TdkCDCanvas::xor_data_ [protected]

cdCanvas* TdkCDCanvas::frontCv_ [protected]

handle to CD front canvas.

cdCanvas* TdkCDCanvas::backCv_ [protected]

handle to CD back canvas.

cdCanvas* TdkCDCanvas::xorCv_ [protected]

handle to the canvas uses to write XOR if GDI+ is used.

cdCanvas* TdkCDCanvas::activeCv_ [protected]

handle to CD active canvas.

cdCanvas* TdkCDCanvas::cacheCv_ [protected]

handle to CD active canvas.

TdkCDClipType TdkCDCanvas::clipType_ [protected]

const bool TdkCDCanvas::killCdCv_ [protected]

True if the object instance is responsible for killing the cd_cv_(cdCanvas*) when itself is deleted. This happens when the CD canvas is created by this object instance.

long int TdkCDCanvas::backColor_ [protected]

long int TdkCDCanvas::pointColor_ [protected]

current point color.

long int TdkCDCanvas::lineColor_ [protected]

current line color.

long int TdkCDCanvas::polyColor_ [protected]

current polygon fill color.

long int TdkCDCanvas::polyBorderColor_ [protected]

current polygon fill color.

long int TdkCDCanvas::txtColor_ [protected]

current text color.

long int TdkCDCanvas::txtBackgroundColor_ [protected]

long int TdkCDCanvas::txtBorderColor_ [protected]

int TdkCDCanvas::dashSize_ [protected]

int* TdkCDCanvas::dashArray_ [protected]

bool TdkCDCanvas::isPtCharType_ [protected]

char TdkCDCanvas::ptChar_ [protected]

int TdkCDCanvas::ptType_ [protected]

int TdkCDCanvas::ptSize_ [protected]

int TdkCDCanvas::lineType_ [protected]

int TdkCDCanvas::lineWidth_ [protected]

int TdkCDCanvas::polyType_ [protected]

int TdkCDCanvas::polyBorderType_ [protected]

int TdkCDCanvas::polyBorderWidth_ [protected]

bool TdkCDCanvas::usePolyBackgroundColor_ [protected]

string TdkCDCanvas::txtFont_ [protected]

int TdkCDCanvas::txtSize_ [protected]

bool TdkCDCanvas::txtBold_ [protected]

bool TdkCDCanvas::txtItalic_ [protected]

double TdkCDCanvas::txtAlignV_ [protected]

double TdkCDCanvas::txtAlignH_ [protected]

double TdkCDCanvas::txtAngle_ [protected]

int TdkCDCanvas::txtBorderType_ [protected]

int TdkCDCanvas::txtBorderWidth_ [protected]

int TdkCDCanvas::txtBackgroundType_ [protected]

unsigned int TdkCDCanvas::count_ [protected]

unsigned int TdkCDCanvas::countStep_ [protected]

const char * TdkCDCanvas::CD_ATTR_NAME_ANTIALIAS = "ANTIALIAS" [static, private]


The documentation for this class was generated from the following files:
Generated on Fri Jun 15 16:54:30 2007 for TDK by  doxygen 1.5.2