diff options
-rw-r--r-- | include/mupdf/fitz/image.h | 1 | ||||
-rw-r--r-- | source/fitz/colorspace.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mupdf/fitz/image.h b/include/mupdf/fitz/image.h index 13aee534..ba950ebf 100644 --- a/include/mupdf/fitz/image.h +++ b/include/mupdf/fitz/image.h @@ -234,6 +234,7 @@ fz_image *fz_new_image_from_file(fz_context *ctx, const char *path); void fz_drop_image_imp(fz_context *ctx, fz_storable *image); void fz_drop_image_base(fz_context *ctx, fz_image *image); fz_pixmap *fz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_compressed_image *image, fz_irect *subarea, int indexed, int l2factor); +unsigned char *fz_indexed_colorspace_palette(fz_context *ctx, fz_colorspace *cs, int *high); fz_pixmap *fz_expand_indexed_pixmap(fz_context *ctx, const fz_pixmap *src, int alpha); size_t fz_image_size(fz_context *ctx, fz_image *im); diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index a20f1a56..82c7c230 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -3169,6 +3169,16 @@ fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsign return cs; } +unsigned char * +fz_indexed_colorspace_palette(fz_context *ctx, fz_colorspace *cs, int *high) +{ + struct indexed *idx = cs->data; + if (!fz_colorspace_is_indexed(ctx, cs)) + fz_throw(ctx, FZ_ERROR_GENERIC, "colorspace not indexed"); + *high = idx->high; + return idx->lookup; +} + fz_pixmap * fz_expand_indexed_pixmap(fz_context *ctx, const fz_pixmap *src, int alpha) { |