218 {
220
221 srcAlpha =
mul(srcAlpha, maskAlpha, opacity);
222
223 if(alphaLocked) {
224 if(dstAlpha != zeroValue<channels_type>()) {
225 float srcR = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
red_pos]));
226 float srcG = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
green_pos]));
227 float srcB = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
blue_pos]));
228
229 float dstR = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
red_pos]));
230 float dstG = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
green_pos]));
231 float dstB = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
blue_pos]));
232
233 CompositeOpFunctor::composeChannels(srcR, srcG, srcB, dstR, dstG, dstB);
234
235 if(allChannelFlags || channelFlags.testBit(
red_pos))
237
238 if(allChannelFlags || channelFlags.testBit(
green_pos))
240
241 if(allChannelFlags || channelFlags.testBit(
blue_pos))
243 }
244
245 return dstAlpha;
246 }
247 else {
249
250 if(newDstAlpha != zeroValue<channels_type>()) {
251 float srcR = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
red_pos]));
252 float srcG = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
green_pos]));
253 float srcB = scale<float>(CompositeOpFunctor::clampSourceChannelValue(src[
blue_pos]));
254
255 float dstR = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
red_pos]));
256 float dstG = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
green_pos]));
257 float dstB = scale<float>(CompositeOpFunctor::clampDestinationChannelValue(dst[
blue_pos]));
258
259 CompositeOpFunctor::composeChannels(srcR, srcG, srcB, dstR, dstG, dstB);
260
261 if(allChannelFlags || channelFlags.testBit(
red_pos))
263
264 if(allChannelFlags || channelFlags.testBit(
green_pos))
266
267 if(allChannelFlags || channelFlags.testBit(
blue_pos))
269 }
270
271 return newDstAlpha;
272 }
273 }
QPointF lerp(const QPointF &p1, const QPointF &p2, qreal t)
static const qint32 blue_pos
static const qint32 red_pos
static const qint32 green_pos
Traits::channels_type channels_type
T blend(T src, T srcAlpha, T dst, T dstAlpha, T cfValue)
T unionShapeOpacity(T a, T b)
KoColorSpaceMathsTraits< T >::compositetype div(T a, T b)