QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
Contains miscellaneous painting utility functions. More...
#include <qgspainting.h>
Static Public Member Functions | |
static void | applyScaleFixForQPictureDpi (QPainter *painter) |
Applies a workaround to a painter to avoid an issue with incorrect scaling when drawing QPictures. | |
static void | drawPicture (QPainter *painter, const QPointF &point, const QPicture &picture) |
Draws a picture onto a painter, correctly applying workarounds to avoid issues with incorrect scaling. | |
static bool | drawTriangleUsingTexture (QPainter *painter, const QPolygonF &triangle, const QImage &textureImage, float textureX1, float textureY1, float textureX2, float textureY2, float textureX3, float textureY3) |
Draws a triangle onto a painter using a mapped texture image. | |
static Qgis::BlendMode | getBlendModeEnum (QPainter::CompositionMode blendMode) |
Returns a Qgis::BlendMode corresponding to a QPainter::CompositionMode. | |
static QPainter::CompositionMode | getCompositionMode (Qgis::BlendMode blendMode) |
Returns a QPainter::CompositionMode corresponding to a Qgis::BlendMode. | |
static bool | isClippingMode (Qgis::BlendMode mode) |
Returns true if mode is a clipping blend mode. | |
static int | qtDefaultDpiX () |
Returns the default Qt horizontal DPI. | |
static int | qtDefaultDpiY () |
Returns the default Qt vertical DPI. | |
static QTransform | triangleToTriangleTransform (double inX1, double inY1, double inX2, double inY2, double inX3, double inY3, double outX1, double outY1, double outX2, double outY2, double outX3, double outY3, bool &ok) |
Calculates the QTransform which maps the triangle defined by the points (inX1, inY1), (inY2, inY2), (inX3, inY3) to the triangle defined by (outX1, outY1), (outY2, outY2), (outX3, outY3). | |
Contains miscellaneous painting utility functions.
Definition at line 31 of file qgspainting.h.
|
static |
Applies a workaround to a painter to avoid an issue with incorrect scaling when drawing QPictures.
Definition at line 236 of file qgspainting.cpp.
|
static |
Draws a picture onto a painter, correctly applying workarounds to avoid issues with incorrect scaling.
Definition at line 246 of file qgspainting.cpp.
|
static |
Draws a triangle onto a painter using a mapped texture image.
The triangle will be rendered using the portion of the texture image described by the triangle (textureX1, textureY1), (textureX2, textureY2), (textureX3, textureY3). Texture coordinates should be in the range 0-1 (as a fraction of the image size), where (0, 0) coorresponds to the top-left of the texture image.
The caller must ensure that triangle is a closed QPolygonF consisting of 4 vertices (the 3 triangle vertices + the first vertex again to close the polygon).
Returns true
if the triangle could be rendered, or false
if it could not (e.g. when the described points are co-linear).
Definition at line 198 of file qgspainting.cpp.
|
static |
Returns a Qgis::BlendMode corresponding to a QPainter::CompositionMode.
Definition at line 84 of file qgspainting.cpp.
|
static |
Returns a QPainter::CompositionMode corresponding to a Qgis::BlendMode.
Definition at line 24 of file qgspainting.cpp.
|
static |
Returns true
if mode is a clipping blend mode.
Definition at line 143 of file qgspainting.cpp.
|
static |
Returns the default Qt horizontal DPI.
Definition at line 226 of file qgspainting.cpp.
|
static |
Returns the default Qt vertical DPI.
Definition at line 231 of file qgspainting.cpp.
|
static |
Calculates the QTransform which maps the triangle defined by the points (inX1, inY1), (inY2, inY2), (inX3, inY3) to the triangle defined by (outX1, outY1), (outY2, outY2), (outX3, outY3).
inX1 | source triangle vertex 1 x-coordinate |
inY1 | source triangle vertex 1 y-coordinate |
inX2 | source triangle vertex 2 x-coordinate |
inY2 | source triangle vertex 2 y-coordinate |
inX3 | source triangle vertex 3 x-coordinate |
inY3 | source triangle vertex 3 y-coordinate |
outX1 | destination triangle vertex 1 x-coordinate |
outY1 | destination triangle vertex 1 y-coordinate |
outX2 | destination triangle vertex 2 x-coordinate |
outY2 | destination triangle vertex 2 y-coordinate |
outX3 | destination triangle vertex 3 x-coordinate |
outY3 | destination triangle vertex 3 y-coordinate |
ok | will be set to true if the transform could be determined. |
Definition at line 178 of file qgspainting.cpp.