#include <kis_multiway_cut.h>
Definition at line 17 of file kis_multiway_cut.h.
◆ KisMultiwayCut()
◆ ~KisMultiwayCut()
| KisMultiwayCut::~KisMultiwayCut |
( |
| ) |
|
◆ addKeyStroke()
◆ dstDevice()
◆ run()
| void KisMultiwayCut::run |
( |
| ) |
|
First sort all the key strokes in a way that all the transparent strokes go to the beginning of the list.
This is juat an heuristic: the transparent stroke usually represents the background so it is the bigger one. And since our algorithm is greedy, we should cover the biggest area as fast as possible.
Definition at line 94 of file kis_multiway_cut.cpp.
95{
97
109
110 while (
m_d->keyStrokes.size() > 1) {
112
113
115
117
120 gc.bitBlt(rc.topLeft(), s.
dev, rc);
121 }
122
123
124
125 if (other->exactBounds().isEmpty()) {
126 m_d->keyStrokes.clear();
127 m_d->keyStrokes << current;
128 break;
129 }
130
134 other,
138
139 other->clear();
140 }
141
142
143
144 if (
m_d->keyStrokes.size() == 1) {
146
147 m_d->maskOutKeyStroke(current.
dev,
m_d->mask,
m_d->boundingRect);
148
151
152 Q_FOREACH (const QPoint &pt, points) {
155 }
156 }
157}
QRect exactBounds() const
bool keyStrokesOrder(const KeyStroke &a, const KeyStroke &b)
References KisPainter::bitBlt(), KisPaintDevice::clear(), KisLazyFillTools::KeyStroke::color, KisLazyFillTools::cutOneWay(), KisLazyFillTools::KeyStroke::dev, KisPaintDevice::exactBounds(), KisPaintDevice::extent(), KisScanlineFill::fill(), KoColorSpaceRegistry::instance(), keyStrokesOrder(), m_d, and KisLazyFillTools::splitIntoConnectedComponents().
◆ srcDevice()
◆ m_d
| const QScopedPointer<Private> KisMultiwayCut::m_d |
|
private |
The documentation for this class was generated from the following files: