|
Krita Source Code Documentation
|
#include <kis_colorize_mask.h>
Inheritance diagram for KisColorizeMask:Classes | |
| struct | KeyStrokeColors |
| struct | Private |
Signals | |
| void | sigKeyStrokesListChanged () |
| void | sigUpdateOnDirtyParent () const |
Signals inherited from KisNode | |
| void | sigNodeChangedInternal () |
Signals inherited from KisBaseNode | |
| void | keyframeChannelAdded (KisKeyframeChannel *channel) |
| void | opacityChanged (quint8 value) |
Private Slots | |
| void | slotRecalculatePrefilteredImage () |
| void | slotRegenerationCancelled () |
| void | slotRegenerationFinished (bool prefilterOnly) |
| void | slotUpdateOnDirtyParent () |
| void | slotUpdateRegenerateFilling (bool prefilterOnly=false) |
Private Member Functions | |
| template<class DeviceMetricPolicy > | |
| QRect | calculateMaskBounds (DeviceMetricPolicy policy) const |
| void | mergeToLayerUnthreaded (KisNodeSP layer, KUndo2Command *parentCommand, const KUndo2MagicString &transactionText, int timedID) |
| void | moveAllInternalDevices (const QPoint &diff) |
| bool | needsUpdate () const |
| void | rerenderFakePaintDevice () |
| void | setNeedsUpdate (bool value) |
| void | setShowColoring (bool value) |
| void | setShowKeyStrokes (bool value) |
| bool | showColoring () const |
| bool | showKeyStrokes () const |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
Friends | |
| struct | KeyStrokeAddRemoveCommand |
| struct | SetKeyStrokeColorsCommand |
| struct | SetKeyStrokesColorSpaceCommand |
Definition at line 26 of file kis_colorize_mask.h.
| KisColorizeMask::KisColorizeMask | ( | KisImageWSP | image, |
| const QString & | name ) |
Definition at line 138 of file kis_colorize_mask.cpp.
References connect(), m_d, sigUpdateOnDirtyParent(), slotRecalculatePrefilteredImage(), slotUpdateOnDirtyParent(), and slotUpdateRegenerateFilling().
|
override |
Definition at line 161 of file kis_colorize_mask.cpp.
| KisColorizeMask::KisColorizeMask | ( | const KisColorizeMask & | rhs | ) |
Definition at line 165 of file kis_colorize_mask.cpp.
References connect(), m_d, sigUpdateOnDirtyParent(), slotUpdateOnDirtyParent(), and slotUpdateRegenerateFilling().
|
overridevirtual |
Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisNodeVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.
return false if the visitor could not successfully act on this node instance.
Reimplemented from KisBaseNode.
Definition at line 487 of file kis_colorize_mask.cpp.
References v.
|
overridevirtual |
Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisProcessingVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.
The processing visitor differs from node visitor in the way that it accepts undo adapter, that allows the processing to be multithreaded
Reimplemented from KisBaseNode.
Definition at line 492 of file kis_colorize_mask.cpp.
References KisProcessingVisitor::visit().
| QVector< KisPaintDeviceSP > KisColorizeMask::allPaintDevices | ( | ) | const |
Definition at line 979 of file kis_colorize_mask.cpp.
References KisLazyFillTools::KeyStroke::dev, and m_d.
|
private |
Definition at line 619 of file kis_colorize_mask.cpp.
References KisLazyFillTools::KeyStroke::dev, m_d, and KisIndirectPaintingSupport::temporaryTarget.
| qreal KisColorizeMask::cleanUpAmount | ( | ) | const |
Definition at line 1045 of file kis_colorize_mask.cpp.
References m_d.
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 57 of file kis_colorize_mask.h.
| KisPaintDeviceSP KisColorizeMask::coloringProjection | ( | ) | const |
Definition at line 469 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 474 of file kis_colorize_mask.cpp.
References KisPaintDevice::extent(), m_d, and KisMask::projection().
|
overridevirtual |
|
overridevirtual |
Reimplemented from KisMask.
Definition at line 513 of file kis_colorize_mask.cpp.
References KisPainter::bitBlt(), KisLazyFillTools::KeyStroke::color, COMPOSITE_ERASE, KisBaseNode::compositeOpId(), KisPixelSelection::copyAlphaFrom(), KisLazyFillTools::KeyStroke::dev, KisPaintDevice::extent(), KisFillPainter::fillSelection(), KIS_ASSERT, m_d, KisPaintDevice::makeCloneFromRough(), KisNode::N_ABOVE_FILTHY, KisBaseNode::opacity(), KisSelection::pixelSelection, s1, s2, KisPixelSelection::selectedRect(), KisMask::selection, KisPainter::setCompositeOpId(), KisPainter::setOpacityF(), KisPainter::setOpacityToUnit(), KisPainter::setOpacityU8(), KisPainter::setSelection(), KisIndirectPaintingSupport::setupTemporaryPainter(), sigUpdateOnDirtyParent(), KisIndirectPaintingSupport::temporaryCompositeOp(), and KisIndirectPaintingSupport::temporaryTarget.
| qreal KisColorizeMask::edgeDetectionSize | ( | ) | const |
Definition at line 1022 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Returns the exact bounds of where the actual data resides in this node.
Reimplemented from KisBaseNode.
Definition at line 653 of file kis_colorize_mask.cpp.
References calculateMaskBounds().
|
overridevirtual |
Returns an approximation of where the bounds on actual data are in this node.
Reimplemented from KisBaseNode.
Definition at line 648 of file kis_colorize_mask.cpp.
References calculateMaskBounds().
Definition at line 1095 of file kis_colorize_mask.cpp.
References m_d.
| void KisColorizeMask::forceRegenerateMask | ( | ) |
Definition at line 1084 of file kis_colorize_mask.cpp.
References m_d, and slotUpdateRegenerateFilling().
| qreal KisColorizeMask::fuzzyRadius | ( | ) | const |
Definition at line 1034 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisNode.
Definition at line 1136 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 481 of file kis_colorize_mask.cpp.
References KisIconUtils::loadIcon().
| void KisColorizeMask::initializeCompositeOp | ( | ) |
Definition at line 183 of file kis_colorize_mask.cpp.
References KisImage::bounds(), COMPOSITE_BEHIND, COMPOSITE_MULT, KritaUtils::estimatePortionOfTransparentPixels(), KisBaseNode::image, KisLayer::original(), KisNode::parent, and KisBaseNode::setCompositeOpId().
| KisColorizeMask::KeyStrokeColors KisColorizeMask::keyStrokesColors | ( | ) | const |
Definition at line 884 of file kis_colorize_mask.cpp.
References KisColorizeMask::KeyStrokeColors::colors, m_d, and KisColorizeMask::KeyStrokeColors::transparentIndex.
| bool KisColorizeMask::limitToDeviceBounds | ( | ) | const |
Definition at line 1057 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisIndirectPaintingSupport.
Definition at line 736 of file kis_colorize_mask.cpp.
References KritaUtils::addJobSequential(), and mergeToLayerUnthreaded().
|
private |
Add a new key stroke plane
When erasing, the brush affects all the key strokes, not only the current one.
When merging, we use barrier jobs only for ensuring that the merge jobs are not split by the update jobs. Merge jobs hold the shared lock, so forcing them out of CPU will basically cause a deadlock. When running in the fake executor, the jobs cannot be split anyway, so there is no danger in that.
Try removing the key strokes that has been completely erased
Definition at line 747 of file kis_colorize_mask.cpp.
References KisFakeRunnableStrokeJobsExecutor::addRunnableJobs(), KisFakeRunnableStrokeJobsExecutor::AllowBarrierJobs, COMPOSITE_ERASE, KisLazyFillTools::KeyStroke::dev, KisPaintDevice::exactBounds(), KisPaintDevice::extent(), KisNode::index(), KeyStrokeAddRemoveCommand, m_d, KisIndirectPaintingSupport::mergeToLayerImpl(), KisIndirectPaintingSupport::releaseResources(), KisIndirectPaintingSupport::temporaryCompositeOp(), and KisIndirectPaintingSupport::temporaryTarget.
|
private |
Definition at line 1165 of file kis_colorize_mask.cpp.
References allPaintDevices(), KisPaintDevice::moveTo(), and KisPaintDevice::offset().
|
private |
Definition at line 292 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Colorize mask has its own "projection", so it should report it to the parent layer using non-dependent-extent property
Reimplemented from KisMask.
Definition at line 658 of file kis_colorize_mask.cpp.
References extent().
|
overridevirtual |
Return the paintdevice you can use to change pixels on. For a paint layer these will be paint pixels, for an adjustment layer or a mask the selection paint device.
Implements KisBaseNode.
Definition at line 464 of file kis_colorize_mask.cpp.
References m_d.
| void KisColorizeMask::regeneratePrefilteredDeviceIfNeeded | ( | ) |
Definition at line 1152 of file kis_colorize_mask.cpp.
References KIS_ASSERT_RECOVER_RETURN, m_d, KisBaseNode::original(), KisNode::parent, and slotUpdateRegenerateFilling().
Definition at line 953 of file kis_colorize_mask.cpp.
References KisProcessingApplicator::applyCommand(), KisLazyFillTools::KeyStroke::color, colorSpace(), KoColor::convertTo(), KisProcessingApplicator::end(), KisBaseNode::image, KisNode::index(), KeyStrokeAddRemoveCommand, KIS_SAFE_ASSERT_RECOVER_RETURN, kundo2_i18n(), m_d, kismpl::mem_equal_to(), and KisProcessingApplicator::NONE.
|
private |
Definition at line 1062 of file kis_colorize_mask.cpp.
References KisLazyFillTools::KeyStroke::color, KisLazyFillTools::KeyStroke::dev, KisPaintDevice::extent(), KisFillPainter::fillSelection(), m_d, KisPaintDevice::makeCloneFromRough(), KisSelection::pixelSelection, s1, KisMask::selection, and KisPainter::setSelection().
| void KisColorizeMask::resetCache | ( | ) |
Definition at line 993 of file kis_colorize_mask.cpp.
References m_d, rerenderFakePaintDevice(), and slotUpdateRegenerateFilling().
|
overridevirtual |
Return a the properties of this base node (locked, visible etc, with the right icons for their representation and their state.
Subclasses can extend this list with new properties, like opacity for layers or visualized for masks.
The order of properties is, unfortunately, for now, important, so take care which properties superclasses of your class define.
KisBaseNode defines visible = 0, locked = 1 KisLayer defines opacity = 2, compositeOp = 3 KisMask defines active = 2 (KisMask does not inherit kislayer)
Reimplemented from KisBaseNode.
Definition at line 431 of file kis_colorize_mask.cpp.
References KisLayerPropertiesIcons::colorizeEditKeyStrokes, KisLayerPropertiesIcons::colorizeNeedsUpdate, KisLayerPropertiesIcons::colorizeShowColoring, KisLayerPropertiesIcons::getProperty(), needsUpdate(), KisBaseNode::sectionModelProperties(), showColoring(), and showKeyStrokes().
| void KisColorizeMask::setCleanUpAmount | ( | qreal | value | ) |
Definition at line 1039 of file kis_colorize_mask.cpp.
References m_d, setNeedsUpdate(), and value().
| KUndo2Command * KisColorizeMask::setColorSpace | ( | const KoColorSpace * | dstColorSpace, |
| KoColorConversionTransformation::Intent | renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
| KoColorConversionTransformation::ConversionFlags | conversionFlags = KoColorConversionTransformation::internalConversionFlags(), | ||
| KoUpdater * | progressUpdater = nullptr ) |
Definition at line 269 of file kis_colorize_mask.cpp.
References KisCommandUtils::CompositeCommand::addCommand(), m_d, KUndo2Command::redo(), and SetKeyStrokesColorSpaceCommand.
Reimplemented from KisIndirectPaintingSupport.
Definition at line 677 of file kis_colorize_mask.cpp.
References KisLazyFillTools::KeyStroke::color, colorSpace(), KoColor::convertTo(), KisBaseNode::image, KoColorSpaceRegistry::instance(), m_d, kismpl::mem_equal_to(), KisPaintDevice::setDefaultBounds(), and KisPaintDevice::setParentNode().
| void KisColorizeMask::setEdgeDetectionSize | ( | qreal | value | ) |
Definition at line 1015 of file kis_colorize_mask.cpp.
References m_d, setNeedsUpdate(), and value().
| void KisColorizeMask::setFuzzyRadius | ( | qreal | value | ) |
Definition at line 1027 of file kis_colorize_mask.cpp.
References m_d, setNeedsUpdate(), and value().
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 663 of file kis_colorize_mask.cpp.
References bounds, KisBaseNode::image, and m_d.
| void KisColorizeMask::setKeyStrokesColors | ( | KeyStrokeColors | colors | ) |
Definition at line 930 of file kis_colorize_mask.cpp.
References KisProcessingApplicator::applyCommand(), KisColorizeMask::KeyStrokeColors::colors, colorSpace(), KisProcessingApplicator::end(), KisBaseNode::image, KIS_ASSERT_RECOVER_RETURN, kundo2_i18n(), m_d, KisProcessingApplicator::NONE, SetKeyStrokeColorsCommand, and KisColorizeMask::KeyStrokeColors::transparentIndex.
| void KisColorizeMask::setKeyStrokesDirect | ( | const QList< KisLazyFillTools::KeyStroke > & | strokes | ) |
Definition at line 1100 of file kis_colorize_mask.cpp.
References KisBaseNode::image, KIS_SAFE_ASSERT_RECOVER, and m_d.
| void KisColorizeMask::setLimitToDeviceBounds | ( | bool | value | ) |
Definition at line 1050 of file kis_colorize_mask.cpp.
References m_d, setNeedsUpdate(), and value().
|
private |
| void KisColorizeMask::setProfile | ( | const KoColorProfile * | profile, |
| KUndo2Command * | parentCommand ) |
Definition at line 259 of file kis_colorize_mask.cpp.
References m_d, and setProfile().
|
overridevirtual |
Change the section model properties.
Reimplemented from KisBaseNode.
Definition at line 441 of file kis_colorize_mask.cpp.
References KisLayerPropertiesIcons::colorizeEditKeyStrokes, KisLayerPropertiesIcons::colorizeNeedsUpdate, KisLayerPropertiesIcons::colorizeShowColoring, KoID::id(), KisBaseNode::Property::id, m_d, KisBaseNode::properties, setNeedsUpdate(), KisBaseNode::setSectionModelProperties(), setShowColoring(), setShowKeyStrokes(), and KisBaseNode::Property::state.
|
private |
Definition at line 847 of file kis_colorize_mask.cpp.
References KisMask::baseNodeChangedCallback(), extent(), m_d, KisNode::setDirty(), and value().
|
private |
Definition at line 867 of file kis_colorize_mask.cpp.
References KisMask::baseNodeChangedCallback(), extent(), m_d, regeneratePrefilteredDeviceIfNeeded(), KisNode::setDirty(), and value().
| void KisColorizeMask::setUseEdgeDetection | ( | bool | value | ) |
Definition at line 1003 of file kis_colorize_mask.cpp.
References m_d, setNeedsUpdate(), and value().
|
overridevirtual |
Set the x offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.
Reimplemented from KisBaseNode.
Definition at line 1122 of file kis_colorize_mask.cpp.
References m_d, moveAllInternalDevices(), and x().
|
overridevirtual |
Set the y offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.
Reimplemented from KisBaseNode.
Definition at line 1129 of file kis_colorize_mask.cpp.
References m_d, moveAllInternalDevices(), and y().
|
private |
Definition at line 842 of file kis_colorize_mask.cpp.
References m_d.
|
private |
Definition at line 862 of file kis_colorize_mask.cpp.
References m_d.
|
signal |
|
signal |
|
privateslot |
Definition at line 401 of file kis_colorize_mask.cpp.
References slotUpdateRegenerateFilling().
|
privateslot |
Definition at line 425 of file kis_colorize_mask.cpp.
References m_d, and slotRegenerationFinished().
|
privateslot |
Definition at line 406 of file kis_colorize_mask.cpp.
References extent(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, and KisNode::setDirty().
|
privateslot |
Definition at line 377 of file kis_colorize_mask.cpp.
References extent(), KIS_ASSERT_RECOVER_RETURN, m_d, KisBaseNode::original(), KisNode::parent, and KisNode::setDirty().
|
privateslot |
Definition at line 314 of file kis_colorize_mask.cpp.
References KisColorizeStrokeStrategy::addKeyStroke(), KisImage::bounds(), KisLazyFillTools::KeyStroke::color, KoColor::colorSpace(), connect(), KoColor::createTransparent(), KisLazyFillTools::KeyStroke::dev, KisImage::endStroke(), KisPaintDevice::exactBounds(), extent(), KisBaseNode::image, KisLazyFillTools::KeyStroke::isTransparent, KIS_ASSERT_RECOVER_RETURN, m_d, KisBaseNode::original(), KisNode::parent, KisColorizeStrokeStrategy::setFilteringOptions(), slotRegenerationCancelled(), slotRegenerationFinished(), and KisImage::startStroke().
|
overridevirtual |
Reimplemented from KisIndirectPaintingSupport.
Definition at line 837 of file kis_colorize_mask.cpp.
| void KisColorizeMask::testingAddKeyStroke | ( | KisPaintDeviceSP | dev, |
| const KoColor & | color, | ||
| bool | isTransparent = false ) |
Definition at line 1079 of file kis_colorize_mask.cpp.
References m_d.
| KisPaintDeviceSP KisColorizeMask::testingFilteredSource | ( | ) | const |
Definition at line 1090 of file kis_colorize_mask.cpp.
References m_d.
| bool KisColorizeMask::useEdgeDetection | ( | ) | const |
Definition at line 1010 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisIndirectPaintingSupport.
Definition at line 821 of file kis_colorize_mask.cpp.
References KoColorSpaceRegistry::alpha8(), KisPainter::bitBlt(), KisPaintDevice::colorSpace(), KisPixelSelection::copyAlphaFrom(), KisPainter::device, KoColorSpaceRegistry::instance(), m_d, and s1.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 1112 of file kis_colorize_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 1117 of file kis_colorize_mask.cpp.
References m_d.
|
friend |
Definition at line 164 of file kis_colorize_mask.h.
|
friend |
Definition at line 165 of file kis_colorize_mask.h.
|
friend |
Definition at line 163 of file kis_colorize_mask.h.
|
private |
Definition at line 169 of file kis_colorize_mask.h.