diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-03-31 03:18:51 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-03-31 03:18:51 +0200 |
commit | b3f90095897b64f854efc4b2f37df428a71fd508 (patch) | |
tree | 27ad639a052b967e1fdc03f7d58ff63b5b0a8f46 /xps/muxps.h | |
parent | 4f484b32f3cf8682180ccb9e36f929edff175498 (diff) | |
download | mupdf-b3f90095897b64f854efc4b2f37df428a71fd508.tar.xz |
xps: Clean up image loading code, and handle images with alpha.
Diffstat (limited to 'xps/muxps.h')
-rw-r--r-- | xps/muxps.h | 28 |
1 files changed, 7 insertions, 21 deletions
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); |