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 /draw | |
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 'draw')
-rw-r--r-- | draw/draw_mesh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c index 14470da6..03d187f7 100644 --- a/draw/draw_mesh.c +++ b/draw/draw_mesh.c @@ -367,9 +367,11 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, if (shade->use_function) { + fz_color_converter cc; + fz_find_color_converter(&cc, ctx, dest->colorspace, shade->colorspace); for (i = 0; i < 256; i++) { - fz_convert_color(ctx, dest->colorspace, color, shade->colorspace, shade->function[i]); + cc.convert(&cc, color, shade->function[i]); for (k = 0; k < dest->colorspace->n; k++) clut[i][k] = color[k] * 255; clut[i][k] = shade->function[i][shade->colorspace->n] * 255; |