|
Krita Source Code Documentation
|
Namespaces | |
| namespace | Private |
Typedefs | |
| typedef QSharedPointer< ConvertToPaintLayerInfo > | ConvertToPaintLayerInfoSP |
| typedef QMap< int, QSet< KisNodeSP > > | FrameJobs |
| typedef QSharedPointer< MergeDownInfoBase > | MergeDownInfoBaseSP |
| typedef QSharedPointer< MergeDownInfo > | MergeDownInfoSP |
| typedef QSharedPointer< MergeMultipleInfo > | MergeMultipleInfoSP |
| typedef QSharedPointer< SplitAlphaToMaskInfo > | SplitAlphaToMaskInfoSP |
Enumerations | |
| enum | MergeFlag { None , SkipMergingFrames = 0x1 } |
Definition at line 364 of file kis_layer_utils.cpp.
| typedef QMap<int, QSet<KisNodeSP> > KisLayerUtils::FrameJobs |
Definition at line 94 of file kis_layer_utils.h.
Definition at line 360 of file kis_layer_utils.cpp.
Definition at line 361 of file kis_layer_utils.cpp.
Definition at line 362 of file kis_layer_utils.cpp.
Definition at line 363 of file kis_layer_utils.cpp.
| Enumerator | |
|---|---|
| None | |
| SkipMergingFrames | |
Definition at line 31 of file kis_layer_utils.h.
Definition at line 1709 of file kis_layer_utils.cpp.
References KisBaseNode::name(), and KisBaseNode::setName().
| KRITAIMAGE_EXPORT bool KisLayerUtils::canChangeImageProfileInvisibly | ( | KisImageSP | image | ) |
Definition at line 2341 of file kis_layer_utils.cpp.
References COMPOSITE_OVER, KisBaseNode::compositeOpId(), recursiveApplyNodes(), and KisNodeFacade::root.
| KRITAIMAGE_EXPORT void KisLayerUtils::changeImageDefaultProjectionColor | ( | KisImageSP | image, |
| const KoColor & | color ) |
Definition at line 1784 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::BARRIER, KisCommandUtils::ChangeProjectionColorCommand, KisProcessingApplicator::end(), KisStrokeJobData::EXCLUSIVE, kundo2_i18n(), KisProcessingApplicator::RECURSIVE, and KisNodeFacade::root.
| KRITAIMAGE_EXPORT bool KisLayerUtils::checkIsChildOf | ( | KisNodeSP | node, |
| const KisNodeList & | parents ) |
Definition at line 1545 of file kis_layer_utils.cpp.
References KisNode::parent.
| KRITAIMAGE_EXPORT bool KisLayerUtils::checkIsCloneOf | ( | KisNodeSP | node, |
| const KisNodeList & | nodes ) |
Returns true if: o node is a clone of some layer in nodes o node is a clone any child layer of any layer in nodes o node is a clone of a clone of a ..., that in the end points to any layer in nodes of their children.
Definition at line 1564 of file kis_layer_utils.cpp.
References checkIsCloneOf(), KisCloneLayer::copyFrom, KisSharedPtr< T >::data(), and recursiveFindNode().
| bool KisLayerUtils::checkNodesDiffer | ( | KisNodeList | nodes, |
| std::function< T(KisNodeSP)> | checkerFunc ) |
Definition at line 214 of file kis_layer_utils.h.
| KRITAIMAGE_EXPORT std::future< KisNodeSP > KisLayerUtils::convertToPaintLayer | ( | KisImageSP | image, |
| KisNodeSP | src ) |
Definition at line 2398 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::BARRIER, KisProcessingApplicator::end(), kundo2_i18n(), kismpl::make_ready_future(), KisProcessingApplicator::NONE, KisProcessingApplicator::successfullyCompletedFuture(), and kismpl::then().
| int KisLayerUtils::fetchLayerActiveRasterFrameID | ( | KisNodeSP | node | ) |
Definition at line 2434 of file kis_layer_utils.cpp.
References KisKeyframeChannel::activeKeyframeAt(), KisKeyframeChannel::activeKeyframeTime(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| KRITAIMAGE_EXPORT KisTimeSpan KisLayerUtils::fetchLayerActiveRasterFrameSpan | ( | KisNodeSP | node, |
| const int | time ) |
Definition at line 2464 of file kis_layer_utils.cpp.
References KisKeyframeChannel::affectedFrames(), KisTimeSpan::infinite(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| KRITAIMAGE_EXPORT int KisLayerUtils::fetchLayerActiveRasterFrameTime | ( | KisNodeSP | node | ) |
Definition at line 2451 of file kis_layer_utils.cpp.
References KisKeyframeChannel::activeKeyframeTime(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| KRITAIMAGE_EXPORT QSet< int > KisLayerUtils::fetchLayerFrames | ( | KisNodeSP | node | ) |
Definition at line 1344 of file kis_layer_utils.cpp.
References KisKeyframeChannel::allKeyframeTimes(), KisTimeSpan::end(), KisKeyframeChannel::firstKeyframeTime(), KisScalarKeyframeChannel::identicalFrames(), KisTimeSpan::isInfinite(), KisTimeSpan::isValid(), KisBaseNode::keyframeChannels, KisKeyframeChannel::lastKeyframeTime(), and KisTimeSpan::start().
| KRITAIMAGE_EXPORT QSet< int > KisLayerUtils::fetchLayerFramesRecursive | ( | KisNodeSP | rootNode | ) |
Definition at line 1380 of file kis_layer_utils.cpp.
References fetchLayerFrames(), fetchLayerFramesRecursive(), KisNode::firstChild(), KisNode::nextSibling(), and KisBaseNode::visible().
| KRITAIMAGE_EXPORT QSet< int > KisLayerUtils::fetchLayerIdenticalRasterFrameTimes | ( | KisNodeSP | node, |
| const int & | frameTime ) |
Definition at line 2476 of file kis_layer_utils.cpp.
References KisRasterKeyframeChannel::clonesOf(), KisSharedPtr< T >::data(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| QSet< int > KisLayerUtils::fetchLayerRasterFrameTimesMatchingID | ( | KisNodeSP | node, |
| const int | frameID ) |
Definition at line 2489 of file kis_layer_utils.cpp.
References KisBaseNode::getKeyframeChannel(), KIS_ASSERT, KisKeyframeChannel::Raster, and KisRasterKeyframeChannel::timesForFrameID().
| QSet< int > KisLayerUtils::fetchLayerRasterIDsAtTimes | ( | KisNodeSP | node, |
| const QSet< int > & | times ) |
Definition at line 2500 of file kis_layer_utils.cpp.
References KisKeyframeChannel::activeKeyframeAt(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| QSet< int > KisLayerUtils::fetchLayerUniqueRasterTimesMatchingIDs | ( | KisNodeSP | node, |
| QSet< int > & | frameIDs ) |
Definition at line 2531 of file kis_layer_utils.cpp.
References fetchLayerRasterFrameTimesMatchingID(), KisPaintDevice::framesInterface(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| void KisLayerUtils::fetchSelectionMasks | ( | KisNodeList | mergedNodes, |
| QVector< KisSelectionMaskSP > & | selectionMasks ) |
Definition at line 66 of file kis_layer_utils.cpp.
References KisNode::childNodes(), and KisSharedPtr< T >::data().
| KRITAIMAGE_EXPORT QSet< int > KisLayerUtils::fetchUniqueFrameTimes | ( | KisNodeSP | node, |
| QSet< int > | selectedTimes, | ||
| bool | filterActiveFrameID ) |
Definition at line 2550 of file kis_layer_utils.cpp.
References fetchLayerActiveRasterFrameID(), fetchLayerRasterIDsAtTimes(), fetchLayerUniqueRasterTimesMatchingIDs(), KisPaintDevice::framesInterface(), KoID::id(), KisBaseNode::paintDevice(), KisKeyframeChannel::Raster, and KisBaseNode::supportsKeyframeChannel().
| KisNodeList KisLayerUtils::filterInvisibleNodes | ( | const KisNodeList & | nodes, |
| KisNodeList * | invisibleNodes, | ||
| KisNodeSP * | putAfter ) |
When a layer is invisible and user-locked we should just skip it and do neither merge nor remove it.
Definition at line 1738 of file kis_layer_utils.cpp.
References KIS_ASSERT_RECOVER, KisBaseNode::userLocked(), and KisBaseNode::visible().
| KRITAIMAGE_EXPORT void KisLayerUtils::filterMergeableNodes | ( | KisNodeList & | nodes, |
| bool | allowMasks ) |
Definition at line 1593 of file kis_layer_utils.cpp.
References checkIsChildOf().
| KRITAIMAGE_EXPORT QSet< int > KisLayerUtils::filterTimesForOnlyRasterKeyedTimes | ( | KisNodeSP | node, |
| const QSet< int > & | times ) |
Definition at line 2519 of file kis_layer_utils.cpp.
References KisKeyframeChannel::allKeyframeTimes(), KisPaintDevice::keyframeChannel(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, and KisBaseNode::paintDevice().
| KRITAIMAGE_EXPORT void KisLayerUtils::filterUnlockedNodes | ( | KisNodeList & | nodes | ) |
Definition at line 1771 of file kis_layer_utils.cpp.
| KRITAIMAGE_EXPORT KisImageSP KisLayerUtils::findImageByHierarchy | ( | KisNodeSP | node | ) |
Definition at line 2263 of file kis_layer_utils.cpp.
References KisSharedPtr< T >::data(), KisBaseNode::image, and KisNode::parent.
Definition at line 2220 of file kis_layer_utils.cpp.
References KisBaseNode::name(), and recursiveFindNode().
| T * KisLayerUtils::findNodeByType | ( | KisNodeSP | root | ) |
Definition at line 267 of file kis_layer_utils.h.
References KisSharedPtr< T >::data(), and recursiveFindNode().
Recursively searches for a node with specified Uuid
Definition at line 2194 of file kis_layer_utils.cpp.
References recursiveFindNode(), and KisBaseNode::uuid().
| KRITAIMAGE_EXPORT QList< KisNodeSP > KisLayerUtils::findNodesByName | ( | KisNodeSP | root, |
| const QString & | name, | ||
| bool | recursive, | ||
| bool | partialMatch ) |
Definition at line 2202 of file kis_layer_utils.cpp.
References KisNode::childCount(), findNodesByName(), KisNode::firstChild(), KisBaseNode::name(), and KisNode::nextSibling().
| KRITAIMAGE_EXPORT KisNodeList KisLayerUtils::findNodesWithProps | ( | KisNodeSP | root, |
| const KoProperties & | props, | ||
| bool | excludeRoot ) |
Definition at line 1721 of file kis_layer_utils.cpp.
References KisBaseNode::check(), findNodesWithProps(), KisNode::firstChild(), KisNode::nextSibling(), and KisNode::parent.
Definition at line 2331 of file kis_layer_utils.cpp.
References KisNode::parent.
| KRITAIMAGE_EXPORT void KisLayerUtils::flattenImage | ( | KisImageSP | image, |
| KisNodeSP | activeNode, | ||
| MergeFlags | flags ) |
Definition at line 2144 of file kis_layer_utils.cpp.
References kundo2_i18n(), KisNode::lastChild(), mergeMultipleLayersImpl(), and KisNodeFacade::root.
| KRITAIMAGE_EXPORT void KisLayerUtils::flattenLayer | ( | KisImageSP | image, |
| KisLayerSP | layer, | ||
| MergeFlags | flags ) |
Definition at line 2130 of file kis_layer_utils.cpp.
References KisNode::childCount(), kundo2_i18n(), KisLayer::layerStyle, and mergeMultipleLayersImpl().
Definition at line 2228 of file kis_layer_utils.cpp.
References KisSharedPtr< T >::data(), KisDelayedUpdateNodeInterface::forceUpdateTimedNode(), and recursiveApplyNodes().
Definition at line 2251 of file kis_layer_utils.cpp.
References KisSharedPtr< T >::data(), KisCroppedOriginalLayerInterface::forceUpdateHiddenAreaOnOriginal(), and recursiveApplyNodes().
| KRITAIMAGE_EXPORT bool KisLayerUtils::hasDelayedNodeWithUpdates | ( | KisNodeSP | root | ) |
Definition at line 2240 of file kis_layer_utils.cpp.
References KisSharedPtr< T >::data(), KisDelayedUpdateNodeInterface::hasPendingTimedUpdates(), and recursiveFindNode().
| KRITAIMAGE_EXPORT void KisLayerUtils::mergeDown | ( | KisImageSP | image, |
| KisLayerSP | layer, | ||
| const KisMetaData::MergeStrategy * | strategy, | ||
| MergeFlags | flags ) |
Save the original time before we start switching is with asynchronous SwitchFrameCommand.
When switching frames we need to update the entire image, not only the new extent of the layer, hence we pass refresh_entire_image to the command to make sure that the entire image bounds rect is added to the update rect
If source layer is not animated, then just merge that into the current frame to avoid unintentional destruction of the animation on the layer below. To merge the source into all the frames, just make the source animated.
See https://bugs.kde.org/show_bug.cgi?id=475550
Definition at line 1420 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::BARRIER, KisSharedPtr< T >::data(), KisProcessingApplicator::end(), KisStrokeJobData::EXCLUSIVE, KisBaseNode::isAnimated(), KisBaseNode::isFakeNode(), kundo2_i18n(), KisProcessingApplicator::NONE, KisNode::prevSibling(), KisLayerUtils::RefreshHiddenAreas::refresh_entire_image, KisStrokeJobData::SEQUENTIAL, and KisBaseNode::visible().
| KRITAIMAGE_EXPORT void KisLayerUtils::mergeMultipleLayers | ( | KisImageSP | image, |
| KisNodeList | mergedNodes, | ||
| KisNodeSP | putAfter, | ||
| MergeFlags | flags ) |
Definition at line 2014 of file kis_layer_utils.cpp.
References kundo2_i18n(), and mergeMultipleLayersImpl().
| void KisLayerUtils::mergeMultipleLayersImpl | ( | KisImageSP | image, |
| KisNodeList | mergedNodes, | ||
| KisNodeSP | putAfter, | ||
| bool | flattenSingleLayer, | ||
| const KUndo2MagicString & | actionName, | ||
| bool | cleanupNodes = true, | ||
| const QString | layerName = QString(), | ||
| MergeFlags | flags = None ) |
There might be two approaches for merging multiple layers:
1) Consider the selected nodes as a distinct "group" and merge them as if they were isolated from the rest of the image. The key point of this approach is that the look of the image will change, when merging "weird" layers, like adjustment layers or layers with non-normal blending mode.
2) Merge layers in a way to keep the look of the image as unchanged as possible. With this approach one uses a few heuristics:
Krita uses the second approach: after merge operation, the image should look as if nothing has happened (if it is technically possible).
We have reached the root of the layer hierarchy and didn't manage to find a node that was editable enough for putting our merged result into it. That shouldn't happen in normal circumstances, unless the user chose to make the root layer visible and lock it manually.
When switching frames we need to update the entire image, not only the new extent of the layer, hence we pass refresh_entire_image to the command to make sure that the entire image bounds rect is added to the update rect
Definition at line 1871 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::BARRIER, KisProcessingApplicator::end(), KisStrokeJobData::EXCLUSIVE, filterInvisibleNodes(), filterMergeableNodes(), KisBaseNode::isEditable(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisProcessingApplicator::NONE, KisNode::parent, KisLayerUtils::RefreshHiddenAreas::refresh_entire_image, KisNodeFacade::root, KisStrokeJobData::SEQUENTIAL, sortMergeableNodes(), and KisBaseNode::visible().
| KRITAIMAGE_EXPORT void KisLayerUtils::mergeMultipleNodes | ( | KisImageSP | image, |
| KisNodeList | mergedNodes, | ||
| KisNodeSP | putAfter, | ||
| MergeFlags | flags = None ) |
Same as mergeMultipleLayers() but tries to merge masks with tryMergeSelectionMasks() first.
Definition at line 2022 of file kis_layer_utils.cpp.
References mergeMultipleLayers(), and tryMergeSelectionMasks().
| KRITAIMAGE_EXPORT void KisLayerUtils::newLayerFromVisible | ( | KisImageSP | image, |
| KisNodeSP | putAfter, | ||
| MergeFlags | flags ) |
Definition at line 2029 of file kis_layer_utils.cpp.
References kundo2_i18n(), mergeMultipleLayersImpl(), and KisNodeFacade::root.
| void KisLayerUtils::recursiveApplyNodes | ( | NodePointer | node, |
| Functor | func ) |
Applies func to node and all its children recursively
Definition at line 235 of file kis_layer_utils.h.
References recursiveApplyNodes().
| KRITAIMAGE_EXPORT KisNodeSP KisLayerUtils::recursiveFindNode | ( | KisNodeSP | node, |
| std::function< bool(KisNodeSP)> | func ) |
Walks through node and all its children recursively until func returns true. When func returns true, the node is considered to be found, the search is stopped and the found node is returned to the caller.
Definition at line 2176 of file kis_layer_utils.cpp.
References KisNode::firstChild(), KisNode::nextSibling(), and recursiveFindNode().
| KRITAIMAGE_EXPORT QRect KisLayerUtils::recursiveTightNodeVisibleBounds | ( | KisNodeSP | rootNode | ) |
Definition at line 2322 of file kis_layer_utils.cpp.
References KisNode::projectionPlane(), and recursiveApplyNodes().
| KRITAIMAGE_EXPORT void KisLayerUtils::refreshHiddenAreaAsync | ( | KisImageSP | image, |
| KisNodeSP | rootNode, | ||
| const QRect & | preparedArea ) |
Definition at line 2318 of file kis_layer_utils.cpp.
References KisLayerUtils::Private::refreshHiddenAreaAsync().
| KRITAIMAGE_EXPORT KisNodeList KisLayerUtils::sortAndFilterAnyMergeableNodesSafe | ( | const KisNodeList & | nodes, |
| KisImageSP | image ) |
Definition at line 1685 of file kis_layer_utils.cpp.
References filterMergeableNodes(), KisNode::graphListener, KisNodeFacade::root, and sortMergeableNodes().
| KRITAIMAGE_EXPORT KisNodeList KisLayerUtils::sortAndFilterMergeableInternalNodes | ( | KisNodeList | nodes, |
| bool | allowMasks ) |
Definition at line 1640 of file kis_layer_utils.cpp.
References filterMergeableNodes(), KIS_SAFE_ASSERT_RECOVER, KisNode::parent, and sortMergeableNodes().
| KRITAIMAGE_EXPORT KisNodeList KisLayerUtils::sortMergeableInternalNodes | ( | KisNodeList | nodes | ) |
Definition at line 1663 of file kis_layer_utils.cpp.
References KIS_SAFE_ASSERT_RECOVER, KisNode::parent, and sortMergeableNodes().
| void KisLayerUtils::sortMergeableNodes | ( | KisNodeSP | root, |
| KisNodeList & | inputNodes, | ||
| KisNodeList & | outputNodes ) |
By the end of recursion inputNodes must be empty
Definition at line 1608 of file kis_layer_utils.cpp.
References KisNode::firstChild(), KIS_ASSERT_RECOVER_NOOP, KisNode::nextSibling(), KisNode::parent, and sortMergeableNodes().
| KRITAIMAGE_EXPORT KisNodeList KisLayerUtils::sortMergeableNodes | ( | KisNodeSP | root, |
| KisNodeList | nodes ) |
Definition at line 1633 of file kis_layer_utils.cpp.
References sortMergeableNodes().
| KRITAIMAGE_EXPORT void KisLayerUtils::sortMergeableNodes | ( | KisNodeSP | root, |
| QList< KisNodeSP > & | inputNodes, | ||
| QList< KisNodeSP > & | outputNodes ) |
| KRITAIMAGE_EXPORT void KisLayerUtils::splitAlphaToMask | ( | KisImageSP | image, |
| KisNodeSP | node, | ||
| const QString & | maskName ) |
Definition at line 2373 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::BARRIER, KisProcessingApplicator::end(), KisBaseNode::image, kundo2_i18n(), and KisProcessingApplicator::NONE.
| void KisLayerUtils::splitNonRemovableNodes | ( | KisNodeList & | nodesToRemove, |
| KisNodeList & | _nodesToHide ) |
Definition at line 1111 of file kis_layer_utils.cpp.
References KisBaseNode::isEditable(), KIS_SAFE_ASSERT_RECOVER_NOOP, recursiveApplyNodes(), and KisBaseNode::visible().
| KRITAIMAGE_EXPORT bool KisLayerUtils::tryMergeSelectionMasks | ( | KisImageSP | image, |
| KisNodeList | mergedNodes, | ||
| KisNodeSP | putAfter ) |
Definition at line 2091 of file kis_layer_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisProcessingApplicator::end(), KisStrokeJobData::EXCLUSIVE, KIS_ASSERT_RECOVER, kundo2_i18n(), None, KisProcessingApplicator::NONE, and KisStrokeJobData::SEQUENTIAL.
Definition at line 1394 of file kis_layer_utils.cpp.
References fetchLayerFrames(), and fetchUniqueFrameTimes().
Definition at line 1407 of file kis_layer_utils.cpp.
References KisNode::firstChild(), KisNode::nextSibling(), updateFrameJobs(), and updateFrameJobsRecursive().