diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2008-07-06 18:15:34 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2008-07-06 18:15:34 +0200 |
commit | 36d5a7cc345aa4c1b46621bc54c37b638de632db (patch) | |
tree | ff9d17fefae1faae46317a7f48140f4068c35343 /raster | |
parent | 890f1b3f058fe33329b22c129f050f30aefaf719 (diff) | |
download | mupdf-36d5a7cc345aa4c1b46621bc54c37b638de632db.tar.xz |
Added support for debugging pixmap with one component and alpha.
Diffstat (limited to 'raster')
-rw-r--r-- | raster/pixmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/raster/pixmap.c b/raster/pixmap.c index e6e27401..d1c5e99b 100644 --- a/raster/pixmap.c +++ b/raster/pixmap.c @@ -131,15 +131,20 @@ fz_debugpixmap(fz_pixmap *pix) { int x, y; FILE *pgm = fopen("out.pgm", "wb"); + FILE *pgm2 = fopen("out2.pgm", "wb"); fprintf(pgm, "P5\n%d %d\n255\n", pix->w, pix->h); + fprintf(pgm2, "P5\n%d %d\n255\n", pix->w, pix->h); for (y = 0; y < pix->h; y++) for (x = 0; x < pix->w; x++) { + int a = pix->samples[x * pix->n + y * pix->w * pix->n + 0]; int g = pix->samples[x * pix->n + y * pix->w * pix->n + 1]; + fputc(a, pgm2); fputc(g, pgm); } fclose(pgm); + fclose(pgm2); } else if (pix->n == 1) |