summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-12-03 15:58:57 +0000
committerRobin Watts <robin.watts@artifex.com>2012-12-09 07:25:41 -0800
commit0236c79d8db96ce4598742b0211f9aa58269f819 (patch)
tree7a7c342a073ee9ebd88a3bbdb20f75cbe2bc0fa6 /draw
parent519087f4f29aad524c9e12c64946cb242a05a5a9 (diff)
downloadmupdf-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.c4
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;