Krita Source Code Documentation
Loading...
Searching...
No Matches
KisMaskingBrushCompositeOpFactory.cpp File Reference
#include "KisMaskingBrushCompositeOpFactory.h"
#include "kis_assert.h"
#include <KoCompositeOpRegistry.h>
#include "KisMaskingBrushCompositeOp.h"
#include <KoConfig.h>

Go to the source code of this file.

Functions

template<bool mask_is_alpha>
KisMaskingBrushCompositeOpBasecreateImpl (const QString &id, KoChannelInfo::enumChannelValueType channelType, int pixelSize, int alphaOffset)
 
template<bool mask_is_alpha, bool use_soft_texturing>
KisMaskingBrushCompositeOpBasecreateImpl (const QString &id, KoChannelInfo::enumChannelValueType channelType, int pixelSize, int alphaOffset, qreal strength)
 

Function Documentation

◆ createImpl() [1/2]

template<bool mask_is_alpha>
KisMaskingBrushCompositeOpBase * createImpl ( const QString & id,
KoChannelInfo::enumChannelValueType channelType,
int pixelSize,
int alphaOffset )

Definition at line 132 of file KisMaskingBrushCompositeOpFactory.cpp.

133{
135
136 switch (channelType) {
138 result = createTypedOp<quint8, mask_is_alpha>(id, pixelSize, alphaOffset);
139 break;
141 result = createTypedOp<quint16, mask_is_alpha>(id, pixelSize, alphaOffset);
142 break;
144 result = createTypedOp<quint32, mask_is_alpha>(id, pixelSize, alphaOffset);
145 break;
146
147#ifdef HAVE_OPENEXR
149 result = createTypedOp<half, mask_is_alpha>(id, pixelSize, alphaOffset);
150 break;
151#endif /* HAVE_OPENEXR */
152
154 result = createTypedOp<float, mask_is_alpha>(id, pixelSize, alphaOffset);
155 break;
157 result = createTypedOp<double, mask_is_alpha>(id, pixelSize, alphaOffset);
158 break;
159// NOTE: we have no color space like that, so it is not supported!
160// case KoChannelInfo::INT8:
161// result = createTypedOp<qint8>(id, pixelSize, alphaOffset);
162// break;
164 result = createTypedOp<qint16, mask_is_alpha>(id, pixelSize, alphaOffset);
165 break;
166 default:
167 KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "Unknown channel type for masked brush!");
168 }
169
170 return result;
171}
@ 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_NOOP(cond)
Definition kis_assert.h:130

References KoChannelInfo::FLOAT16, KoChannelInfo::FLOAT32, KoChannelInfo::FLOAT64, KoChannelInfo::INT16, KIS_SAFE_ASSERT_RECOVER_NOOP, KoChannelInfo::UINT16, KoChannelInfo::UINT32, and KoChannelInfo::UINT8.

◆ createImpl() [2/2]

template<bool mask_is_alpha, bool use_soft_texturing>
KisMaskingBrushCompositeOpBase * createImpl ( const QString & id,
KoChannelInfo::enumChannelValueType channelType,
int pixelSize,
int alphaOffset,
qreal strength )

Definition at line 174 of file KisMaskingBrushCompositeOpFactory.cpp.

175{
177
178 switch (channelType) {
180 result = createTypedOp<quint8, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
181 break;
183 result = createTypedOp<quint16, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
184 break;
186 result = createTypedOp<quint32, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
187 break;
188
189#ifdef HAVE_OPENEXR
191 result = createTypedOp<half, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
192 break;
193#endif /* HAVE_OPENEXR */
194
196 result = createTypedOp<float, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
197 break;
199 result = createTypedOp<double, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
200 break;
202 result = createTypedOp<qint16, mask_is_alpha, use_soft_texturing>(id, pixelSize, alphaOffset, strength);
203 break;
204 default:
205 KIS_SAFE_ASSERT_RECOVER_NOOP(0 && "Unknown channel type for masked brush!");
206 }
207
208 return result;
209}

References KoChannelInfo::FLOAT16, KoChannelInfo::FLOAT32, KoChannelInfo::FLOAT64, KoChannelInfo::INT16, KIS_SAFE_ASSERT_RECOVER_NOOP, KoChannelInfo::UINT16, KoChannelInfo::UINT32, and KoChannelInfo::UINT8.