Skip to content

Commit 14abd45

Browse files
committedSep 2, 2014
Merge pull request #1572 from jef-n/store-blend-mode
Save blendmode/composition mode in project file
2 parents 368755a + 6d4dee9 commit 14abd45

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed
 

‎python/core/qgsmaprenderer.sip

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,18 @@ class QgsMapRenderer : QObject
124124
BlendSoftLight,
125125
BlendHardLight,
126126
BlendDifference,
127-
BlendSubtract
127+
BlendSubtract,
128+
BlendSource,
129+
BlendDestinationOver,
130+
BlendClear,
131+
BlendDestination,
132+
BlendSourceIn,
133+
BlendDestinationIn,
134+
BlendSourceOut,
135+
BlendDestinationOut,
136+
BlendSourceAtop,
137+
BlendDestinationAtop,
138+
BlendXor,
128139
};
129140

130141
//! constructor

‎src/core/qgsmaprenderer.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,30 @@ QPainter::CompositionMode QgsMapRenderer::getCompositionMode( const QgsMapRender
11361136
return QPainter::CompositionMode_Difference;
11371137
case QgsMapRenderer::BlendSubtract:
11381138
return QPainter::CompositionMode_Exclusion;
1139+
case QgsMapRenderer::BlendSource:
1140+
return QPainter::CompositionMode_Source;
1141+
case QgsMapRenderer::BlendDestinationOver:
1142+
return QPainter::CompositionMode_DestinationOver;
1143+
case QgsMapRenderer::BlendClear:
1144+
return QPainter::CompositionMode_Clear;
1145+
case QgsMapRenderer::BlendDestination:
1146+
return QPainter::CompositionMode_Destination;
1147+
case QgsMapRenderer::BlendSourceIn:
1148+
return QPainter::CompositionMode_SourceIn;
1149+
case QgsMapRenderer::BlendDestinationIn:
1150+
return QPainter::CompositionMode_DestinationIn;
1151+
case QgsMapRenderer::BlendSourceOut:
1152+
return QPainter::CompositionMode_SourceOut;
1153+
case QgsMapRenderer::BlendDestinationOut:
1154+
return QPainter::CompositionMode_DestinationOut;
1155+
case QgsMapRenderer::BlendSourceAtop:
1156+
return QPainter::CompositionMode_SourceAtop;
1157+
case QgsMapRenderer::BlendDestinationAtop:
1158+
return QPainter::CompositionMode_DestinationAtop;
1159+
case QgsMapRenderer::BlendXor:
1160+
return QPainter::CompositionMode_Xor;
11391161
default:
1162+
QgsDebugMsg( QString( "Blend mode %1 mapped to SourceOver" ).arg( blendMode ) );
11401163
return QPainter::CompositionMode_SourceOver;
11411164
}
11421165
}
@@ -1172,7 +1195,30 @@ QgsMapRenderer::BlendMode QgsMapRenderer::getBlendModeEnum( const QPainter::Comp
11721195
return QgsMapRenderer::BlendDifference;
11731196
case QPainter::CompositionMode_Exclusion:
11741197
return QgsMapRenderer::BlendSubtract;
1198+
case QPainter::CompositionMode_Source:
1199+
return QgsMapRenderer::BlendSource;
1200+
case QPainter::CompositionMode_DestinationOver:
1201+
return QgsMapRenderer::BlendDestinationOver;
1202+
case QPainter::CompositionMode_Clear:
1203+
return QgsMapRenderer::BlendClear;
1204+
case QPainter::CompositionMode_Destination:
1205+
return QgsMapRenderer::BlendDestination;
1206+
case QPainter::CompositionMode_SourceIn:
1207+
return QgsMapRenderer::BlendSourceIn;
1208+
case QPainter::CompositionMode_DestinationIn:
1209+
return QgsMapRenderer::BlendDestinationIn;
1210+
case QPainter::CompositionMode_SourceOut:
1211+
return QgsMapRenderer::BlendSourceOut;
1212+
case QPainter::CompositionMode_DestinationOut:
1213+
return QgsMapRenderer::BlendDestinationOut;
1214+
case QPainter::CompositionMode_SourceAtop:
1215+
return QgsMapRenderer::BlendSourceAtop;
1216+
case QPainter::CompositionMode_DestinationAtop:
1217+
return QgsMapRenderer::BlendDestinationAtop;
1218+
case QPainter::CompositionMode_Xor:
1219+
return QgsMapRenderer::BlendXor;
11751220
default:
1221+
QgsDebugMsg( QString( "Composition mode %1 mapped to Normal" ).arg( blendMode ) );
11761222
return QgsMapRenderer::BlendNormal;
11771223
}
11781224
}

‎src/core/qgsmaprenderer.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,18 @@ class CORE_EXPORT QgsMapRenderer : public QObject
161161
BlendSoftLight,
162162
BlendHardLight,
163163
BlendDifference,
164-
BlendSubtract
164+
BlendSubtract,
165+
BlendSource,
166+
BlendDestinationOver,
167+
BlendClear,
168+
BlendDestination,
169+
BlendSourceIn,
170+
BlendDestinationIn,
171+
BlendSourceOut,
172+
BlendDestinationOut,
173+
BlendSourceAtop,
174+
BlendDestinationAtop,
175+
BlendXor,
165176
};
166177

167178
//! constructor

0 commit comments

Comments
 (0)
Please sign in to comment.