diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-06 20:36:09 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-06 20:36:09 +0200 |
commit | 71b44f14fd09fe3cb404f6f9225b3e4987328e15 (patch) | |
tree | e96d368b12513abc40f34f3534a9266125f651b5 /fitz/res_bitmap.c | |
parent | 4a8af0a2b86fcb737cb7162b6e6926540f2f1af2 (diff) | |
download | mupdf-71b44f14fd09fe3cb404f6f9225b3e4987328e15.tar.xz |
Rename span to stride, and add gray->bgr fast path image drawing.
Diffstat (limited to 'fitz/res_bitmap.c')
-rw-r--r-- | fitz/res_bitmap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fitz/res_bitmap.c b/fitz/res_bitmap.c index 57784076..0b852af2 100644 --- a/fitz/res_bitmap.c +++ b/fitz/res_bitmap.c @@ -12,9 +12,9 @@ fz_new_bitmap(int w, int h, int n) bit->n = n; /* Span is 32 bit aligned. We may want to make this 64 bit if we * use SSE2 etc. */ - bit->span = ((n*w+31)&~31)>>3; + bit->stride = ((n * w + 31) & ~31) >> 3; - bit->samples = fz_calloc(h, bit->span); + bit->samples = fz_calloc(h, bit->stride); return bit; } @@ -39,7 +39,7 @@ fz_drop_bitmap(fz_bitmap *bit) void fz_clear_bitmap(fz_bitmap *bit) { - memset(bit->samples, 0, bit->span * bit->h); + memset(bit->samples, 0, bit->stride * bit->h); } /* @@ -51,7 +51,7 @@ fz_write_pbm(fz_bitmap *bitmap, char *filename) { FILE *fp; unsigned char *p; - int h, bytespan; + int h, bytestride; fp = fopen(filename, "wb"); if (!fp) @@ -64,11 +64,11 @@ fz_write_pbm(fz_bitmap *bitmap, char *filename) p = bitmap->samples; h = bitmap->h; - bytespan = (bitmap->w+7)>>3; + bytestride = (bitmap->w + 7) >> 3; while (h--) { - fwrite(p, 1, bytespan, fp); - p += bitmap->span; + fwrite(p, 1, bytestride, fp); + p += bitmap->stride; } fclose(fp); |