28 Node(image, mask, parent)
72 for (
int i = 0; i < colors.size(); i++) {
74 keyStroke.
color = colors[i]->color();
81 keyStrokes.append(keyStroke);
109 if (!this->
node())
return ba;
116 if (kc == keystroke.color) {
122 dev->
readBytes(
reinterpret_cast<quint8*
>(ba.data()), x, y, w, h);
132 if (!this->
node())
return false;
139 if (kc == keystroke.color) {
142 if (!dev)
return false;
144 qWarning() <<
"ColorizeMask::setKeyStrokePixelData: not enough data to write to the paint device";
256 return prop.state.toBool();
280 return prop.state.toBool();
289 return "colorizemask";
float value(const T *src, size_t ch)
bool useEdgeDetection() const
useEdgeDetection
QByteArray keyStrokePixelData(ManagedColor *color, int x, int y, int w, int h) const
keyStrokePixelData reads the given rectangle from the keystroke image data and returns it as a byte a...
void setEditKeyStrokes(bool enabled)
setEditKeyStrokes Toggle Colorize Mask's edit keystrokes mode.
bool showOutput() const
showOutput Show output mode allows the user to see the result of the Colorize Mask's algorithm.
bool editKeyStrokes() const
editKeyStrokes Edit keystrokes mode allows the user to modify keystrokes on the active Colorize Mask.
void setEdgeDetectionSize(qreal value)
setEdgeDetectionSize Set the value to the thinnest line on the image.
int transparencyIndex() const
transparencyIndex Index of the transparent color.
qreal cleanUpAmount() const
cleanUpAmount
qreal edgeDetectionSize() const
edgeDetectionSize
void setShowOutput(bool enabled)
setShowOutput Toggle Colorize Mask's show output mode.
void setCleanUpAmount(qreal value)
setCleanUpAmount This will attempt to handle messy strokes that overlap the line art where they shoul...
QList< ManagedColor * > keyStrokesColors() const
keyStrokesColors Colors used in the Colorize Mask's keystrokes.
bool setKeyStrokePixelData(QByteArray value, ManagedColor *color, int x, int y, int w, int h)
setKeyStrokePixelData writes the given bytes, of which there must be enough, into the keystroke,...
void setLimitToDeviceBounds(bool value)
setLimitToDeviceBounds Limit the colorize mask to the combined layer bounds of the strokes and the li...
void updateMask(bool force=false)
updateMask Process the Colorize Mask's keystrokes and generate a projection of the computed colors.
bool limitToDeviceBounds() const
limitToDeviceBounds
void setUseEdgeDetection(bool value)
setUseEdgeDetection Activate this for line art with large solid areas, for example shadows on an obje...
void initializeKeyStrokeColors(QList< ManagedColor * > colors, int transparentIndex=-1)
initializeKeyStrokeColors Set the colors to use for the Colorize Mask's keystrokes.
virtual QString type() const override
type Krita has several types of nodes, split in layers and masks. Group layers can contain other laye...
void removeKeyStroke(ManagedColor *color)
removeKeyStroke Remove a color from the Colorize Mask's keystrokes.
KisBaseNode::PropertyList sectionModelProperties() const override
bool limitToDeviceBounds() const
qreal cleanUpAmount() const
void setKeyStrokesDirect(const QList< KisLazyFillTools::KeyStroke > &strokes)
void setEdgeDetectionSize(qreal value)
void setLimitToDeviceBounds(bool value)
void setUseEdgeDetection(bool value)
void initializeCompositeOp()
bool useEdgeDetection() const
void removeKeyStroke(const KoColor &color)
KUndo2Command * setColorSpace(const KoColorSpace *dstColorSpace, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags(), KoUpdater *progressUpdater=nullptr)
KeyStrokeColors keyStrokesColors() const
QList< KisLazyFillTools::KeyStroke > fetchKeyStrokesDirect() const
void setCleanUpAmount(qreal value)
qreal edgeDetectionSize() const
void forceRegenerateMask()
static const KoID colorizeEditKeyStrokes
static void setNodePropertyAutoUndo(KisNodeSP node, const KoID &id, const QVariant &value, KisImageSP image)
static const KoID colorizeShowColoring
static const KoID colorizeNeedsUpdate
quint32 pixelSize() const
void setDefaultBounds(KisDefaultBoundsBaseSP bounds)
const KoColorSpace * colorSpace() const
void readBytes(quint8 *data, qint32 x, qint32 y, qint32 w, qint32 h) const
void writeBytes(const quint8 *data, qint32 x, qint32 y, qint32 w, qint32 h)
virtual quint32 pixelSize() const =0
The ManagedColor class is a class to handle colors that are color managed. A managed color is a color...
friend class ColorizeMask
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
virtual const KoColorSpace * colorSpace() const =0
QVector< KoColor > colors
static KoColorSpaceRegistry * instance()