|
Krita Source Code Documentation
|
#include <KisAsyncColorSamplerHelper.h>
Inheritance diagram for KisAsyncColorSamplerHelper:Classes | |
| struct | Private |
Signals | |
| void | sigColorSelected (const KoColor &color) |
| void | sigFinalColorSelected (const KoColor &color) |
| void | sigRawColorSelected (const KoColor &color) |
| void | sigRequestCursor (const QCursor &cursor) |
| void | sigRequestCursorReset () |
| void | sigRequestUpdateOutline () |
Public Member Functions | |
| void | activate (bool sampleCurrentLayer, bool pickFgColor) |
| QRectF | colorPreviewDocRect (const QPointF &docPoint) |
| void | continueAction (const QPointF &docPoint) |
| void | deactivate () |
| void | endAction () |
| bool | isActive () const |
| KisAsyncColorSamplerHelper (KisCanvas2 *canvas) | |
| void | paint (QPainter &gc, const KoViewConverter &converter) |
| void | setUpdateGlobalColor (bool value) |
| void | startAction (const QPointF &docPoint, int radius, int blend) |
| void | updateCursor (bool sampleCurrentLayer, bool pickFgColor) |
| bool | updateGlobalColor () const |
| ~KisAsyncColorSamplerHelper () override | |
Private Slots | |
| void | activateDelayedPreview () |
| void | slotAddSamplingJob (const QPointF &docPoint) |
| void | slotCanvasZoomPreviewUpdated (const QImage &canvasImage, QRect canvasRect) |
| void | slotColorSamplingFinished (const KoColor &rawColor) |
| void | slotUpdateBgColor () |
Private Member Functions | |
| void | activatePreview () |
| void | paintCircle (QPainter &gc, const QRectF &viewRectF, const QColor ¤tColor, const QColor &baseColor) |
| void | paintCircleCanvasPreview (QPainter &gc, const QRectF &viewRectF, const QPainterPath &clip) |
| void | paintCircleCrosshair (QPainter &gc, const QRectF &viewRectF, const QColor ¤tColor) |
| void | paintCircleReferenceImagePreview (QPainter &gc, const QRectF &viewRectF, const QPainterPath &clip) |
| void | paintRectangle (QPainter &gc, const QRectF &viewRectF, const QColor ¤tColor, const QColor &baseColor) |
| void | prepareZoomPreview (const QRectF &docRect) |
Private Attributes | |
| QScopedPointer< Private > | m_d |
Definition at line 24 of file KisAsyncColorSamplerHelper.h.
| KisAsyncColorSamplerHelper::KisAsyncColorSamplerHelper | ( | KisCanvas2 * | canvas | ) |
Definition at line 278 of file KisAsyncColorSamplerHelper.cpp.
References activateDelayedPreview(), KisSignalCompressor::FIRST_ACTIVE, m_d, slotAddSamplingJob(), slotUpdateBgColor(), and void().
|
override |
Definition at line 294 of file KisAsyncColorSamplerHelper.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, and m_d.
| void KisAsyncColorSamplerHelper::activate | ( | bool | sampleCurrentLayer, |
| bool | pickFgColor ) |
Definition at line 304 of file KisAsyncColorSamplerHelper.cpp.
References KoCanvasResource::BackgroundColor, KisConfig::colorSamplerPreviewCircleDiameter(), KisConfig::colorSamplerPreviewCircleExtraCirclesEnabled(), KisConfig::colorSamplerPreviewCircleOutlineEnabled(), KisConfig::colorSamplerPreviewCirclePosition(), KisConfig::colorSamplerPreviewCircleThickness(), KisConfig::colorSamplerPreviewStyle(), KisConfig::colorSamplerZoomPreviewEnabled(), KisConfig::colorSamplerZoomPreviewScale(), KoCanvasResource::ForegroundColor, KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
|
privateslot |
Definition at line 333 of file KisAsyncColorSamplerHelper.cpp.
References activatePreview(), m_d, and sigRequestUpdateOutline().
|
private |
Definition at line 346 of file KisAsyncColorSamplerHelper.cpp.
References KoCanvasResource::ForegroundColor, m_d, and updateCursor().
| QRectF KisAsyncColorSamplerHelper::colorPreviewDocRect | ( | const QPointF & | docPoint | ) |
Definition at line 459 of file KisAsyncColorSamplerHelper.cpp.
References KisConfig::colorSamplerPreviewStyle(), m_d, and prepareZoomPreview().
| void KisAsyncColorSamplerHelper::continueAction | ( | const QPointF & | docPoint | ) |
Definition at line 442 of file KisAsyncColorSamplerHelper.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
| void KisAsyncColorSamplerHelper::deactivate | ( | ) |
Definition at line 398 of file KisAsyncColorSamplerHelper.cpp.
References endAction(), KIS_SAFE_ASSERT_RECOVER, m_d, sigRequestCursorReset(), and sigRequestUpdateOutline().
| void KisAsyncColorSamplerHelper::endAction | ( | ) |
Definition at line 448 of file KisAsyncColorSamplerHelper.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
| bool KisAsyncColorSamplerHelper::isActive | ( | ) | const |
Definition at line 299 of file KisAsyncColorSamplerHelper.cpp.
References m_d.
| void KisAsyncColorSamplerHelper::paint | ( | QPainter & | gc, |
| const KoViewConverter & | converter ) |
Definition at line 517 of file KisAsyncColorSamplerHelper.cpp.
References KoViewConverter::documentToView(), m_d, OPACITY_OPAQUE_U8, paintCircle(), paintRectangle(), KisConfig::RectangleAbove, KisConfig::RectangleLeft, and KisConfig::RectangleRight.
|
private |
Definition at line 594 of file KisAsyncColorSamplerHelper.cpp.
References KisConfig::Center, m_d, OPACITY_OPAQUE_U8, paintCircleCanvasPreview(), paintCircleCrosshair(), paintCircleReferenceImagePreview(), and qFuzzyCompare().
|
private |
Definition at line 761 of file KisAsyncColorSamplerHelper.cpp.
References m_d.
|
private |
Definition at line 741 of file KisAsyncColorSamplerHelper.cpp.
References KisPaintingTweaks::luminosityCoarse(), and m_d.
|
private |
Definition at line 782 of file KisAsyncColorSamplerHelper.cpp.
References Private::canvas, KoShape::compareShapeZIndex(), KisViewManager::document(), KisReferenceImage::documentToPixelFloored(), KisReferenceImage::getCachedImage(), m_d, KoShape::rotation(), KoShape::size(), KoShape::transparency(), and KisCanvas2::viewManager().
|
private |
Definition at line 544 of file KisAsyncColorSamplerHelper.cpp.
References m_d, KisAsyncColorSamplerHelper::Private::PREVIEW_RECT_SIZE, and qFuzzyCompare().
|
private |
Definition at line 476 of file KisAsyncColorSamplerHelper.cpp.
References KisImage::bounds(), Private::canvas, KisColorSamplerStrokeStrategy::GenerateCanvasZoomPreviewData::cookie(), KisImage::documentToImagePixelFloored(), KisImage::documentToPixel(), KisCanvas2::image(), m_d, KisImage::projection(), and KisImage::wrapAroundModeActive().
| void KisAsyncColorSamplerHelper::setUpdateGlobalColor | ( | bool | value | ) |
Definition at line 388 of file KisAsyncColorSamplerHelper.cpp.
Notifies about the "palette" color picked from the layer, that is, with the alpha channel set to OPACITY_OPAQUE.
Notifies about the "palette" color picked from the layer, that is, with the alpha channel set to OPACITY_OPAQUE.
This notification is emitted only once at the very end of the color picking stroke.
Notifies about the raw color picked from the layer, including its alpha channel.
|
signal |
|
signal |
|
signal |
|
privateslot |
The actual sampling is delayed by a compressor, so we can get this event when the stroke is already closed
Definition at line 843 of file KisAsyncColorSamplerHelper.cpp.
References Private::canvas, KisImage::documentToImagePixelFloored(), KisCanvas2::image(), koIcon, m_d, KoColor::opacityU8(), KisImage::projection(), and slotColorSamplingFinished().
|
privateslot |
Definition at line 836 of file KisAsyncColorSamplerHelper.cpp.
References m_d, and sigRequestUpdateOutline().
Definition at line 882 of file KisAsyncColorSamplerHelper.cpp.
References m_d, OPACITY_OPAQUE_U8, KoColor::setOpacity(), sigColorSelected(), sigRawColorSelected(), and sigRequestUpdateOutline().
|
privateslot |
Definition at line 908 of file KisAsyncColorSamplerHelper.cpp.
References KoColor::fromQColor(), and m_d.
| void KisAsyncColorSamplerHelper::startAction | ( | const QPointF & | docPoint, |
| int | radius, | ||
| int | blend ) |
Definition at line 426 of file KisAsyncColorSamplerHelper.cpp.
References activatePreview(), m_d, KisColorSamplerStrokeStrategy::sigCanvasZoomPreviewUpdated(), KisColorSamplerStrokeStrategy::sigColorUpdated(), sigFinalColorSelected(), KisColorSamplerStrokeStrategy::sigFinalColorSelected(), slotCanvasZoomPreviewUpdated(), and slotColorSamplingFinished().
| void KisAsyncColorSamplerHelper::updateCursor | ( | bool | sampleCurrentLayer, |
| bool | pickFgColor ) |
Definition at line 362 of file KisAsyncColorSamplerHelper.cpp.
References KoCanvasResource::BackgroundColor, KoCanvasResource::ForegroundColor, KisCursor::samplerImageBackgroundCursor(), KisCursor::samplerImageForegroundCursor(), KisCursor::samplerLayerBackgroundCursor(), KisCursor::samplerLayerForegroundCursor(), and sigRequestCursor().
| bool KisAsyncColorSamplerHelper::updateGlobalColor | ( | ) | const |
Definition at line 393 of file KisAsyncColorSamplerHelper.cpp.
References m_d.
|
private |
Definition at line 92 of file KisAsyncColorSamplerHelper.h.