diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-12-03 15:58:57 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-12-09 07:25:41 -0800 |
commit | 0236c79d8db96ce4598742b0211f9aa58269f819 (patch) | |
tree | 7a7c342a073ee9ebd88a3bbdb20f75cbe2bc0fa6 /fitz/fitz-internal.h | |
parent | 519087f4f29aad524c9e12c64946cb242a05a5a9 (diff) | |
download | mupdf-0236c79d8db96ce4598742b0211f9aa58269f819.tar.xz |
Rejig color conversion.
Add a mechanism for getting a color converter function. Implement
the 'convert a single color' call in terms of that. 'Bulk' users
can then repeatedly call the single function.
Diffstat (limited to 'fitz/fitz-internal.h')
-rw-r--r-- | fitz/fitz-internal.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fitz/fitz-internal.h b/fitz/fitz-internal.h index 569fc694..c90474dd 100644 --- a/fitz/fitz-internal.h +++ b/fitz/fitz-internal.h @@ -984,6 +984,22 @@ void fz_free_colorspace_imp(fz_context *ctx, fz_storable *colorspace); void fz_convert_color(fz_context *ctx, fz_colorspace *dsts, float *dstv, fz_colorspace *srcs, float *srcv); +typedef struct fz_color_converter_s fz_color_converter; + +/* This structure is public because it allows us to avoid dynamic allocations. + * Callers should only rely on the convert entry - the rest of the structure + * is subject to change without notice. + */ +struct fz_color_converter_s +{ + void (*convert)(fz_color_converter *, float *, float *); + fz_context *ctx; + fz_colorspace *ds; + fz_colorspace *ss; +}; + +void fz_find_color_converter(fz_color_converter *cc, fz_context *ctx, fz_colorspace *ds, fz_colorspace *ss); + /* * Fonts come in two variants: * Regular fonts are handled by FreeType. |