summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-07-13 10:56:37 +0100
committerRobin Watts <robin.watts@artifex.com>2017-07-17 19:32:06 +0100
commitd4d4dcf1d64d4b0d3a510ed218f17e815b68c012 (patch)
tree0ba55c1ab9994a24bbff0598e0605cbbeadc2404
parenta3d05504307e05e9bcf71aff7e5e86f0090bbba2 (diff)
downloadmupdf-d4d4dcf1d64d4b0d3a510ed218f17e815b68c012.tar.xz
Rid the world of fz_ensure_pixmap_is_additive.
No longer required since we flipped subtractive spaces.
-rw-r--r--include/mupdf/fitz/pixmap.h7
-rw-r--r--source/fitz/load-jxr.c3
-rw-r--r--source/fitz/load-pnm.c3
-rw-r--r--source/fitz/pixmap.c12
4 files changed, 0 insertions, 25 deletions
diff --git a/include/mupdf/fitz/pixmap.h b/include/mupdf/fitz/pixmap.h
index 5b784c09..ffbc27a7 100644
--- a/include/mupdf/fitz/pixmap.h
+++ b/include/mupdf/fitz/pixmap.h
@@ -263,13 +263,6 @@ void fz_gamma_pixmap(fz_context *ctx, fz_pixmap *pix, float gamma);
void fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix);
/*
- fz_ensure_pixmap_is_additive: Convert a pixmap in a subtractive colorspace to an additive colorspace.
-
- Pixmaps with premultiplied alpha must be in an additive colorspace.
-*/
-fz_pixmap *fz_ensure_pixmap_is_additive(fz_context *ctx, fz_pixmap *pix);
-
-/*
fz_convert_pixmap: Convert an existing pixmap to a desired
colorspace. Other properties of the pixmap, such as resolution
and position are copied to the converted pixmap.
diff --git a/source/fitz/load-jxr.c b/source/fitz/load-jxr.c
index 4ec857dc..f7a60f9f 100644
--- a/source/fitz/load-jxr.c
+++ b/source/fitz/load-jxr.c
@@ -409,10 +409,7 @@ fz_load_jxr(fz_context *ctx, unsigned char *data, size_t size)
{
fz_unpack_tile(ctx, image, info.samples, fz_colorspace_n(ctx, info.cspace) + 1, 8, info.stride, 0);
if (info.has_alpha && !info.has_premul)
- {
- image = fz_ensure_pixmap_is_additive(ctx, image);
fz_premultiply_pixmap(ctx, image);
- }
}
fz_always(ctx)
{
diff --git a/source/fitz/load-pnm.c b/source/fitz/load-pnm.c
index cf48da60..d5d6b9c7 100644
--- a/source/fitz/load-pnm.c
+++ b/source/fitz/load-pnm.c
@@ -568,10 +568,7 @@ pam_binary_read_image(fz_context *ctx, struct info *pnm, unsigned char *p, unsig
}
if (pnm->alpha)
- {
- img = fz_ensure_pixmap_is_additive(ctx, img);
fz_premultiply_pixmap(ctx, img);
- }
}
fz_catch(ctx)
{
diff --git a/source/fitz/pixmap.c b/source/fitz/pixmap.c
index 21e75764..296a4dee 100644
--- a/source/fitz/pixmap.c
+++ b/source/fitz/pixmap.c
@@ -715,18 +715,6 @@ fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix)
}
fz_pixmap *
-fz_ensure_pixmap_is_additive(fz_context *ctx, fz_pixmap *pix)
-{
- if (fz_colorspace_is_subtractive(ctx, pix->colorspace))
- {
- fz_pixmap *rgb = fz_convert_pixmap(ctx, pix, fz_device_rgb(ctx), NULL, NULL, NULL/* FIXME */, 1);
- fz_drop_pixmap(ctx, pix);
- return rgb;
- }
- return pix;
-}
-
-fz_pixmap *
fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray)
{
fz_pixmap *alpha;