26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
30 #include "../color/RGBAColor.h"
31 #include "../se/Font.h"
36 #include <boost/noncopyable.hpp>
50 class GeometryCollection;
52 class MultiLineString;
92 class Canvas :
public boost::noncopyable
124 virtual void setWindow(
const double& llx,
const double& lly,
125 const double& urx,
const double& ury) = 0;
139 virtual void calcAspectRatio(
double& llx,
double& lly,
double& urx,
double& ury,
175 virtual void clear() = 0;
183 virtual void resize(
int w,
int h) = 0;
284 virtual void save(
const char* fileName,
ImageType t,
int quality = 75,
int fg = 0)
const = 0;
298 virtual char*
getImage(
ImageType t, std::size_t& size,
int quality = 75,
int fg = 0)
const = 0;
314 virtual void freeImage(
char* img)
const = 0;
367 virtual void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
ImageType t) = 0;
397 virtual void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
ImageType t,
int sx,
int sy,
int sw,
int sh) = 0;
455 virtual void drawPixel(
int x,
int y) = 0;
495 const std::string& txt,
497 double anchorX = 0.5,
double anchorY = 0.5,
498 int displacementX = 0,
int displacementY = 0) = 0;
514 const std::string& txt,
516 double anchorX = 0.5,
double anchorY = 0.5,
517 int displacementX = 0,
int displacementY = 0) = 0;
533 virtual void drawText(
const double& x,
const double& y,
534 const std::string& txt,
536 double anchorX = 0.5,
double anchorY = 0.5,
537 int displacementX = 0,
int displacementY = 0) = 0;
558 const std::string& txt,
560 double anchorX = 0.5,
double anchorY = 0.5,
561 int displacementX = 0,
int displacementY = 0) = 0;
581 const std::string& txt,
583 double anchorX = 0.5,
double anchorY = 0.5,
584 int displacementX = 0,
int displacementY = 0) = 0;
605 const std::string& txt,
607 double anchorX = 0.5,
double anchorY = 0.5,
608 int displacementX = 0,
int displacementY = 0) = 0;
1018 #endif // __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
virtual void setLineCapStyle(LineCapStyle style)=0
It sets the line cap style.
ImageType
This enum specifies the possible input and output image formats supported by the canvas API...
virtual void resize(int w, int h)=0
It adjusts the canvas size (width and height).
MultiPolygon is a MultiSurface whose elements are Polygons.
virtual void setPointWidth(int w)=0
It sets the point width. If point has a patterns, this pattern is scaled to width.
virtual void setTextDecorationColor(const te::color::RGBAColor &color)=0
It sets the text color for drawing text decoration.
virtual void setFontFamily(const std::string &family)=0
It sets the text font family.
virtual void drawText(int x, int y, const std::string &txt, float angle=0.0, double anchorX=0.5, double anchorY=0.5, int displacementX=0, int displacementY=0)=0
It draws a text.
virtual void setTextMultiLineSpacing(int spacing)=0
It sets the multi line text spacing.
virtual void setTextOpacity(int opacity)=0
It sets the text opacity.
virtual void setPolygonFillColor(const te::color::RGBAColor &color)=0
It sets the color used to fill the draw of polygon geometries.
virtual void setPointPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the point pattern.
virtual void setLineWidth(int w)=0
It sets the line width.
virtual void setPointPatternRotation(const double &angle)=0
It sets the point pattern rotation. Rotation is made from the center of the pattern.
virtual te::gm::Polygon * getTextBoundary(int x, int y, const std::string &txt, float angle=0.0, double anchorX=0.5, double anchorY=0.5, int displacementX=0, int displacementY=0)=0
It returns the text boundary (its enclose rectangle).
virtual void clear()=0
It clears the canvas content and fills with the background color.
virtual void setBackgroundColor(const te::color::RGBAColor &color)=0
It sets the canvas background color.
virtual void setPolygonContourPatternRotation(const double &angle)=0
It sets the polygon contour pattern rotation.
virtual void setPolygonPatternRotation(const double &angle)=0
It sets the polygon pattern rotation.
virtual void setLineJoinStyle(LineJoinStyle style)=0
It sets the line join style.
AlignType
This enum contains values to control the alignment of components (like Canvas and MapDisplay)...
LineCapStyle
This enum encodes enumerated values telling how line strings should be capped (at the two ends of the...
virtual void setLinePattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the line pattern.
virtual void setWindow(const double &llx, const double &lly, const double &urx, const double &ury)=0
It sets the world (or window) coordinates area (supposing a cartesian reference system).
virtual void setTextUnderline(bool b)=0
It sets the text underline flag.
MultiPoint is a GeometryCollection whose elements are restricted to points.
virtual void setPolygonContourPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the pen pattern used to draw the boundary of polygon geometries.
virtual void setPolygonFillPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the polygon fill pattern.
LineString is a curve with linear interpolation between points.
virtual char * getImage(ImageType t, std::size_t &size, int quality=75, int fg=0) const =0
It returns the internal content as an image in a specific format (PNG, JPEG, ...).
virtual void setPolygonPatternOpacity(int opacity)=0
It sets the polygon pattern opacity.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
An abstract class for raster data strucutures.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
virtual void setLineDashStyle(LineDashStyle style)=0
It sets the line dash style.
virtual void setTextColor(const te::color::RGBAColor &color)=0
It sets the text drawing color.
virtual int getHeight() const =0
It returns the canvas height.
virtual void drawPixel(int x, int y)=0
It sets a pixel using the point pen.
virtual void setTextWeight(te::se::Font::FontWeightType weight)=0
It sets the text weight.
virtual void setLinePatternOpacity(int opacity)=0
It sets the line pattern opacity.
virtual void setTextContourOpacity(int opacity)=0
It sets the text contour opacity.
virtual void setTextContourWidth(int width)=0
It sets the text contour width.
virtual void drawImage(char *src, std::size_t size, ImageType t)=0
It draws the src image over the canvas.
virtual void setTextDecorationWidth(int width)=0
It sets the width for drawing text decoration.
virtual void setLinePatternRotation(const double &angle)=0
It sets the line pattern rotation. Rotation is made from the center of the pattern.
virtual void freeImage(char *img) const =0
This is the method that you should use to release an image generated by the canvas.
FontStyleType
It defines the style to use for a font.
virtual void setPolygonContourPatternOpacity(int opacity)=0
It sets the polygon contour pattern opacity.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
virtual void setPolygonContourWidth(int w)=0
It sets the polygon contour width.
virtual void setTextContourColor(const te::color::RGBAColor &color)=0
It sets the text contour (outline) drawing color.
virtual void setEraseMode()=0
It sets the painter to erase mode.
MultiLineString is a MultiCurve whose elements are LineStrings.
virtual void setTextStrikeOut(bool b)=0
It sets the text strike out flag.
A canvas is an abstraction of a drawing area.
virtual void setPointColor(const te::color::RGBAColor &color)=0
It sets the point drawing color.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
LineDashStyle
This enum encodes enumerated values telling how lines should be drawn. e.g. as a plain line or dash l...
LineJoinStyle
This enum encodes enumerated values telling how line strings should be joined (between line segments)...
virtual void setTextContourEnabled(bool b)=0
It controls the display of the text outline.
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
virtual te::color::RGBAColor getBackgroundColor() const =0
It returns the canvas background color.
virtual void setPolygonContourColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw the boundary of polygon geometries.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual void setTextStyle(te::se::Font::FontStyleType style)=0
It sets the text style.
virtual void setPolygonContourJoinStyle(LineJoinStyle style)=0
It sets the polygon contour join style.
virtual void setLineColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw line geometries.
virtual void setPointPatternOpacity(int opacity)=0
It sets the point pattern opacity.
virtual void setPolygonPatternWidth(int w)=0
It sets the polygon pattern width.
FontWeightType
It gives the amount of weight or boldness to use for a font.
virtual void setPolygonContourDashStyle(LineDashStyle style)=0
It sets the polygon contour dash style.
It is a collection of other geometric objects.
virtual void calcAspectRatio(double &llx, double &lly, double &urx, double &ury, const AlignType hAlign=Center, const AlignType vAlign=Center)=0
It calculates the best aspect ratio for world (or window) coordinates area (supposing a cartesian ref...
virtual void draw(const te::gm::Geometry *geom)=0
It draws the geometry on canvas.
virtual ~Canvas()
Virtual destructor.
virtual void setTextOverline(bool b)=0
It sets the text overline flag.
virtual void setTextJustification(int justType)=0
It sets the text justification for multi line text.
virtual void save(const char *fileName, ImageType t, int quality=75, int fg=0) const =0
It saves the canvas content to a file image in the specified format type.
virtual int getWidth() const =0
It returns the canvas width.
virtual void setNormalMode()=0
It sets the painter to normal copy source to destination mode.
virtual void setTextPointSize(double size)=0
It sets the text point Size.
virtual void setTextStretch(std::size_t stretch)=0
It sets the text stretch.
virtual void setPolygonContourCapStyle(LineCapStyle style)=0
It sets the polygon contour cap style.