diff options
author | Robin Watts <robin.watts@artifex.com> | 2017-07-13 17:32:32 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-09-08 17:48:07 +0100 |
commit | 7e4a177d55b3a290300f6671c0670e5a5897da24 (patch) | |
tree | 81190342149dc508787247efa78854383997cad8 /source/gprf | |
parent | a7f36241cba4d1807ab4664201aa0975755d6772 (diff) | |
download | mupdf-7e4a177d55b3a290300f6671c0670e5a5897da24.tar.xz |
Update fz_separations equivalent color mechanism.
Incorporates fixes from Michael.
Rather than specifically giving it rgb and cmyk values,
separations now include the colorspace. Conversions can
then be done into ANY colorspace we need.
Note, that we maintain the old way of working for the
gproof device.
Also, fix pdf_page_separations to correctly find all separations.
This involves recursively looking through colorspaces, forms
and shadings for colorspaces therein, making sure we don't run
into any circular references.
We do 2 passes, so that we can pick up as many colorants as Separations
as possible. On the second pass we pick up any colorants we missed in
terms of DeviceN spaces. The purpose of this is to try to ensure that
we get as many tint transforms as single input functions as we can.
This may not be important in the grand scheme of things, but seems
neater.
Diffstat (limited to 'source/gprf')
-rw-r--r-- | source/gprf/gprf-doc.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c index 74b50a9b..f66d78bb 100644 --- a/source/gprf/gprf-doc.c +++ b/source/gprf/gprf-doc.c @@ -368,13 +368,13 @@ gprf_get_pixmap(fz_context *ctx, fz_image *image_, fz_irect *area, int w, int h, read_sep[i] = !FZ_SEPARATION_DISABLED(ctx, image->separations, i-3); if (read_sep[i]) { - uint32_t rgb, cmyk; + float cmyk[4]; - (void)fz_get_separation(ctx, image->separations, i - 3, &rgb, &cmyk); - equiv[i][0] = (cmyk>> 0) & 0xFF; - equiv[i][1] = (cmyk>> 8) & 0xFF; - equiv[i][2] = (cmyk>>16) & 0xFF; - equiv[i][3] = (cmyk>>24) & 0xFF; + (void)fz_separation_equivalent(ctx, image->separations, i - 3, NULL, fz_device_cmyk(ctx), NULL, cmyk); + equiv[i][0] = cmyk[0] * 0xFF; + equiv[i][1] = cmyk[1] * 0xFF; + equiv[i][2] = cmyk[2] * 0xFF; + equiv[i][3] = cmyk[3] * 0xFF; } } } @@ -744,7 +744,7 @@ read_tiles(fz_context *ctx, gprf_page *page) int32_t rgba = fz_read_int32_le(ctx, file); int32_t cmyk = fz_read_int32_le(ctx, file); fz_read_string(ctx, file, blatter, sizeof(blatter)); - fz_add_separation(ctx, page->separations, rgba, cmyk, blatter); + fz_add_separation_equivalents(ctx, page->separations, rgba, cmyk, blatter); } /* Seek to the image data */ @@ -854,13 +854,6 @@ static int gprf_separation_disabled(fz_context *ctx, fz_page *page_, int sep) return FZ_SEPARATION_DISABLED(ctx, page->separations, sep); } -static const char *gprf_get_separation(fz_context *ctx, fz_page *page_, int sep, uint32_t *rgba, uint32_t*cmyk) -{ - gprf_page *page = (gprf_page *)page_; - - return fz_get_separation(ctx, page->separations, sep, rgba, cmyk); -} - static fz_separations * gprf_separations(fz_context *ctx, fz_page *page_) { |