24template <
typename channel_type,
bool mask_is_alpha = false>
58template <
typename channel_type,
bool mask_is_alpha = false,
bool use_soft_texturing = false>
65 mask_is_alpha,
true, use_soft_texturing>
66 (pixelSize, alphaOffset, strength);
69 mask_is_alpha,
true, use_soft_texturing>
70 (pixelSize, alphaOffset, strength);
73 mask_is_alpha,
true, use_soft_texturing>
74 (pixelSize, alphaOffset, strength);
77 mask_is_alpha,
true, use_soft_texturing>
78 (pixelSize, alphaOffset, strength);
81 mask_is_alpha,
true, use_soft_texturing>
82 (pixelSize, alphaOffset, strength);
85 mask_is_alpha,
true, use_soft_texturing>
86 (pixelSize, alphaOffset, strength);
89 mask_is_alpha,
true, use_soft_texturing>
90 (pixelSize, alphaOffset, strength);
93 mask_is_alpha,
true, use_soft_texturing>
94 (pixelSize, alphaOffset, strength);
97 mask_is_alpha,
true, use_soft_texturing>
98 (pixelSize, alphaOffset, strength);
101 mask_is_alpha,
true, use_soft_texturing>
102 (pixelSize, alphaOffset, strength);
104 }
else if (
id ==
"height") {
106 mask_is_alpha,
true, use_soft_texturing>
107 (pixelSize, alphaOffset, strength);
108 }
else if (
id ==
"linear_height") {
110 mask_is_alpha,
true, use_soft_texturing>
111 (pixelSize, alphaOffset, strength);
112 }
else if (
id ==
"height_photoshop") {
114 mask_is_alpha,
true, use_soft_texturing>
115 (pixelSize, alphaOffset, strength);
116 }
else if (
id ==
"linear_height_photoshop") {
118 mask_is_alpha,
true, use_soft_texturing>
119 (pixelSize, alphaOffset, strength);
131template <
bool mask_is_alpha>
136 switch (channelType) {
138 result = createTypedOp<quint8, mask_is_alpha>(
id, pixelSize, alphaOffset);
141 result = createTypedOp<quint16, mask_is_alpha>(
id, pixelSize, alphaOffset);
144 result = createTypedOp<quint32, mask_is_alpha>(
id, pixelSize, alphaOffset);
149 result = createTypedOp<half, mask_is_alpha>(
id, pixelSize, alphaOffset);
154 result = createTypedOp<float, mask_is_alpha>(
id, pixelSize, alphaOffset);
157 result = createTypedOp<double, mask_is_alpha>(
id, pixelSize, alphaOffset);
164 result = createTypedOp<qint16, mask_is_alpha>(
id, pixelSize, alphaOffset);
173template <
bool mask_is_alpha,
bool use_soft_texturing>
178 switch (channelType) {
180 result = createTypedOp<quint8, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
183 result = createTypedOp<quint16, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
186 result = createTypedOp<quint32, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
191 result = createTypedOp<half, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
196 result = createTypedOp<float, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
199 result = createTypedOp<double, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
202 result = createTypedOp<qint16, mask_is_alpha, use_soft_texturing>(
id, pixelSize, alphaOffset, strength);
213 int pixelSize,
int alphaOffset)
215 return createImpl<false>(
id, channelType, pixelSize, alphaOffset);
220 int pixelSize,
int alphaOffset, qreal strength,
bool useSoftTexturing)
222 if (useSoftTexturing) {
223 return createImpl<false, true>(
id, channelType, pixelSize, alphaOffset, strength);
225 return createImpl<false, false>(
id, channelType, pixelSize, alphaOffset, strength);
231 int pixelSize,
int alphaOffset)
233 return createImpl<true>(
id, channelType, pixelSize, alphaOffset);
238 int pixelSize,
int alphaOffset, qreal strength,
bool useSoftTexturing)
240 if (useSoftTexturing) {
241 return createImpl<true, true>(
id, channelType, pixelSize, alphaOffset, strength);
243 return createImpl<true, false>(
id, channelType, pixelSize, alphaOffset, strength);
KisMaskingBrushCompositeOpBase * createImpl(const QString &id, KoChannelInfo::enumChannelValueType channelType, int pixelSize, int alphaOffset)
@ KIS_MASKING_BRUSH_COMPOSITE_BURN
@ KIS_MASKING_BRUSH_COMPOSITE_LINEAR_HEIGHT_PHOTOSHOP
@ KIS_MASKING_BRUSH_COMPOSITE_SUBTRACT
@ KIS_MASKING_BRUSH_COMPOSITE_HEIGHT
@ KIS_MASKING_BRUSH_COMPOSITE_DODGE
@ KIS_MASKING_BRUSH_COMPOSITE_LINEAR_DODGE
@ KIS_MASKING_BRUSH_COMPOSITE_MULT
@ KIS_MASKING_BRUSH_COMPOSITE_OVERLAY
@ KIS_MASKING_BRUSH_COMPOSITE_HARD_MIX_SOFTER_PHOTOSHOP
@ KIS_MASKING_BRUSH_COMPOSITE_HARD_MIX_PHOTOSHOP
@ KIS_MASKING_BRUSH_COMPOSITE_DARKEN
@ KIS_MASKING_BRUSH_COMPOSITE_HEIGHT_PHOTOSHOP
@ KIS_MASKING_BRUSH_COMPOSITE_LINEAR_HEIGHT
@ KIS_MASKING_BRUSH_COMPOSITE_LINEAR_BURN
const QString COMPOSITE_DARKEN
const QString COMPOSITE_OVERLAY
const QString COMPOSITE_DODGE
const QString COMPOSITE_LINEAR_BURN
const QString COMPOSITE_MULT
const QString COMPOSITE_SUBTRACT
const QString COMPOSITE_BURN
const QString COMPOSITE_LINEAR_DODGE
const QString COMPOSITE_HARD_MIX_SOFTER_PHOTOSHOP
const QString COMPOSITE_HARD_MIX_PHOTOSHOP
static KisMaskingBrushCompositeOpBase * createForAlphaSrc(const QString &id, KoChannelInfo::enumChannelValueType channelType, int pixelSize, int alphaOffset)
static QStringList supportedCompositeOpIds()
static KisMaskingBrushCompositeOpBase * create(const QString &id, KoChannelInfo::enumChannelValueType channelType, int pixelSize, int alphaOffset)
enumChannelValueType
enum to define the value of the channel
@ UINT8
use this for an unsigned integer 8bits channel
@ UINT16
use this for an integer 16bits channel
@ INT16
use this for an integer 16bits channel
@ FLOAT32
use this for a float 32bits channel
@ FLOAT16
use this for a float 16bits channel
@ UINT32
use this for an unsigned integer 21bits channel
@ FLOAT64
use this for a float 64bits channel
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)