|
Krita Source Code Documentation
|
#include <KisWatershedWorker.h>
Classes | |
| struct | Private |
Public Member Functions | |
| void | addKeyStroke (KisPaintDeviceSP dev, const KoColor &color) |
| Adds a key stroke to the worker. | |
| KisWatershedWorker (KisPaintDeviceSP heightMap, KisPaintDeviceSP dst, const QRect &boundingRect, KoUpdater *progress=0) | |
| void | run (qreal cleanUpAmount=0.0) |
| run the filling process using the passes height map, strokes, and write the result coloring into the destination device | |
| int | testingGroupAllyEdge (qint32 group, quint8 level) |
| int | testingGroupConflicts (qint32 group, quint8 level, qint32 withGroup) |
| int | testingGroupForeignEdge (qint32 group, quint8 level) |
| int | testingGroupNegativeEdge (qint32 group, quint8 level) |
| int | testingGroupPositiveEdge (qint32 group, quint8 level) |
| void | testingTryRemoveGroup (qint32 group, quint8 level) |
| ~KisWatershedWorker () | |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
Definition at line 17 of file KisWatershedWorker.h.
| KisWatershedWorker::KisWatershedWorker | ( | KisPaintDeviceSP | heightMap, |
| KisPaintDeviceSP | dst, | ||
| const QRect & | boundingRect, | ||
| KoUpdater * | progress = 0 ) |
Creates an empty watershed worker without any strokes attached. The strokes should be attached manually with addKeyStroke() call.
| heightMap | prefiltered height map in alpha8 colorspace, with "0" meaning background color and "255" meaning line art. Heightmap is never modified by the worker! |
| dst | destination device where the result will be written |
| boundingRect | the worker refuses to fill outside the bounding rect, considering that outer area as having +inf height |
| progress | the progress value |
Definition at line 250 of file KisWatershedWorker.cpp.
References KisPaintDevice::colorSpace(), KoColorSpaceRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and KoColorSpace::pixelSize().
| KisWatershedWorker::~KisWatershedWorker | ( | ) |
Definition at line 265 of file KisWatershedWorker.cpp.
| void KisWatershedWorker::addKeyStroke | ( | KisPaintDeviceSP | dev, |
| const KoColor & | color ) |
Adds a key stroke to the worker.
The key strokes may intersect, in which case the lastly added stroke will have a priority over all the previous ones.
| dev | alpha8 paint device of the key stroke, may contain disjoint areas |
| color | the color of the stroke |
Definition at line 269 of file KisWatershedWorker.cpp.
References KisPaintDevice::exactBounds(), m_d, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst().
| void KisWatershedWorker::run | ( | qreal | cleanUpAmount = 0.0 | ) |
run the filling process using the passes height map, strokes, and write the result coloring into the destination device
| cleanUpAmount | shows how aggressively we should try to clean up the final coloring. Should be in range [0.0...1.0] |
Definition at line 297 of file KisWatershedWorker.cpp.
References m_d.
| int KisWatershedWorker::testingGroupAllyEdge | ( | qint32 | group, |
| quint8 | level ) |
Definition at line 348 of file KisWatershedWorker.cpp.
References m_d.
| int KisWatershedWorker::testingGroupConflicts | ( | qint32 | group, |
| quint8 | level, | ||
| qint32 | withGroup ) |
Definition at line 353 of file KisWatershedWorker.cpp.
References m_d.
| int KisWatershedWorker::testingGroupForeignEdge | ( | qint32 | group, |
| quint8 | level ) |
Definition at line 343 of file KisWatershedWorker.cpp.
References m_d.
| int KisWatershedWorker::testingGroupNegativeEdge | ( | qint32 | group, |
| quint8 | level ) |
Definition at line 338 of file KisWatershedWorker.cpp.
References m_d.
| int KisWatershedWorker::testingGroupPositiveEdge | ( | qint32 | group, |
| quint8 | level ) |
Definition at line 333 of file KisWatershedWorker.cpp.
References m_d.
| void KisWatershedWorker::testingTryRemoveGroup | ( | qint32 | group, |
| quint8 | level ) |
Definition at line 358 of file KisWatershedWorker.cpp.
References m_d.
|
private |
Definition at line 68 of file KisWatershedWorker.h.