26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
30 #include "../annotationtext/Enums.h"
31 #include "../color/RGBAColor.h"
36 #include <boost/noncopyable.hpp>
45 class GeometryCollection;
47 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;
493 const std::string& txt,
510 const std::string& txt,
527 virtual void drawText(
const double& x,
const double& y,
528 const std::string& txt,
558 const std::string& txt,
579 const std::string& txt,
601 const std::string& txt,
1014 #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.
FontWeight
Font weight for drawing text.
virtual void setFontFamily(const std::string &family)=0
It sets the text font family.
virtual void setTextMultiLineSpacing(int spacing)=0
It sets the multi line text spacing.
LineJustification
Line justification for drawing multi line text.
FontStyle
Font style for drawing text.
virtual te::gm::Polygon * getTextBoundary(int x, int y, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)=0
It returns the text boundary (its enclose rectangle).
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 int getHeight() const =0
It returns the canvas height.
virtual void setPointPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the point pattern.
virtual void drawText(int x, int y, const std::string &txt, float angle=0.0, te::at::HorizontalAlignment hAlign=te::at::Start, te::at::VerticalAlignment vAlign=te::at::Baseline)=0
It draws a text.
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 void clear()=0
It clears the canvas content and fills with the background color.
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.
A Text may contain 1 or more Text Elements.
virtual int getWidth() const =0
It returns the canvas width.
Several enumerations related to Annotation Text.
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.
HorizontalAlignment
Horizontal alignment for drawing text.
virtual void setTextJustification(te::at::LineJustification just)=0
It sets the text justification for multi line text.
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 void drawPixel(int x, int y)=0
It sets a pixel using the point pen.
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 setPolygonContourPatternOpacity(int opacity)=0
It sets the polygon contour pattern opacity.
virtual void setTextStyle(te::at::FontStyle style)=0
It sets the text style.
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.
virtual te::color::RGBAColor getBackgroundColor() const =0
It returns the canvas background color.
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.
VerticalAlignment
Vertical alignment for drawing text.
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
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 setPolygonContourJoinStyle(LineJoinStyle style)=0
It sets the polygon contour join style.
virtual void freeImage(char *img) const =0
This is the method that you should use to release an image generated by the canvas.
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.
virtual void setPolygonContourDashStyle(LineDashStyle style)=0
It sets the polygon contour dash style.
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, ...).
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 void setTextWeight(te::at::FontWeight weight)=0
It sets the text weight.
virtual ~Canvas()
Virtual destructor.
virtual void setTextOverline(bool b)=0
It sets the text overline flag.
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.