diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-03 19:59:11 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-03 19:59:11 +0200 |
commit | 5ea6c5701e7ec3f738a8adb6d20790edcda781ba (patch) | |
tree | 38352e2cff9f1b9ae7f48d20480b5a8088624de9 /draw | |
parent | a5bfe0eef4361ec3ca8190b2533eca041eb7ef61 (diff) | |
parent | bc5be11061e7687a80bcda6edc9bf3c136529111 (diff) | |
download | mupdf-5ea6c5701e7ec3f738a8adb6d20790edcda781ba.tar.xz |
Merge branch 'xps'
Diffstat (limited to 'draw')
-rw-r--r-- | draw/imageunpack.c | 10 | ||||
-rw-r--r-- | draw/meshdraw.c | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/draw/imageunpack.c b/draw/imageunpack.c index bbc22c70..2c7cb452 100644 --- a/draw/imageunpack.c +++ b/draw/imageunpack.c @@ -58,6 +58,16 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in if (depth == 1) initget1tables(); + if (scale == 0) + { + switch (depth) + { + case 1: scale = 255; break; + case 2: scale = 85; break; + case 4: scale = 17; break; + } + } + for (y = 0; y < dst->h; y++) { unsigned char *sp = src + y * stride; diff --git a/draw/meshdraw.c b/draw/meshdraw.c index f40af8c3..79437505 100644 --- a/draw/meshdraw.c +++ b/draw/meshdraw.c @@ -540,6 +540,7 @@ fz_paintshade(fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox) fz_convertcolor(shade->colorspace, shade->function[i], dest->colorspace, color); for (k = 0; k < dest->colorspace->n; k++) clut[i][k] = color[k] * 255; + clut[i][k] = shade->function[i][shade->colorspace->n] * 255; } conv = fz_newpixmapwithrect(dest->colorspace, bbox); temp = fz_newpixmapwithrect(fz_devicegray, bbox); @@ -565,7 +566,7 @@ fz_paintshade(fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox) while (len--) { int v = *s++; - int a = *s++; + int a = fz_mul255(*s++, clut[v][conv->n - 1]); for (k = 0; k < conv->n - 1; k++) *d++ = fz_mul255(clut[v][k], a); *d++ = a; |