summaryrefslogtreecommitdiff
path: root/fitz/res_colorspace.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-12 14:45:25 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-12 14:45:25 +0000
commit2b7f3d1035f4bae9c189e0e6fcbb907ca46538c4 (patch)
tree38d0e1a3d8d9fc9d5a94514cbe46389a23d8518f /fitz/res_colorspace.c
parentbc9e8f1d6c18b8b37678a07e9266f269fe5bf0dc (diff)
downloadmupdf-2b7f3d1035f4bae9c189e0e6fcbb907ca46538c4.tar.xz
Change order of params in fz_convert_pixmap 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 'fitz/res_colorspace.c')
-rw-r--r--fitz/res_colorspace.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/fitz/res_colorspace.c b/fitz/res_colorspace.c
index 1c26d1b3..45d57113 100644
--- a/fitz/res_colorspace.c
+++ b/fitz/res_colorspace.c
@@ -180,7 +180,7 @@ fz_find_device_colorspace(char *name)
/* Fast pixmap color conversions */
-static void fast_gray_to_rgb(fz_pixmap *src, fz_pixmap *dst)
+static void fast_gray_to_rgb(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -196,7 +196,7 @@ static void fast_gray_to_rgb(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_gray_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
+static void fast_gray_to_cmyk(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -213,7 +213,7 @@ static void fast_gray_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_rgb_to_gray(fz_pixmap *src, fz_pixmap *dst)
+static void fast_rgb_to_gray(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -227,7 +227,7 @@ static void fast_rgb_to_gray(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_bgr_to_gray(fz_pixmap *src, fz_pixmap *dst)
+static void fast_bgr_to_gray(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -241,7 +241,7 @@ static void fast_bgr_to_gray(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_rgb_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
+static void fast_rgb_to_cmyk(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -262,7 +262,7 @@ static void fast_rgb_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_bgr_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
+static void fast_bgr_to_cmyk(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -283,7 +283,7 @@ static void fast_bgr_to_cmyk(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_cmyk_to_gray(fz_pixmap *src, fz_pixmap *dst)
+static void fast_cmyk_to_gray(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -300,7 +300,7 @@ static void fast_cmyk_to_gray(fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
+static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -328,7 +328,7 @@ static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_cmyk_to_bgr(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
+static void fast_cmyk_to_bgr(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -356,7 +356,7 @@ static void fast_cmyk_to_bgr(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
}
}
-static void fast_rgb_to_bgr(fz_pixmap *src, fz_pixmap *dst)
+static void fast_rgb_to_bgr(fz_pixmap *dst, fz_pixmap *src)
{
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
@@ -373,7 +373,7 @@ static void fast_rgb_to_bgr(fz_pixmap *src, fz_pixmap *dst)
}
static void
-fz_std_conv_pixmap(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
+fz_std_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)
{
float srcv[FZ_MAX_COLORS];
float dstv[FZ_MAX_COLORS];
@@ -499,7 +499,7 @@ fz_std_conv_pixmap(fz_context *ctx, fz_pixmap *src, fz_pixmap *dst)
}
void
-fz_convert_pixmap(fz_context *ctx, fz_pixmap *sp, fz_pixmap *dp)
+fz_convert_pixmap(fz_context *ctx, fz_pixmap *dp, fz_pixmap *sp)
{
fz_colorspace *ss = sp->colorspace;
fz_colorspace *ds = dp->colorspace;
@@ -510,37 +510,37 @@ fz_convert_pixmap(fz_context *ctx, fz_pixmap *sp, fz_pixmap *dp)
if (ss == fz_device_gray)
{
- if (ds == fz_device_rgb) fast_gray_to_rgb(sp, dp);
- else if (ds == fz_device_bgr) fast_gray_to_rgb(sp, dp); /* bgr == rgb here */
- else if (ds == fz_device_cmyk) fast_gray_to_cmyk(sp, dp);
- else fz_std_conv_pixmap(ctx, sp, dp);
+ if (ds == fz_device_rgb) fast_gray_to_rgb(dp, sp);
+ else if (ds == fz_device_bgr) fast_gray_to_rgb(dp, sp); /* bgr == rgb here */
+ else if (ds == fz_device_cmyk) fast_gray_to_cmyk(dp, sp);
+ else fz_std_conv_pixmap(ctx, dp, sp);
}
else if (ss == fz_device_rgb)
{
- if (ds == fz_device_gray) fast_rgb_to_gray(sp, dp);
- else if (ds == fz_device_bgr) fast_rgb_to_bgr(sp, dp);
- else if (ds == fz_device_cmyk) fast_rgb_to_cmyk(sp, dp);
- else fz_std_conv_pixmap(ctx, sp, dp);
+ if (ds == fz_device_gray) fast_rgb_to_gray(dp, sp);
+ else if (ds == fz_device_bgr) fast_rgb_to_bgr(dp, sp);
+ else if (ds == fz_device_cmyk) fast_rgb_to_cmyk(dp, sp);
+ else fz_std_conv_pixmap(ctx, dp, sp);
}
else if (ss == fz_device_bgr)
{
- if (ds == fz_device_gray) fast_bgr_to_gray(sp, dp);
- else if (ds == fz_device_rgb) fast_rgb_to_bgr(sp, dp); /* bgr = rgb here */
+ if (ds == fz_device_gray) fast_bgr_to_gray(dp, sp);
+ else if (ds == fz_device_rgb) fast_rgb_to_bgr(dp, sp); /* bgr = rgb here */
else if (ds == fz_device_cmyk) fast_bgr_to_cmyk(sp, dp);
- else fz_std_conv_pixmap(ctx, sp, dp);
+ else fz_std_conv_pixmap(ctx, dp, sp);
}
else if (ss == fz_device_cmyk)
{
- if (ds == fz_device_gray) fast_cmyk_to_gray(sp, dp);
- else if (ds == fz_device_bgr) fast_cmyk_to_bgr(ctx, sp, dp);
- else if (ds == fz_device_rgb) fast_cmyk_to_rgb(ctx, sp, dp);
- else fz_std_conv_pixmap(ctx, sp, dp);
+ if (ds == fz_device_gray) fast_cmyk_to_gray(dp, sp);
+ else if (ds == fz_device_bgr) fast_cmyk_to_bgr(ctx, dp, sp);
+ else if (ds == fz_device_rgb) fast_cmyk_to_rgb(ctx, dp, sp);
+ else fz_std_conv_pixmap(ctx, dp, sp);
}
- else fz_std_conv_pixmap(ctx, sp, dp);
+ else fz_std_conv_pixmap(ctx, dp, sp);
}
/* Convert a single color */