25 case Qgis::BlendMode::Normal:
26 return QPainter::CompositionMode_SourceOver;
27 case Qgis::BlendMode::Lighten:
28 return QPainter::CompositionMode_Lighten;
29 case Qgis::BlendMode::Screen:
30 return QPainter::CompositionMode_Screen;
31 case Qgis::BlendMode::Dodge:
32 return QPainter::CompositionMode_ColorDodge;
33 case Qgis::BlendMode::Addition:
34 return QPainter::CompositionMode_Plus;
35 case Qgis::BlendMode::Darken:
36 return QPainter::CompositionMode_Darken;
37 case Qgis::BlendMode::Multiply:
38 return QPainter::CompositionMode_Multiply;
39 case Qgis::BlendMode::Burn:
40 return QPainter::CompositionMode_ColorBurn;
41 case Qgis::BlendMode::Overlay:
42 return QPainter::CompositionMode_Overlay;
43 case Qgis::BlendMode::SoftLight:
44 return QPainter::CompositionMode_SoftLight;
45 case Qgis::BlendMode::HardLight:
46 return QPainter::CompositionMode_HardLight;
47 case Qgis::BlendMode::Difference:
48 return QPainter::CompositionMode_Difference;
49 case Qgis::BlendMode::Subtract:
50 return QPainter::CompositionMode_Exclusion;
51 case Qgis::BlendMode::Source:
52 return QPainter::CompositionMode_Source;
53 case Qgis::BlendMode::DestinationOver:
54 return QPainter::CompositionMode_DestinationOver;
55 case Qgis::BlendMode::Clear:
56 return QPainter::CompositionMode_Clear;
57 case Qgis::BlendMode::Destination:
58 return QPainter::CompositionMode_Destination;
59 case Qgis::BlendMode::SourceIn:
60 return QPainter::CompositionMode_SourceIn;
61 case Qgis::BlendMode::DestinationIn:
62 return QPainter::CompositionMode_DestinationIn;
63 case Qgis::BlendMode::SourceOut:
64 return QPainter::CompositionMode_SourceOut;
65 case Qgis::BlendMode::DestinationOut:
66 return QPainter::CompositionMode_DestinationOut;
67 case Qgis::BlendMode::SourceAtop:
68 return QPainter::CompositionMode_SourceAtop;
69 case Qgis::BlendMode::DestinationAtop:
70 return QPainter::CompositionMode_DestinationAtop;
71 case Qgis::BlendMode::Xor:
72 return QPainter::CompositionMode_Xor;
75 return QPainter::CompositionMode_SourceOver;
85 case QPainter::CompositionMode_SourceOver:
86 return Qgis::BlendMode::Normal;
87 case QPainter::CompositionMode_Lighten:
88 return Qgis::BlendMode::Lighten;
89 case QPainter::CompositionMode_Screen:
90 return Qgis::BlendMode::Screen;
91 case QPainter::CompositionMode_ColorDodge:
92 return Qgis::BlendMode::Dodge;
93 case QPainter::CompositionMode_Plus:
94 return Qgis::BlendMode::Addition;
95 case QPainter::CompositionMode_Darken:
96 return Qgis::BlendMode::Darken;
97 case QPainter::CompositionMode_Multiply:
98 return Qgis::BlendMode::Multiply;
99 case QPainter::CompositionMode_ColorBurn:
100 return Qgis::BlendMode::Burn;
101 case QPainter::CompositionMode_Overlay:
102 return Qgis::BlendMode::Overlay;
103 case QPainter::CompositionMode_SoftLight:
104 return Qgis::BlendMode::SoftLight;
105 case QPainter::CompositionMode_HardLight:
106 return Qgis::BlendMode::HardLight;
107 case QPainter::CompositionMode_Difference:
108 return Qgis::BlendMode::Difference;
109 case QPainter::CompositionMode_Exclusion:
110 return Qgis::BlendMode::Subtract;
111 case QPainter::CompositionMode_Source:
112 return Qgis::BlendMode::Source;
113 case QPainter::CompositionMode_DestinationOver:
114 return Qgis::BlendMode::DestinationOver;
115 case QPainter::CompositionMode_Clear:
116 return Qgis::BlendMode::Clear;
117 case QPainter::CompositionMode_Destination:
118 return Qgis::BlendMode::Destination;
119 case QPainter::CompositionMode_SourceIn:
120 return Qgis::BlendMode::SourceIn;
121 case QPainter::CompositionMode_DestinationIn:
122 return Qgis::BlendMode::DestinationIn;
123 case QPainter::CompositionMode_SourceOut:
124 return Qgis::BlendMode::SourceOut;
125 case QPainter::CompositionMode_DestinationOut:
126 return Qgis::BlendMode::DestinationOut;
127 case QPainter::CompositionMode_SourceAtop:
128 return Qgis::BlendMode::SourceAtop;
129 case QPainter::CompositionMode_DestinationAtop:
130 return Qgis::BlendMode::DestinationAtop;
131 case QPainter::CompositionMode_Xor:
132 return Qgis::BlendMode::Xor;
134 QgsDebugError( QStringLiteral(
"Composition mode %1 mapped to Normal" ).arg( blendMode ) );
135 return Qgis::BlendMode::Normal;
143 case Qgis::BlendMode::Normal:
144 case Qgis::BlendMode::Lighten:
145 case Qgis::BlendMode::Screen:
146 case Qgis::BlendMode::Dodge:
147 case Qgis::BlendMode::Addition:
148 case Qgis::BlendMode::Darken:
149 case Qgis::BlendMode::Multiply:
150 case Qgis::BlendMode::Burn:
151 case Qgis::BlendMode::Overlay:
152 case Qgis::BlendMode::SoftLight:
153 case Qgis::BlendMode::HardLight:
154 case Qgis::BlendMode::Difference:
155 case Qgis::BlendMode::Subtract:
156 case Qgis::BlendMode::Source:
157 case Qgis::BlendMode::DestinationOver:
158 case Qgis::BlendMode::Clear:
159 case Qgis::BlendMode::Destination:
162 case Qgis::BlendMode::SourceIn:
163 case Qgis::BlendMode::DestinationIn:
164 case Qgis::BlendMode::SourceOut:
165 case Qgis::BlendMode::DestinationOut:
166 case Qgis::BlendMode::SourceAtop:
167 case Qgis::BlendMode::DestinationAtop:
168 case Qgis::BlendMode::Xor:
BlendMode
Blending modes defining the available composition modes that can be used when painting.
static Qgis::BlendMode getBlendModeEnum(QPainter::CompositionMode blendMode)
Returns a BlendMode corresponding to a QPainter::CompositionMode.
static bool isClippingMode(Qgis::BlendMode mode)
Returns true if mode is a clipping blend mode.
static QPainter::CompositionMode getCompositionMode(Qgis::BlendMode blendMode)
Returns a QPainter::CompositionMode corresponding to a BlendMode.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
#define QgsDebugError(str)