summaryrefslogtreecommitdiff
path: root/apps/pdfdraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pdfdraw.c')
-rw-r--r--apps/pdfdraw.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index 4dd24ff2..a5f6aa1e 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -22,6 +22,8 @@ int showmd5 = 0;
int savealpha = 0;
int uselist = 1;
int alphabits = 8;
+float gamma_value = 1;
+int invert = 0;
fz_colorspace *colorspace;
fz_glyph_cache *glyphcache;
@@ -57,6 +59,8 @@ static void usage(void)
"\t-d\tdisable use of display list\n"
"\t-5\tshow md5 checksums\n"
"\t-R -\trotate clockwise by given number of degrees\n"
+ "\t-G gamma\tgamma correct output\n"
+ "\t-I\tinvert output\n"
"\tpages\tcomma separated list of ranges\n");
exit(1);
}
@@ -178,6 +182,11 @@ static void drawpage(pdf_xref *xref, int pagenum)
pdf_run_page(xref, page, dev, ctm);
fz_free_device(dev);
+ if (invert)
+ fz_invert_pixmap(pix);
+ if (gamma_value != 1)
+ fz_gamma_pixmap(pix, gamma_value);
+
if (output)
{
char buf[512];
@@ -295,7 +304,7 @@ int main(int argc, char **argv)
fz_error error;
int c;
- while ((c = fz_getopt(argc, argv, "o:p:r:R:Aab:dgmtx5")) != -1)
+ while ((c = fz_getopt(argc, argv, "o:p:r:R:Aab:dgmtx5G:I")) != -1)
{
switch (c)
{
@@ -312,6 +321,8 @@ int main(int argc, char **argv)
case '5': showmd5++; break;
case 'g': grayscale++; break;
case 'd': uselist = 0; break;
+ case 'G': gamma_value = atof(fz_optarg); break;
+ case 'I': invert++; break;
default: usage(); break;
}
}