summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-12 15:05:16 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-12 15:05:16 +0000
commite49c70808fba2d0d2a691d1568d766bfeee863f0 (patch)
treea08e2c73b8cdae24627dcd762c7a78d318f60f07 /draw
parent2b7f3d1035f4bae9c189e0e6fcbb907ca46538c4 (diff)
downloadmupdf-e49c70808fba2d0d2a691d1568d766bfeee863f0.tar.xz
Change order of params in fz_convert_color to C standard.
C's standard is copy(dst, src), so we move to adopt that here. Hopefully no one is calling this routine other than us - if they are, then I apologise! Better to aim for consistency before we freeze the API at v1.0 than to carry an inconsistent API around ever after.
Diffstat (limited to 'draw')
-rw-r--r--draw/draw_device.c14
-rw-r--r--draw/draw_mesh.c4
2 files changed, 9 insertions, 9 deletions
diff --git a/draw/draw_device.c b/draw/draw_device.c
index e8356f6e..e2c22db1 100644
--- a/draw/draw_device.c
+++ b/draw/draw_device.c
@@ -248,7 +248,7 @@ fz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, fz_matrix ctm,
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
- fz_convert_color(dev->ctx, colorspace, color, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, colorspace, color);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = alpha * 255;
@@ -302,7 +302,7 @@ fz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, fz_
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
- fz_convert_color(dev->ctx, colorspace, color, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, colorspace, color);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = alpha * 255;
@@ -472,7 +472,7 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, fz_matrix ctm,
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
- fz_convert_color(dev->ctx, colorspace, color, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, colorspace, color);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = alpha * 255;
@@ -532,7 +532,7 @@ fz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke, fz_
if (state->blendmode & FZ_BLEND_KNOCKOUT)
state = fz_knockout_begin(dev);
- fz_convert_color(dev->ctx, colorspace, color, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, colorspace, color);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = alpha * 255;
@@ -775,7 +775,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha)
{
unsigned char *s;
int x, y, n, i;
- fz_convert_color(dev->ctx, shade->colorspace, shade->background, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, shade->colorspace, shade->background);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = 255;
@@ -1027,7 +1027,7 @@ fz_draw_fill_image_mask(fz_device *devp, fz_image *image, fz_matrix ctm,
pixmap = scaled;
}
- fz_convert_color(dev->ctx, colorspace, color, model, colorfv);
+ fz_convert_color(dev->ctx, model, colorfv, colorspace, color);
for (i = 0; i < model->n; i++)
colorbv[i] = colorfv[i] * 255;
colorbv[i] = alpha * 255;
@@ -1228,7 +1228,7 @@ fz_draw_begin_mask(fz_device *devp, fz_rect rect, int luminosity, fz_colorspace
float bc;
if (!colorspace)
colorspace = fz_device_gray;
- fz_convert_color(dev->ctx, colorspace, colorfv, fz_device_gray, &bc);
+ fz_convert_color(dev->ctx, fz_device_gray, &bc, colorspace, colorfv);
fz_clear_pixmap_with_value(dev->ctx, dest, bc * 255);
if (shape)
fz_clear_pixmap_with_value(dev->ctx, shape, 255);
diff --git a/draw/draw_mesh.c b/draw/draw_mesh.c
index e6812d77..1d6f1759 100644
--- a/draw/draw_mesh.c
+++ b/draw/draw_mesh.c
@@ -509,7 +509,7 @@ fz_paint_mesh(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest,
tri[k][2] = *mesh++ * 255;
else
{
- fz_convert_color(ctx, shade->colorspace, mesh, dest->colorspace, tri[k] + 2);
+ fz_convert_color(ctx, dest->colorspace, tri[k] + 2, shade->colorspace, mesh);
for (i = 0; i < dest->colorspace->n; i++)
tri[k][i + 2] *= 255;
mesh += shade->colorspace->n;
@@ -539,7 +539,7 @@ fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest,
{
for (i = 0; i < 256; i++)
{
- fz_convert_color(ctx, shade->colorspace, shade->function[i], dest->colorspace, color);
+ fz_convert_color(ctx, dest->colorspace, color, shade->colorspace, 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;