From b3f90095897b64f854efc4b2f37df428a71fd508 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 31 Mar 2011 03:18:51 +0200 Subject: xps: Clean up image loading code, and handle images with alpha. --- xps/muxps.h | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'xps/muxps.h') diff --git a/xps/muxps.h b/xps/muxps.h index ba826b10..1b137a59 100644 --- a/xps/muxps.h +++ b/xps/muxps.h @@ -97,35 +97,21 @@ void xps_debug_fixdocseq(xps_context *ctx); * Images. */ -typedef struct xps_image_s xps_image; +typedef struct xps_image xps_image; /* type for the information derived directly from the raster file format */ -struct xps_image_s +struct xps_image { - int width; - int height; - int stride; - fz_colorspace *colorspace; - int comps; - int hasalpha; /* chunky alpha */ - int bits; + fz_pixmap *pixmap; int xres; int yres; - byte *samples; - byte *profile; - int profilesize; - fz_pixmap *pixmap; }; -int xps_decode_jpeg(xps_context *ctx, byte *rbuf, int rlen, xps_image *image); -int xps_decode_png(xps_context *ctx, byte *rbuf, int rlen, xps_image *image); -int xps_decode_tiff(xps_context *ctx, byte *rbuf, int rlen, xps_image *image); -int xps_decode_jpegxr(xps_context *ctx, byte *buf, int len, xps_image *image); - -int xps_png_has_alpha(xps_context *ctx, byte *rbuf, int rlen); -int xps_tiff_has_alpha(xps_context *ctx, byte *rbuf, int rlen); -int xps_jpegxr_has_alpha(xps_context *ctx, byte *buf, int len); +int xps_decode_jpeg(xps_image **imagep, xps_context *ctx, byte *rbuf, int rlen); +int xps_decode_png(xps_image **imagep, xps_context *ctx, byte *rbuf, int rlen); +int xps_decode_tiff(xps_image **imagep, xps_context *ctx, byte *rbuf, int rlen); +int xps_decode_jpegxr(xps_image **imagep, xps_context *ctx, byte *rbuf, int rlen); void xps_free_image(xps_context *ctx, xps_image *image); -- cgit v1.2.3