X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fswfrender.c;h=326a18492725b950ff0974c70a5c26613a07daf8;hb=4d0534b8a840785a6ad1d9f176d445b2275d2387;hp=b78255573dadaa87e99fd52391267a0c2cff2b55;hpb=8a72635ad068c485c42a794429e8242f9241b12b;p=swftools.git diff --git a/src/swfrender.c b/src/swfrender.c index b782555..326a184 100644 --- a/src/swfrender.c +++ b/src/swfrender.c @@ -10,12 +10,15 @@ #include "../lib/gfxsource.h" #include "../lib/readers/swf.h" #include "../lib/devices/render.h" +#include "../lib/devices/rescale.h" static struct options_t options[] = { {"h", "help"}, {"o", "output"}, {"l", "legacy"}, {"V", "version"}, +{"X", "width"}, +{"Y", "height"}, {0,0} }; @@ -24,6 +27,9 @@ static char*filename = 0; static char*outputname = "output.png"; static int quantize = 0; +static int width = 0; +static int height = 0; + int args_callback_option(char*name,char*val) { if(!strcmp(name, "V")) { @@ -38,6 +44,12 @@ int args_callback_option(char*name,char*val) } else if(!strcmp(name, "q")) { quantize = 1; return 0; + } else if(!strcmp(name, "X")) { + width = atoi(val); + return 1; + } else if(!strcmp(name, "Y")) { + height = atoi(val); + return 1; } else { printf("Unknown option: -%s\n", name); exit(1); @@ -113,9 +125,13 @@ int main(int argn, char*argv[]) } gfxdevice_t dev2,*dev=&dev2; gfxdevice_render_init(dev); + dev->setparameter(dev, "antialise", "4"); if(quantize) { dev->setparameter(dev, "palette", "1"); } + if(width || height) { + dev = gfxdevice_rescale_new(dev, width, height, 0); + } int t; for(t=1;t<=doc->num_pages;t++) {