|
Krita Source Code Documentation
|
Classes | |
| struct | ColorSamplerConfig |
Functions | |
| bool | clearImage (KisImageSP image, KisNodeList nodes, KisSelectionSP selection) |
| KisNodeSP | findNode (KisNodeSP node, const QPoint &point, bool wholeGroup, bool editableOnly) |
| KisNodeList | findNodes (KisNodeSP node, const QPoint &point, bool wholeGroup, bool includeGroups, bool editableOnly) |
| QList< KisShapeLayerSP > | findShapeLayers (KisNodeSP root, const QPointF &point, bool editableOnly) |
| bool | sampleColor (KoColor &out_color, KisPaintDeviceSP dev, const QPoint &pos, KoColor const *const blendColor, int radius, int blend, bool pure) |
| bool | selectShapeCrossLayer (KoCanvasBase *canvas, const QPointF &point, const QString &shapeType=QString(), bool skipCurrentShapes=true) |
| selectShapeCrossLayer Tries to select a shape under the cursor regardless of which layer it is on, to do so, it will always select the layer first and then the shape. | |
| void KRITAUI_EXPORT | setCursorPos (const QPoint &point) |
| QPainterPath | shapeHoverInfoCrossLayer (KoCanvasBase *canvas, const QPointF &point, QString &shapeType, bool *isHorizontal=nullptr, bool skipCurrentShapes=true) |
| shapeHoverInfoCrossLayer get hover info of shapes on all layers. | |
| bool KRITAUI_EXPORT KisToolUtils::clearImage | ( | KisImageSP | image, |
| KisNodeList | nodes, | ||
| KisSelectionSP | selection ) |
return true if success Clears the image. Selection is optional, use 0 to clear everything.
Definition at line 193 of file kis_tool_utils.cpp.
References KisProcessingApplicator::applyCommand(), KisStrokeJobData::CONCURRENT, KisLayerUtils::filterMergeableNodes(), KisBaseNode::hasEditablePaintDevice(), kundo2_i18n(), KisProcessingApplicator::NONE, and KisLayerUtils::recursiveApplyNodes().
| KisNodeSP KRITAUI_EXPORT KisToolUtils::findNode | ( | KisNodeSP | node, |
| const QPoint & | point, | ||
| bool | wholeGroup, | ||
| bool | editableOnly = true ) |
Recursively search a node with a non-transparent pixel
Definition at line 116 of file kis_tool_utils.cpp.
References KisPaintDevice::colorSpace(), KisSharedPtr< T >::data(), findNode(), KisBaseNode::isEditable(), KisNode::lastChild(), OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), KisNode::parent, KisGroupLayer::passThroughMode, KisPaintDevice::pixel(), KisNode::prevSibling(), and KisLayer::projection().
| KisNodeList KRITAUI_EXPORT KisToolUtils::findNodes | ( | KisNodeSP | node, |
| const QPoint & | point, | ||
| bool | wholeGroup, | ||
| bool | includeGroups, | ||
| bool | editableOnly ) |
Definition at line 151 of file kis_tool_utils.cpp.
References KisPaintDevice::colorSpace(), KisSharedPtr< T >::data(), findNodes(), KisNode::firstChild(), KisBaseNode::isEditable(), KisNode::nextSibling(), OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), KisNode::parent, KisGroupLayer::passThroughMode, KisPaintDevice::pixel(), and KisLayer::projection().
| QList< KisShapeLayerSP > KisToolUtils::findShapeLayers | ( | KisNodeSP | root, |
| const QPointF & | point, | ||
| bool | editableOnly ) |
Definition at line 319 of file kis_tool_utils.cpp.
References KisBaseNode::isEditable(), and KisLayerUtils::recursiveApplyNodes().
| bool KRITAUI_EXPORT KisToolUtils::sampleColor | ( | KoColor & | out_color, |
| KisPaintDeviceSP | dev, | ||
| const QPoint & | pos, | ||
| KoColor const *const | blendColor = nullptr, | ||
| int | radius = 1, | ||
| int | blend = 100, | ||
| bool | pure = false ) |
Sample a color based on the given position on the given paint device.
out_color - Output parameter returning newly sampled color. dev - Paint device to sample from. pos - Position to sample from. blendColor - Optional color to be blended with. radius - Sampling area radius in pixels. blend - Blend percentage. 100% all sampled, 0% all blendColor. pure - Whether to bypass radius, blending, and active layer settings for pure sampling.
RETURN - Returns TRUE whenever a valid color is sampled.
Definition at line 40 of file kis_tool_utils.cpp.
References KisPaintDevice::colorSpace(), KisPaintDevice::compositionSourceColorSpace(), KoColor::convertTo(), KoMixColorsOp::createMixer(), KoColor::createTransparent(), KoColor::data(), KIS_ASSERT, kisSquareDistance(), KoMixColorsOp::mixColors(), KoColorSpace::mixColorsOp, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nConseqPixels(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixels(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::oldRawData(), OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), KisPaintDevice::pixel(), pow2(), KisPaintDevice::setSupportsWraparoundMode(), KisPaintDevice::supportsWraproundMode(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::x(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::y().
| bool KRITAUI_EXPORT KisToolUtils::selectShapeCrossLayer | ( | KoCanvasBase * | canvas, |
| const QPointF & | point, | ||
| const QString & | shapeType = QString(), | ||
| bool | skipCurrentShapes = true ) |
selectShapeCrossLayer Tries to select a shape under the cursor regardless of which layer it is on, to do so, it will always select the layer first and then the shape.
| canvas | – the current canvas. |
| point | – the point in document coordinates. |
| shapeType | – the required shapeId, if empty, selects any koshape. |
Definition at line 372 of file kis_tool_utils.cpp.
References KoSelection::deselectAll(), findShapeLayers(), KisCanvas2::image(), KisViewManager::nodeManager(), KisNodeFacade::root, KoSelection::select(), KoSelection::selectedShapes(), KoShapeManager::selection, KoShapeManager::shapeAt(), KoShape::shapeId(), KisShapeLayer::shapeManager(), KoCanvasBase::shapeManager(), KisCanvas2::shapeManager, KisNodeManager::slotNonUiActivatedNode(), and KisCanvas2::viewManager().
| void KRITAUI_EXPORT KisToolUtils::setCursorPos | ( | const QPoint & | point | ) |
Moves the cursor (hot spot) of the primary screen to the global screen position (x, y).
This function is provided as a replacement to QCursor::setPos which does not properly handle multiple monitors with different scale factors.
Definition at line 307 of file kis_tool_utils.cpp.
| QPainterPath KRITAUI_EXPORT KisToolUtils::shapeHoverInfoCrossLayer | ( | KoCanvasBase * | canvas, |
| const QPointF & | point, | ||
| QString & | shapeType, | ||
| bool * | isHorizontal = nullptr, | ||
| bool | skipCurrentShapes = true ) |
shapeHoverInfoCrossLayer get hover info of shapes on all layers.
| canvas | – current canvas. |
| point | – the point in document coordinates. |
| shapeType | – the shapeID of the found shape. |
| isHorizontal | – when this is a textShape, sets whether the writing mode is horizontal. |
Definition at line 333 of file kis_tool_utils.cpp.
References KoShape::absoluteTransformation(), KoSvgTextShape::boundingRect(), findShapeLayers(), KoSvgText::HorizontalTB, KisCanvas2::image(), KoShape::outline(), p, KisNodeFacade::root, KoSelection::selectedShapes(), KoShapeManager::selection, KoShapeManager::shapeAt(), KoShape::shapeId(), KisShapeLayer::shapeManager(), KoCanvasBase::shapeManager(), KoSvgTextShape::shapesInside, and KoSvgTextShape::writingMode().