mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Do not use lineOut buffer if source and destination are different.
This commit is contained in:
parent
5ab12e0ee7
commit
f55ea4c04c
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user