summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-04-07 10:36:36 +0100
committerTor Andersson <tor.andersson@artifex.com>2011-04-07 21:05:29 +0200
commita9560ecb1b1140623d381ef04ede719cc9ff6819 (patch)
tree3f08ea6336db9cf347af1ffa72f643cc9a94caff /apps
parent73b82547b63bc1db4412b08d2967ca966fd8cb99 (diff)
downloadmupdf-a9560ecb1b1140623d381ef04ede719cc9ff6819.tar.xz
Add AA_BITS define to control antialias level of line art.
AA_BITS < 0 => Runtime configurable. AA_BITS = 0 => No antialiasing AA_BITS > 0 => At least that many bits of accuracy (to a max of 8). If unspecified, default is 8, so old behaviour is maintained.
Diffstat (limited to 'apps')
-rw-r--r--apps/pdfdraw.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index 69a7d3aa..4dd24ff2 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -21,6 +21,7 @@ int showtime = 0;
int showmd5 = 0;
int savealpha = 0;
int uselist = 1;
+int alphabits = 8;
fz_colorspace *colorspace;
fz_glyph_cache *glyphcache;
@@ -43,11 +44,12 @@ static void usage(void)
fprintf(stderr,
"usage: pdfdraw [options] input.pdf [pages]\n"
"\t-o -\toutput filename (%%d for page number)\n"
- "\t\tsupported formats: pgm, ppm, pam, png\n"
+ "\t\tsupported formats: pgm, ppm, pam, png, pbm\n"
"\t-p -\tpassword\n"
"\t-r -\tresolution in dpi (default: 72)\n"
"\t-A\tdisable accelerated functions\n"
"\t-a\tsave alpha channel (only pam and png)\n"
+ "\t-b -\tnumber of bits of antialiasing (0 to 8)\n"
"\t-g\trender in grayscale\n"
"\t-m\tshow timing information\n"
"\t-t\tshow text (-tt for xml)\n"
@@ -293,7 +295,7 @@ int main(int argc, char **argv)
fz_error error;
int c;
- while ((c = fz_getopt(argc, argv, "o:p:r:R:Aadgmtx5")) != -1)
+ while ((c = fz_getopt(argc, argv, "o:p:r:R:Aab:dgmtx5")) != -1)
{
switch (c)
{
@@ -303,6 +305,7 @@ int main(int argc, char **argv)
case 'R': rotation = atof(fz_optarg); break;
case 'A': accelerate = 0; break;
case 'a': savealpha = 1; break;
+ case 'b': alphabits = atoi(fz_optarg); break;
case 'm': showtime++; break;
case 't': showtext++; break;
case 'x': showxml++; break;
@@ -313,6 +316,8 @@ int main(int argc, char **argv)
}
}
+ fz_set_aa_level(alphabits);
+
if (fz_optind == argc)
usage();