QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgspainting.h
Go to the documentation of this file.
1/***************************************************************************
2 qgspainting.h
3 ---------------------
4 begin : July 2016
5 copyright : (C) 2016 by Martin Dobias
6 email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15#ifndef QGSPAINTING_H
16#define QGSPAINTING_H
17
18#include "qgis.h"
19#include "qgis_core.h"
20#include "qgis_sip.h"
21
22#include <QPainter>
23
24class QTransform;
25
31class CORE_EXPORT QgsPainting
32{
33 public:
34
40 static QPainter::CompositionMode getCompositionMode( Qgis::BlendMode blendMode );
41
47 static Qgis::BlendMode getBlendModeEnum( QPainter::CompositionMode blendMode );
48
54 static bool isClippingMode( Qgis::BlendMode mode );
55
78 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 SIP_OUT );
79
92 static bool drawTriangleUsingTexture(
93 QPainter *painter,
94 const QPolygonF &triangle,
95 const QImage &textureImage,
96 float textureX1, float textureY1,
97 float textureX2, float textureY2,
98 float textureX3, float textureY3
99 );
100
109 static int qtDefaultDpiX();
110
119 static int qtDefaultDpiY();
120
132 static void applyScaleFixForQPictureDpi( QPainter *painter );
133
141 static void drawPicture( QPainter *painter, const QPointF &point, const QPicture &picture );
142};
143
144#endif // QGSPAINTING_H
BlendMode
Blending modes defining the available composition modes that can be used when painting.
Definition qgis.h:4930
Contains miscellaneous painting utility functions.
Definition qgspainting.h:32
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 int qtDefaultDpiY()
Returns the default Qt vertical DPI.
static Qgis::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a Qgis::BlendMode corresponding to a QPainter::CompositionMode.
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 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),...
static QPainter::CompositionMode getCompositionMode(Qgis::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a Qgis::BlendMode.
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...
#define SIP_OUT
Definition qgis_sip.h:58