mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
speedup La -> LA conversion in most cases
This commit is contained in:
parent
d1272b9b8a
commit
b56d8f3f1f
|
@ -140,11 +140,11 @@ la2lA(UINT8* out, const UINT8* in, int xsize)
|
|||
unsigned int alpha, pixel;
|
||||
for (x = 0; x < xsize; x++, in+=4) {
|
||||
alpha = in[3];
|
||||
if (alpha) {
|
||||
pixel = CLIP((255 * in[0]) / alpha);
|
||||
} else {
|
||||
if (alpha == 255 || alpha == 0) {
|
||||
pixel = in[0];
|
||||
}
|
||||
} else {
|
||||
pixel = CLIP((255 * in[0]) / alpha);
|
||||
}
|
||||
*out++ = (UINT8) pixel;
|
||||
*out++ = (UINT8) pixel;
|
||||
*out++ = (UINT8) pixel;
|
||||
|
|
Loading…
Reference in New Issue
Block a user