QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
Contains miscellaneous painting utility functions. More...
#include <qgspainting.h>
Static Public Member Functions | |
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 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 32 of file qgspainting.h.
|
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 195 of file qgspainting.cpp.
|
static |
Returns a Qgis::BlendMode corresponding to a QPainter::CompositionMode.
Definition at line 81 of file qgspainting.cpp.
|
static |
Returns a QPainter::CompositionMode corresponding to a Qgis::BlendMode.
Definition at line 21 of file qgspainting.cpp.
|
static |
Returns true
if mode is a clipping blend mode.
Definition at line 140 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 175 of file qgspainting.cpp.