26 #ifndef __TERRALIB_QT_WIDGETS_INTERNAL_CANVAS_H
27 #define __TERRALIB_QT_WIDGETS_INTERNAL_CANVAS_H
30 #include "../../../maptools/Canvas.h"
31 #include "../Config.h"
70 Canvas(
int w,
int h,
int devType = QInternal::Pixmap);
79 Canvas(QPaintDevice* device);
91 void setWindow(
const double& llx,
const double& lly,
92 const double& urx,
const double& ury);
94 void calcAspectRatio(
double& llx,
double& lly,
double& urx,
double& ury,
107 void resize(
int w,
int h);
109 int getWidth()
const;
111 int getHeight()
const;
131 void save(
const char* fileName,
te::map::ImageType t,
int quality = 75,
int fg = 0)
const;
133 char* getImage(
te::map::ImageType t, std::size_t& size,
int quality = 75,
int fg = 0)
const;
135 te::color::RGBAColor** getImage(
const int x = 0,
const int y = 0,
const int w = 0,
const int h = 0)
const;
137 void freeImage(
char* img)
const;
147 void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
te::map::ImageType t);
151 void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
te::map::ImageType t,
int sx,
int sy,
int sw,
int sh);
153 void drawImage(
int x,
int y,
int w,
int h,
te::color::RGBAColor** src,
int sx,
int sy,
int sw,
int sh);
157 void drawImage(
int x,
int y,
int w,
int h,
te::rst::Raster* src,
int sx,
int sy,
int sw,
int sh,
int opacity =
TE_OPAQUE);
159 void drawPixel(
int x,
int y);
163 void drawText(
int x,
int y,
164 const std::string& txt,
170 const std::string& txt,
175 void drawText(
const double& x,
const double& y,
176 const std::string& txt,
184 const std::string& txt,
190 const std::string& txt,
196 const std::string& txt,
203 void setTextOpacity(
int opacity);
205 void setFontFamily(
const std::string& family);
207 void setTextPointSize(
double psize);
213 void setTextStretch(std::size_t stretch);
215 void setTextUnderline(
bool b);
217 void setTextOverline(
bool b);
219 void setTextStrikeOut(
bool b);
223 void setTextDecorationWidth(
int width);
227 void setTextContourEnabled(
bool b);
229 void setTextContourOpacity(
int opacity);
231 void setTextContourWidth(
int width);
235 void setTextMultiLineSpacing(
int spacing);
239 void setPointWidth(
int w);
245 void setPointPatternRotation(
const double& angle);
247 void setPointPatternOpacity(
int opacity);
255 void setLinePatternRotation(
const double& angle);
257 void setLinePatternOpacity(
int opacity);
261 void setLineDashStyle(
const std::vector<double>& style);
267 void setLineWidth(
int w);
271 void setPolygonFillColor(
const QBrush& color);
279 void setPolygonPatternWidth(
int w);
281 void setPolygonPatternRotation(
const double& angle);
283 void setPolygonPatternOpacity(
int opacity);
289 void setPolygonContourWidth(
int w);
291 void setPolygonContourPatternRotation(
const double& angle);
293 void setPolygonContourPatternOpacity(
int opacity);
297 void setPolygonContourDashStyle(
const std::vector<double>& style);
305 void setNormalMode();
327 void drawText(
const QPoint& p,
328 const std::string& txt,
348 te::gm::Polygon* getTextBoundary(
const QPoint& p,
const std::string& txt,
float angle = 0.0,
361 QPixmap* getPixmap()
const;
372 QImage* getImage()
const;
383 QPaintDevice* getDevice()
const;
391 void setDevice(QPaintDevice* device,
bool takeOwnerShip);
407 void setMatrix(
const QMatrix& matrix);
410 void setRenderHint(QPainter::RenderHint hint,
bool on =
true);
414 QPainter* getPainter();
452 void setLineDashStyle(QPen& pen,
const std::vector<double>& style);
460 void updateAlpha(QImage& img,
const int& opacity);
466 void createPointPatterns();
528 #endif // __TERRALIB_QT_WIDGETS_INTERNAL_CANVAS_H
ImageType
This enum specifies the possible input and output image formats supported by the canvas API...
MultiPolygon is a MultiSurface whose elements are Polygons.
FontWeight
Font weight for drawing text.
LineJustification
Line justification for drawing multi line text.
FontStyle
Font style for drawing text.
A Text may contain 1 or more Text Elements.
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...
MultiPoint is a GeometryCollection whose elements are restricted to points.
LineString is a curve with linear interpolation between points.
HorizontalAlignment
Horizontal alignment for drawing text.
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.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
MultiLineString is a MultiCurve whose elements are LineStrings.
A canvas is an abstraction of a drawing area.
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)...
VerticalAlignment
Vertical alignment for drawing text.
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
It is a collection of other geometric objects.