summaryrefslogtreecommitdiff
path: root/fitz/res_pixmap.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-07-05 17:55:18 +0100
committerRobin Watts <robin.watts@artifex.com>2012-07-05 18:02:03 +0100
commiteeaccf8444a4884801a92c0d23f66bd54c986a67 (patch)
treefc9e254dfeef4d61a80aace2f5dbbcd985580a9a /fitz/res_pixmap.c
parentb81be8d34b179d48e677463bd7b66ffdea129517 (diff)
parent15fc25b0055dbdbfaf4257ac908d43fd5a2da19d (diff)
downloadmupdf-eeaccf8444a4884801a92c0d23f66bd54c986a67.tar.xz
Merge branch 'master' into forms
Diffstat (limited to 'fitz/res_pixmap.c')
-rw-r--r--fitz/res_pixmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c
index b7cf5f58..e9dea86a 100644
--- a/fitz/res_pixmap.c
+++ b/fitz/res_pixmap.c
@@ -136,7 +136,7 @@ fz_pixmap_height(fz_context *ctx, fz_pixmap *pix)
void
fz_clear_pixmap(fz_context *ctx, fz_pixmap *pix)
{
- memset(pix->samples, 0, (unsigned int)(pix->w * pix->h * pix->n));
+ memset(pix->samples, 0, (unsigned int)(pix->w * pix->h * pix->n));
}
void
@@ -223,7 +223,7 @@ fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, fz_bbox r)
for (x = w; x > 0; x--)
{
int v;
- v = *srcp++;
+ v = *srcp++;
v += *srcp++;
v += *srcp++;
*destp++ = (unsigned char)((v+1)/3);
@@ -384,10 +384,10 @@ void fz_invert_pixmap_rect(fz_pixmap *image, fz_bbox rect)
unsigned char *p;
int x, y, n;
- int x0 = CLAMP(rect.x0 - image->x, 0, image->w - 1);
- int x1 = CLAMP(rect.x1 - image->x, 0, image->w - 1);
- int y0 = CLAMP(rect.y0 - image->y, 0, image->h - 1);
- int y1 = CLAMP(rect.y1 - image->y, 0, image->h - 1);
+ int x0 = fz_clampi(rect.x0 - image->x, 0, image->w - 1);
+ int x1 = fz_clampi(rect.x1 - image->x, 0, image->w - 1);
+ int y0 = fz_clampi(rect.y0 - image->y, 0, image->h - 1);
+ int y1 = fz_clampi(rect.y1 - image->y, 0, image->h - 1);
for (y = y0; y < y1; y++)
{