summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-10-29 15:53:58 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-12-14 20:36:25 +0100
commitd53ab7a97c018aaa0e0adcaabcebcc72c080f724 (patch)
treee0627cf3dcfb6c286bfadf9dedc40547875083e6 /include
parent5ad76a1961559904bbb9312d92dd15c3ed0c67b5 (diff)
downloadmupdf-d53ab7a97c018aaa0e0adcaabcebcc72c080f724.tar.xz
Let pixmap colorspace conversion create new pixmap.
This moves dropping the converted pixmap into fz_convert_pixmap(), which relieves every caller from doing so. Moreover resolution, position and interpolation are kept.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/pixmap.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h
index 90b876b6..b2a47407 100644
--- a/include/mupdf/fitz/pixmap.h
+++ b/include/mupdf/fitz/pixmap.h
@@ -262,14 +262,18 @@ void fz_gamma_pixmap(fz_context *ctx, fz_pixmap *pix, float gamma);
void fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
/*
- fz_convert_pixmap: Convert from one pixmap to another (assumed to be
- the same size, but possibly with a different colorspace).
+ fz_convert_pixmap: Convert an existing pixmap to a desired
+ colorspace. Other properties of the pixmap, such as resolution
+ and position are are copied to the converted pixmap.
- dst: the source pixmap.
+ pix: The pixmap to convert.
- src: the destination pixmap.
+ cs: Desired colorspace, may be NULL to denote alpha-only.
+
+ keep_alpha: If 0 any alpha component is removed, otherwise
+ alpha is kept if present in the pixmap.
*/
-void fz_convert_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src);
+fz_pixmap *fz_convert_pixmap(fz_context *ctx, fz_pixmap *pix, fz_colorspace *src, int keep_alpha);
/*
Pixmaps represent a set of pixels for a 2 dimensional region of a