diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-05-16 22:29:27 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-16 23:47:14 +0100 |
commit | 93bd1ff05bf315ed11b305d32eb510bd9a9a7e92 (patch) | |
tree | 10c2d846ed1193624a5119853bbc2ef9651e197c /fitz/image_png.c | |
parent | 558ad511446cfa1d70891d9e7c9fb1ba942d3d9a (diff) | |
download | mupdf-93bd1ff05bf315ed11b305d32eb510bd9a9a7e92.tar.xz |
Add colorspace context.
To prepare for color management, we have to make the device colorspaces
per-context and able to be overridden by users.
Diffstat (limited to 'fitz/image_png.c')
-rw-r--r-- | fitz/image_png.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fitz/image_png.c b/fitz/image_png.c index 7eebdced..1adaaf7a 100644 --- a/fitz/image_png.c +++ b/fitz/image_png.c @@ -485,7 +485,7 @@ png_read_image(fz_context *ctx, struct info *info, unsigned char *p, unsigned in static fz_pixmap * png_expand_palette(fz_context *ctx, struct info *info, fz_pixmap *src) { - fz_pixmap *dst = fz_new_pixmap(ctx, fz_device_rgb, src->w, src->h); + fz_pixmap *dst = fz_new_pixmap(ctx, fz_device_rgb(ctx), src->w, src->h); unsigned char *sp = src->samples; unsigned char *dp = dst->samples; unsigned int x, y; @@ -545,9 +545,9 @@ fz_load_png(fz_context *ctx, unsigned char *p, int total) png_read_image(ctx, &png, p, total); if (png.n == 3 || png.n == 4) - colorspace = fz_device_rgb; + colorspace = fz_device_rgb(ctx); else - colorspace = fz_device_gray; + colorspace = fz_device_gray(ctx); stride = (png.width * png.n * png.depth + 7) / 8; @@ -587,9 +587,9 @@ fz_load_png_info(fz_context *ctx, unsigned char *p, int total, int *wp, int *hp, png_read_image(ctx, &png, p, total); if (png.n == 3 || png.n == 4) - *cspacep = fz_device_rgb; + *cspacep = fz_device_rgb(ctx); else - *cspacep = fz_device_gray; + *cspacep = fz_device_gray(ctx); *wp = png.width; *hp = png.height; |