Do not use lineOut buffer if source and destination are different.

This commit is contained in:
homm 2014-10-19 01:14:08 +04:00
parent 5ab12e0ee7
commit f55ea4c04c

View File

@ -195,33 +195,37 @@ HorizontalBoxBlur(Imaging im, Imaging imOut, float floatRadius)
for (y = 0; y < im->ysize; y++) { for (y = 0; y < im->ysize; y++) {
LineBoxBlur8( LineBoxBlur8(
im->image8[y], im->image8[y],
(UINT8 *) lineOut, (im == imOut ? (UINT8 *) lineOut : imOut->image8[y]),
im->xsize - 1, im->xsize - 1,
radius, edgeA, edgeB, radius, edgeA, edgeB,
ww, fw ww, fw
); );
if (im == imOut) {
// Commit. // Commit.
for (x = 0; x < im->xsize; x++) { for (x = 0; x < im->xsize; x++) {
imOut->image8[y][x] = ((UINT8 *)lineOut)[x]; imOut->image8[y][x] = ((UINT8 *)lineOut)[x];
} }
} }
} }
}
else else
{ {
for (y = 0; y < im->ysize; y++) { for (y = 0; y < im->ysize; y++) {
LineBoxBlur32( LineBoxBlur32(
(pixel *) im->image32[y], (pixel *) im->image32[y],
lineOut, im == imOut ? lineOut : (UINT32 *) imOut->image32[y],
im->xsize - 1, im->xsize - 1,
radius, edgeA, edgeB, radius, edgeA, edgeB,
ww, fw ww, fw
); );
if (im == imOut) {
// Commit. // Commit.
for (x = 0; x < im->xsize; x++) { for (x = 0; x < im->xsize; x++) {
imOut->image32[y][x] = lineOut[x]; imOut->image32[y][x] = lineOut[x];
} }
} }
} }
}
ImagingSectionLeave(&cookie); ImagingSectionLeave(&cookie);