summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-07-06 14:44:19 +0100
committerRobin Watts <robin.watts@artifex.com>2017-07-19 19:41:23 +0100
commitd541fc4b9eced1b788377df8c7edfd9b8dea4094 (patch)
treeac1f1ee61ceb7fbf93fe4fe642bd65536222fddb /include
parent5242318aae6b46777326eb4b10514aabd21d7eea (diff)
downloadmupdf-d541fc4b9eced1b788377df8c7edfd9b8dea4094.tar.xz
Extend fz_colorspaces to better cope with DeviceN.
We now keep a list of colorant names for every colorspace, along with a an 'is_device_n' flag, set for all separation and deviceN spaces.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/colorspace.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/mupdf/fitz/colorspace.h b/include/mupdf/fitz/colorspace.h
index 6bd24faa..57404fa9 100644
--- a/include/mupdf/fitz/colorspace.h
+++ b/include/mupdf/fitz/colorspace.h
@@ -61,7 +61,14 @@ typedef struct fz_default_colorspaces_s fz_default_colorspaces;
True for CMYK, Separation and DeviceN colorspaces.
*/
-int fz_colorspace_is_subtractive(fz_context *ctx, fz_colorspace *pix);
+int fz_colorspace_is_subtractive(fz_context *ctx, const fz_colorspace *cs);
+
+/*
+ fz_colorspace_is_device_n: Return true if a colorspace is separation or devicen.
+
+ True for Separation and DeviceN colorspaces.
+*/
+int fz_colorspace_is_device_n(fz_context *ctx, const fz_colorspace *cs);
/*
fz_device_gray: Get colorspace representing device specific gray.
@@ -101,7 +108,9 @@ 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, 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);
+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);
+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);
fz_colorspace *fz_keep_colorspace(fz_context *ctx, fz_colorspace *colorspace);
void fz_drop_colorspace(fz_context *ctx, fz_colorspace *colorspace);
@@ -113,6 +122,7 @@ int fz_colorspace_is_lab_icc(fz_context *ctx, const fz_colorspace *cs);
int fz_colorspace_is_cal(fz_context *ctx, const fz_colorspace *cs);
int fz_colorspace_is_indexed(fz_context *ctx, const fz_colorspace *cs);
int fz_colorspace_n(fz_context *ctx, const fz_colorspace *cs);
+int fz_colorspace_devicen_n(fz_context *ctx, const fz_colorspace *cs);
const char *fz_colorspace_name(fz_context *ctx, const fz_colorspace *cs);
void fz_clamp_color(fz_context *ctx, const fz_colorspace *cs, const float *in, float *out);
void fz_convert_color(fz_context *ctx, const fz_color_params *params, fz_colorspace *intcs, fz_colorspace *dscs, float *dstv, fz_colorspace *srcs, const float *srcv);