mirror of https://github.com/aseprite/aseprite.git
Check continueTask per-line, not per-pixel
This commit is contained in:
parent
87fc82a978
commit
484f8d69bf
|
@ -240,14 +240,11 @@ void dither_rgb_image_to_indexed(DitheringAlgorithmBase& algorithm,
|
||||||
ASSERT(srcIt != srcBits.end());
|
ASSERT(srcIt != srcBits.end());
|
||||||
ASSERT(dstIt != dstBits.end());
|
ASSERT(dstIt != dstBits.end());
|
||||||
*dstIt = algorithm.ditherRgbPixelToIndex(dithering.matrix(), *srcIt, x, y, rgbmap, palette);
|
*dstIt = algorithm.ditherRgbPixelToIndex(dithering.matrix(), *srcIt, x, y, rgbmap, palette);
|
||||||
|
}
|
||||||
|
|
||||||
if (delegate) {
|
if (delegate) {
|
||||||
if (!delegate->continueTask())
|
if (!delegate->continueTask())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (delegate) {
|
|
||||||
delegate->notifyTaskProgress(double(y + 1) / double(h));
|
delegate->notifyTaskProgress(double(y + 1) / double(h));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,10 +259,6 @@ void dither_rgb_image_to_indexed(DitheringAlgorithmBase& algorithm,
|
||||||
for (int x = w - 1; x >= 0; --x, --dstIt) {
|
for (int x = w - 1; x >= 0; --x, --dstIt) {
|
||||||
ASSERT(dstIt == doc::get_pixel_address_fast<doc::IndexedTraits>(dstImage, x, y));
|
ASSERT(dstIt == doc::get_pixel_address_fast<doc::IndexedTraits>(dstImage, x, y));
|
||||||
*dstIt = algorithm.ditherRgbToIndex2D(x, y, rgbmap, palette, -1);
|
*dstIt = algorithm.ditherRgbToIndex2D(x, y, rgbmap, palette, -1);
|
||||||
if (delegate) {
|
|
||||||
if (!delegate->continueTask())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
dstIt += w + 1;
|
dstIt += w + 1;
|
||||||
}
|
}
|
||||||
|
@ -273,14 +266,12 @@ void dither_rgb_image_to_indexed(DitheringAlgorithmBase& algorithm,
|
||||||
for (int x = 0; x < w; ++x, ++dstIt) {
|
for (int x = 0; x < w; ++x, ++dstIt) {
|
||||||
ASSERT(dstIt == doc::get_pixel_address_fast<doc::IndexedTraits>(dstImage, x, y));
|
ASSERT(dstIt == doc::get_pixel_address_fast<doc::IndexedTraits>(dstImage, x, y));
|
||||||
*dstIt = algorithm.ditherRgbToIndex2D(x, y, rgbmap, palette, +1);
|
*dstIt = algorithm.ditherRgbToIndex2D(x, y, rgbmap, palette, +1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (delegate) {
|
if (delegate) {
|
||||||
if (!delegate->continueTask())
|
if (!delegate->continueTask())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (delegate) {
|
|
||||||
delegate->notifyTaskProgress(double(y + 1) / double(h));
|
delegate->notifyTaskProgress(double(y + 1) / double(h));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue