From 89b91112b810a6b29396b8f4e91c8bde92969e0e Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 28 Jul 2017 12:42:31 +0100 Subject: Change colorspace 'device_n' field to be a flags word. --- include/mupdf/fitz/colorspace.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/mupdf/fitz/colorspace.h b/include/mupdf/fitz/colorspace.h index e07ea538..3c393caa 100644 --- a/include/mupdf/fitz/colorspace.h +++ b/include/mupdf/fitz/colorspace.h @@ -16,14 +16,6 @@ enum FZ_RI_ABSOLUTE_COLORIMETRIC, }; -enum -{ - FZ_NOT_DEVICE_N, - FZ_DEVICE_N_SPOTS_ONLY, - FZ_DEVICE_N_WITH_CMYK, - FZ_DEVICE_N_CMYK_ONLY -}; - typedef struct fz_color_params_s fz_color_params; struct fz_color_params_s @@ -79,9 +71,10 @@ int fz_colorspace_is_subtractive(fz_context *ctx, const fz_colorspace *cs); int fz_colorspace_is_device_n(fz_context *ctx, const fz_colorspace *cs); /* - fz_colorspace_device_n: Return information about device n colorants + fz_colorspace_device_n_has_only_cmyk: Return true if devicen color space + has only colorants from the cmyk set. */ -int fz_colorspace_device_n_info(fz_context *ctx, const fz_colorspace *cs); +int fz_colorspace_device_n_has_only_cmyk(fz_context *ctx, const fz_colorspace *cs); /* fz_colorspace_device_n_has_cmyk: Return true if devicen color space has cyan @@ -89,6 +82,12 @@ int fz_colorspace_device_n_info(fz_context *ctx, const fz_colorspace *cs); */ int fz_colorspace_device_n_has_cmyk(fz_context *ctx, const fz_colorspace *cs); +/* + fz_colorspace_is_device_gray: Return true if the color space is + device gray. +*/ +int fz_colorspace_is_device_gray(fz_context *ctx, const fz_colorspace *cs); + /* fz_device_gray: Get colorspace representing device specific gray. */ @@ -127,7 +126,16 @@ typedef fz_colorspace *(fz_colorspace_base_fn)(const fz_colorspace *cs); typedef void (fz_colorspace_clamp_fn)(const fz_colorspace *cs, const float *src, float *dst); -fz_colorspace *fz_new_colorspace(fz_context *ctx, const char *name, int n, int is_subtractive, int is_device_n, fz_colorspace_convert_fn *to_ccs, fz_colorspace_convert_fn *from_ccs, fz_colorspace_base_fn *base, fz_colorspace_clamp_fn *clamp, fz_colorspace_destruct_fn *destruct, void *data, size_t size); +enum +{ + FZ_CS_DEVICE_GRAY = 1, + FZ_CS_DEVICE_N = 2, + FZ_CS_SUBTRACTIVE = 4, + + FZ_CS_LAST_PUBLIC_FLAG = 4 +}; + +fz_colorspace *fz_new_colorspace(fz_context *ctx, const char *name, int n, int flags, fz_colorspace_convert_fn *to_ccs, fz_colorspace_convert_fn *from_ccs, fz_colorspace_base_fn *base, fz_colorspace_clamp_fn *clamp, fz_colorspace_destruct_fn *destruct, void *data, size_t size); void fz_colorspace_name_colorant(fz_context *ctx, fz_colorspace *cs, int n, const char *name); const char *fz_colorspace_colorant(fz_context *ctx, const fz_colorspace *cs, int n); fz_colorspace *fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup); -- cgit v1.2.3