diff options
author | Glenn Kennard <glenn.kennard@gmail.com> | 2005-10-03 19:36:34 +0200 |
---|---|---|
committer | Glenn Kennard <glenn.kennard@gmail.com> | 2005-10-03 19:36:34 +0200 |
commit | 3d58249f61401dc2a2957531fe278a575384fd3c (patch) | |
tree | 2eb3e5b89a835fed8cdcf14e66e3994a50628399 /apps/unix/x11pdf.c | |
parent | 2366ad7de028d397fbd6ed4d7a5d5d1b7915b6cf (diff) | |
download | mupdf-3d58249f61401dc2a2957531fe278a575384fd3c.tar.xz |
small optimizations
Optimize some common image code paths.
Diffstat (limited to 'apps/unix/x11pdf.c')
-rw-r--r-- | apps/unix/x11pdf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c index 5941d4d0..54aaae36 100644 --- a/apps/unix/x11pdf.c +++ b/apps/unix/x11pdf.c @@ -200,7 +200,7 @@ static void fillrect(int x, int y, int w, int h) static void invertcopyrect() { - unsigned char *p; + unsigned t, *p; int x, y; int x0 = gapp.selr.x0 - gapp.panx; @@ -215,14 +215,11 @@ static void invertcopyrect() for (y = y0; y < y1; y++) { - p = gapp.image->samples + (y * gapp.image->w + x0) * 4; + p = (unsigned *)(gapp.image->samples + (y * gapp.image->w + x0) * 4); for (x = x0; x < x1; x++) { - p[0] = 255 - p[0]; - p[1] = 255 - p[1]; - p[2] = 255 - p[2]; - p[3] = 255 - p[3]; - p += 4; + *p = ~0 - *p; + p ++; } } |