diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-07-11 18:41:32 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-07-11 18:41:32 +0200 |
commit | cacfe5d248f713648206a40bf2ec339a71bb93c7 (patch) | |
tree | 54e37b3e091dd369f5ff2943cce0b2aeb0e34ab7 | |
parent | 58288d41515ec9d7101de1c5949127b528a4d220 (diff) | |
download | mupdf-cacfe5d248f713648206a40bf2ec339a71bb93c7.tar.xz |
Always use 255 to pad alpha since it is not affected by scale.
-rw-r--r-- | draw/imageunpack.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/draw/imageunpack.c b/draw/imageunpack.c index 577eac21..5b39283c 100644 --- a/draw/imageunpack.c +++ b/draw/imageunpack.c @@ -36,7 +36,7 @@ initget1tables(void) get1tab1[i][k] = x; get1tab1p[i][k * 2] = x; - get1tab1p[i][k * 2 + 1] = 1; + get1tab1p[i][k * 2 + 1] = 255; get1tab255[i][k] = x * 255; get1tab255p[i][k * 2] = x * 255; @@ -55,7 +55,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in pad = 0; if (dst->n > n) - pad = ((1 << depth) - 1) * scale; + pad = 255; initget1tables(); @@ -92,7 +92,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in memcpy(dp, get1tab255[*sp], w - x); } - else if (n == 1 && depth == 1 && scale == 1 && pad == 1) + else if (n == 1 && depth == 1 && scale == 1 && pad) { int w3 = w >> 3; for (x = 0; x < w3; x++) @@ -105,7 +105,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in memcpy(dp, get1tab1p[*sp], (w - x) << 1); } - else if (n == 1 && depth == 1 && scale == 255 && pad == 255) + else if (n == 1 && depth == 1 && scale == 255 && pad) { int w3 = w >> 3; for (x = 0; x < w3; x++) @@ -125,7 +125,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in *dp++ = *sp++; } - else if (depth == 8 && pad == 255) + else if (depth == 8 && pad) { for (x = 0; x < w; x++) { @@ -153,7 +153,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in b++; } if (pad) - *dp++ = pad; + *dp++ = 255; } } } |