From abc5e113716897aab33237da800d745b99db3e41 Mon Sep 17 00:00:00 2001 From: homm Date: Sun, 9 Nov 2014 01:05:50 +0300 Subject: [PATCH] two bands case --- libImaging/Antialias.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libImaging/Antialias.c b/libImaging/Antialias.c index 0cf51b521..fd2ec51be 100644 --- a/libImaging/Antialias.c +++ b/libImaging/Antialias.c @@ -216,7 +216,18 @@ ImagingStretchHorizontal(Imaging imIn, int xsize, int filter) xmin = xbounds[xx * 2 + 0]; xmax = xbounds[xx * 2 + 1]; k = &kk[xx * kmax]; - if (imIn->bands == 3) { + if (imIn->bands == 2) { + ss0 = ss1 = 0.5; + for (x = xmin; x < xmax; x++) { + ss0 += i2f((UINT8) imIn->image[yy][x*4 + 0]) * k[x - xmin]; + ss1 += i2f((UINT8) imIn->image[yy][x*4 + 3]) * k[x - xmin]; + } +#ifdef WORDS_BIGENDIAN + imOut->image32[yy][xx] = clip8(ss1) | clip8(ss0) << 24; +#else + imOut->image32[yy][xx] = clip8(ss0) | clip8(ss1) << 24; +#endif + } else if (imIn->bands == 3) { ss0 = ss1 = ss2 = 0.5; for (x = xmin; x < xmax; x++) { ss0 += i2f((UINT8) imIn->image[yy][x*4 + 0]) * k[x - xmin];