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;
91 class Canvas :
public boost::noncopyable
123 virtual void setWindow(
const double& llx,
const double& lly,
124 const double& urx,
const double& ury) = 0;
138 virtual void calcAspectRatio(
double& llx,
double& lly,
double& urx,
double& ury,
174 virtual void clear() = 0;
182 virtual void resize(
int w,
int h) = 0;
277 virtual void save(
const char* fileName,
ImageType t,
int quality = 75,
int fg = 0)
const = 0;
291 virtual char*
getImage(
ImageType t, std::size_t& size,
int quality = 75,
int fg = 0)
const = 0;
307 virtual void freeImage(
char* img)
const = 0;
360 virtual void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
ImageType t) = 0;
390 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;
448 virtual void drawPixel(
int x,
int y) = 0;
486 const std::string& txt,
503 const std::string& txt,
520 virtual void drawText(
const double& x,
const double& y,
521 const std::string& txt,
551 const std::string& txt,
572 const std::string& txt,
594 const std::string& txt,
1007 #endif // __TERRALIB_MAPTOOLS_INTERNAL_CANVAS_H
MultiLineString is a MultiCurve whose elements are LineStrings.
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 setPolygonContourPatternOpacity(int opacity)=0
It sets the polygon contour pattern opacity.
virtual void setTextContourColor(const te::color::RGBAColor &color)=0
It sets the text contour (outline) drawing color.
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 setTextPointSize(double size)=0
It sets the text point Size.
FontWeight
Font weight for drawing text.
virtual void setPolygonContourPatternRotation(const double &angle)=0
It sets the polygon contour pattern rotation.
virtual void setPointPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the point pattern.
virtual void setLinePatternRotation(const double &angle)=0
It sets the line pattern rotation. Rotation is made from the center of the pattern.
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.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
virtual void setTextOpacity(int opacity)=0
It sets the text opacity.
virtual void setPointPatternOpacity(int opacity)=0
It sets the point pattern opacity.
A canvas is an abstraction of a drawing area.
virtual void setTextContourEnabled(bool b)=0
It controls the display of the text outline.
virtual void setPolygonContourColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw the boundary of polygon geometries.
AlignType
This enum contains values to control the alignment of components (like Canvas and MapDisplay)...
virtual void setTextOverline(bool b)=0
It sets the text overline flag.
HorizontalAlignment
Horizontal alignment for drawing text.
virtual void setTextContourWidth(int width)=0
It sets the text contour width.
Several enumerations related to Annotation Text.
virtual void setTextStyle(te::at::FontStyle style)=0
It sets the text style.
virtual void setPolygonPatternRotation(const double &angle)=0
It sets the polygon pattern rotation.
ImageType
This enum specifies the possible input and output image formats supported by the canvas API...
virtual void setPolygonFillColor(const te::color::RGBAColor &color)=0
It sets the color used to fill the draw of polygon geometries.
virtual void setLinePattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the line pattern.
virtual void setBackgroundColor(const te::color::RGBAColor &color)=0
It sets the canvas background color.
virtual void drawImage(char *src, std::size_t size, ImageType t)=0
It draws the src image over the canvas.
LineString is a curve with linear interpolation between points.
virtual void setPointPatternRotation(const double &angle)=0
It sets the point pattern rotation. Rotation is made from the center of the pattern.
virtual void setNormalMode()=0
It sets the painter to normal copy source to destination mode.
virtual ~Canvas()
Virtual destructor.
virtual te::color::RGBAColor getBackgroundColor() const =0
It returns the canvas background color.
virtual void setTextStretch(std::size_t stretch)=0
It sets the text stretch.
MultiPolygon is a MultiSurface whose elements are Polygons.
virtual void setPolygonFillPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the polygon fill pattern.
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 int getHeight() const =0
It returns the canvas height.
LineJustification
Line justification for drawing multi line text.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
LineCapStyle
This enum encodes enumerated values telling how line strings should be capped (at the two ends of the...
virtual void setFontFamily(const std::string &family)=0
It sets the text font family.
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
virtual void drawPixel(int x, int y)=0
It sets a pixel using the point pen.
A point with x and y coordinate values.
A Text may contain 1 or more Text Elements.
virtual void setPolygonContourWidth(int w)=0
It sets the polygon contour width.
virtual void setTextWeight(te::at::FontWeight weight)=0
It sets the text weight.
virtual void setPointColor(const te::color::RGBAColor &color)=0
It sets the point drawing color.
virtual void setTextDecorationWidth(int width)=0
It sets the width for drawing text decoration.
virtual void resize(int w, int h)=0
It adjusts the canvas size (width and height).
virtual void setPolygonPatternOpacity(int opacity)=0
It sets the polygon pattern opacity.
virtual void setPolygonContourCapStyle(LineCapStyle style)=0
It sets the polygon contour cap style.
virtual void setTextStrikeOut(bool b)=0
It sets the text strike out flag.
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 setEraseMode()=0
It sets the painter to erase mode.
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
It is a collection of other geometric objects.
virtual void setTextColor(const te::color::RGBAColor &color)=0
It sets the text drawing color.
virtual void setLineCapStyle(LineCapStyle style)=0
It sets the line cap style.
virtual void setLineDashStyle(LineDashStyle style)=0
It sets the line dash style.
virtual void setLineJoinStyle(LineJoinStyle style)=0
It sets the line join style.
virtual void draw(const te::gm::Geometry *geom)=0
It draws the geometry on canvas.
virtual void setTextJustification(te::at::LineJustification just)=0
It sets the text justification for multi line text.
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 setLineColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw line geometries.
LineDashStyle
This enum encodes enumerated values telling how lines should be drawn. e.g. as a plain line or dash l...
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...
An abstract class for raster data strucutures.
MultiPoint is a GeometryCollection whose elements are restricted to points.
FontStyle
Font style for drawing text.
virtual void setPointWidth(int w)=0
It sets the point width. If point has a patterns, this pattern is scaled to width.
virtual void setLinePatternOpacity(int opacity)=0
It sets the line pattern opacity.
virtual void setPolygonContourJoinStyle(LineJoinStyle style)=0
It sets the polygon contour join style.
virtual void setPolygonPatternWidth(int w)=0
It sets the polygon pattern width.
An Envelope defines a 2D rectangular region.
virtual void setTextMultiLineSpacing(int spacing)=0
It sets the multi line text spacing.
virtual void setTextUnderline(bool b)=0
It sets the text underline flag.
virtual int getWidth() const =0
It returns the canvas width.
VerticalAlignment
Vertical alignment 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 setTextDecorationColor(const te::color::RGBAColor &color)=0
It sets the text color for drawing text decoration.
virtual void setLineWidth(int w)=0
It sets the line width.
virtual void setTextContourOpacity(int opacity)=0
It sets the text contour opacity.
virtual void setPolygonContourDashStyle(LineDashStyle style)=0
It sets the polygon contour dash style.
LineJoinStyle
This enum encodes enumerated values telling how line strings should be joined (between line segments)...
virtual void clear()=0
It clears the canvas content and fills with the background color.