summaryrefslogtreecommitdiff
path: root/raster
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2008-07-06 18:15:34 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2008-07-06 18:15:34 +0200
commit36d5a7cc345aa4c1b46621bc54c37b638de632db (patch)
treeff9d17fefae1faae46317a7f48140f4068c35343 /raster
parent890f1b3f058fe33329b22c129f050f30aefaf719 (diff)
downloadmupdf-36d5a7cc345aa4c1b46621bc54c37b638de632db.tar.xz
Added support for debugging pixmap with one component and alpha.
Diffstat (limited to 'raster')
-rw-r--r--raster/pixmap.c5
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)