mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-15 01:34:45 +03:00
a bit of cleanup
This commit is contained in:
parent
1f1dfc3fb7
commit
a2c95d9141
|
@ -346,7 +346,7 @@ fill_mask_L(
|
||||||
UINT8 *mask = (UINT8 *)imMask->image[y + sy] + sx;
|
UINT8 *mask = (UINT8 *)imMask->image[y + sy] + sx;
|
||||||
for (x = 0; x < xsize; x++) {
|
for (x = 0; x < xsize; x++) {
|
||||||
for (i = 0; i < pixelsize; i++) {
|
for (i = 0; i < pixelsize; i++) {
|
||||||
UINT8 channel_mask = *mask;
|
UINT8 channel_mask = mask[x];
|
||||||
if (alphaChannel >= 0 && i != alphaChannel && channel_mask != 0) {
|
if (alphaChannel >= 0 && i != alphaChannel && channel_mask != 0) {
|
||||||
channel_mask = 255 - (255 - channel_mask) *
|
channel_mask = 255 - (255 - channel_mask) *
|
||||||
(1 - (255 - out[alphaChannel]) / 255);
|
(1 - (255 - out[alphaChannel]) / 255);
|
||||||
|
@ -357,7 +357,6 @@ fill_mask_L(
|
||||||
out[i] = BLEND(channel_mask, out[i], isI16 ? ink[0] : ink[i], tmp1);
|
out[i] = BLEND(channel_mask, out[i], isI16 ? ink[0] : ink[i], tmp1);
|
||||||
}
|
}
|
||||||
out += pixelsize;
|
out += pixelsize;
|
||||||
mask++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -463,16 +462,14 @@ ImagingFill2(
|
||||||
int dy1) {
|
int dy1) {
|
||||||
ImagingSectionCookie cookie;
|
ImagingSectionCookie cookie;
|
||||||
int xsize, ysize;
|
int xsize, ysize;
|
||||||
int pixelsize;
|
|
||||||
int sx0, sy0;
|
int sx0, sy0;
|
||||||
|
int pixelsize;
|
||||||
|
|
||||||
if (!imOut || !ink) {
|
if (!imOut || !ink) {
|
||||||
(void)ImagingError_ModeError();
|
(void)ImagingError_ModeError();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pixelsize = imOut->pixelsize;
|
|
||||||
|
|
||||||
xsize = dx1 - dx0;
|
xsize = dx1 - dx0;
|
||||||
ysize = dy1 - dy0;
|
ysize = dy1 - dy0;
|
||||||
|
|
||||||
|
@ -500,6 +497,7 @@ ImagingFill2(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pixelsize = imOut->pixelsize;
|
||||||
if (!imMask) {
|
if (!imMask) {
|
||||||
ImagingSectionEnter(&cookie);
|
ImagingSectionEnter(&cookie);
|
||||||
fill(imOut, ink, dx0, dy0, xsize, ysize, pixelsize);
|
fill(imOut, ink, dx0, dy0, xsize, ysize, pixelsize);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user