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);
100 void setWindow(
const double& llx,
const double& lly,
101 const double& urx,
const double& ury);
103 void calcAspectRatio(
double& llx,
double& lly,
double& urx,
double& ury,
116 void resize(
int w,
int h);
118 int getWidth()
const;
120 int getHeight()
const;
140 void save(
const char* fileName,
te::map::ImageType t,
int quality = 75,
int fg = 0)
const;
142 char* getImage(
te::map::ImageType t, std::size_t& size,
int quality = 75,
int fg = 0)
const;
144 te::color::RGBAColor** getImage(
const int x = 0,
const int y = 0,
const int w = 0,
const int h = 0)
const;
146 void freeImage(
char* img)
const;
156 void drawImage(
int x,
int y,
int w,
int h,
char* src, std::size_t size,
te::map::ImageType t);
160 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);
162 void drawImage(
int x,
int y,
int w,
int h,
te::color::RGBAColor** src,
int sx,
int sy,
int sw,
int sh);
166 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);
168 void drawPixel(
int x,
int y);
172 void drawText(
int x,
int y,
173 const std::string& txt,
175 double anchorX = 0.5,
double anchorY = 0.5,
176 int displacementX = 0,
int displacementY = 0);
179 const std::string& txt,
181 double anchorX = 0.5,
double anchorY = 0.5,
182 int displacementX = 0,
int displacementY = 0);
184 void drawText(
const double& x,
const double& y,
185 const std::string& txt,
187 double anchorX = 0.5,
double anchorY = 0.5,
188 int displacementX = 0,
int displacementY = 0);
191 const std::string& txt,
193 double anchorX = 0.5,
double anchorY = 0.5,
194 int displacementX = 0,
int displacementY = 0);
197 const std::string& txt,
199 double anchorX = 0.5,
double anchorY = 0.5,
200 int displacementX = 0,
int displacementY = 0);
203 const std::string& txt,
205 double anchorX = 0.5,
double anchorY = 0.5,
206 int displacementX = 0,
int displacementY = 0);
210 void setTextOpacity(
int opacity);
212 void setFontFamily(
const std::string& family);
214 void setTextPointSize(
double psize);
220 void setTextStretch(std::size_t stretch);
222 void setTextUnderline(
bool b);
224 void setTextOverline(
bool b);
226 void setTextStrikeOut(
bool b);
230 void setTextDecorationWidth(
int width);
234 void setTextContourEnabled(
bool b);
236 void setTextContourOpacity(
int opacity);
238 void setTextContourWidth(
int width);
240 void setTextJustification(
int justType);
242 void setTextMultiLineSpacing(
int spacing);
246 void setPointWidth(
int w);
252 void setPointPatternRotation(
const double& angle);
254 void setPointPatternOpacity(
int opacity);
262 void setLinePatternRotation(
const double& angle);
264 void setLinePatternOpacity(
int opacity);
268 void setLineDashStyle(
const std::vector<double>& style);
274 void setLineWidth(
int w);
278 void setPolygonFillColor(
const QBrush& color);
286 void setPolygonPatternWidth(
int w);
288 void setPolygonPatternRotation(
const double& angle);
290 void setPolygonPatternOpacity(
int opacity);
296 void setPolygonContourWidth(
int w);
298 void setPolygonContourPatternRotation(
const double& angle);
300 void setPolygonContourPatternOpacity(
int opacity);
304 void setPolygonContourDashStyle(
const std::vector<double>& style);
312 void setNormalMode();
336 void drawText(
const QPoint& p,
337 const std::string& txt,
339 double anchorX = 0.5,
double anchorY = 0.5,
340 int displacementX = 0,
int displacementY = 0);
359 te::gm::Polygon* getTextBoundary(
const QPoint& p,
const std::string& txt,
float angle = 0.0,
360 double anchorX = 0.5,
double anchorY = 0.5,
361 int displacementX = 0,
int displacementY = 0);
372 QPixmap* getPixmap()
const;
383 QImage* getImage()
const;
394 QPaintDevice* getDevice()
const;
402 void setDevice(QPaintDevice* device,
bool takeOwnerShip);
418 void setMatrix(
const QMatrix& matrix);
421 void setRenderHint(QPainter::RenderHint hint,
bool on =
true);
425 QPainter* getPainter();
463 void setLineDashStyle(QPen& pen,
const std::vector<double>& style);
471 void updateAlpha(QImage& img,
const int& opacity);
477 void createPointPatterns();
541 #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.
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.
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.
FontStyleType
It defines the style to use for a font.
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)...
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.
FontWeightType
It gives the amount of weight or boldness to use for a font.
It is a collection of other geometric objects.