We need to make sure that the destination polygon is not too small, otherwise even small rounding will send the src-accessor into infinity
Definition at line 216 of file kis_grid_interpolation_tools.h.
216 {
217 QRect boundRect = clipDstPolygon.boundingRect().toAlignedRect();
218 if (boundRect.isEmpty()) return;
219
221
222 if (samePolygon) {
223
224
226 return;
227 }
228
229
232
234
240 if (
interp.isValid(0.1)) {
241 int y = boundRect.top();
243
244 while (dstIt.nextPixel()) {
245 int newY = dstIt.y();
246
247 if (y != newY) {
250 }
251
252 QPointF srcPoint(dstIt.x(), y);
253
254 if (clipDstPolygon.containsPoint(srcPoint, Qt::OddEvenFill)) {
255
256 interp.setX(srcPoint.x());
258
259
260
261
262
263
264
265
267 quint8* rawData = dstIt.rawData();
269 }
270 }
271
272 } else {
274
275 while (dstIt.nextPixel()) {
276 QPointF srcPoint(dstIt.x(), dstIt.y());
277
278 if (clipDstPolygon.containsPoint(srcPoint, Qt::OddEvenFill)) {
280 }
281 }
282 }
283
284 }
const KoColorSpace * colorSpace() const
KisRandomSubAccessorSP createRandomSubAccessor() const
void sampledOldRawData(quint8 *dst)
void moveTo(qreal x, qreal y)
qreal interp(qreal r, qreal a, qreal b)
private functions
bool fuzzyPointCompare(const QPointF &p1, const QPointF &p2)
References KisPaintDevice::colorSpace(), KisPaintDevice::createRandomSubAccessor(), dstPoint, fastCopyArea(), KisAlgebra2D::fuzzyPointCompare(), interp(), m_dstDev, m_epsilon, m_srcDev, KisRandomSubAccessor::moveTo(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisRandomSubAccessor::sampledOldRawData(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::x(), and KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::y().