From 84db74a6c8eadafcb8d4be2013c5e765341c30a6 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 16 Jan 2006 17:03:01 +0000 Subject: [PATCH] regenerated docs --- src/jpeg2swf.1 | 15 ++++++++++++++- src/jpeg2swf.c | 15 +++++++-------- src/png2swf.c | 28 +++++++++++++++++++--------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/jpeg2swf.1 b/src/jpeg2swf.1 index 96b9c20..ee87d2c 100644 --- a/src/jpeg2swf.1 +++ b/src/jpeg2swf.1 @@ -1,4 +1,4 @@ -.TH jpeg2swf "1" "January 2005" "jpeg2swf" "swftools" +.TH jpeg2swf "1" "January 2006" "jpeg2swf" "swftools" .SH NAME jpeg2swf - Converts jpeg images to SWF. @@ -29,6 +29,12 @@ converted picture is a seperate frame in the target SWF. Use Flash MX (SWF 6) Zlib encoding for the output. The resulting SWF will be smaller, but not playable in Flash Plugins of Version 5 and below. .TP +\fB\-x\fR, \fB\-\-xoffset\fR \fIoffset\fR + horizontally offset images by \fIoffset\fR +.TP +\fB\-y\fR, \fB\-\-yoffset\fR \fIoffset\fR + vertically offset images by \fIoffset\fR +.TP \fB\-X\fR, \fB\-\-width\fR \fIwidth\fR Force movie width to \fIwidth\fR (default: autodetect) .TP @@ -40,8 +46,15 @@ converted picture is a seperate frame in the target SWF. .TP \fB\-V\fR, \fB\-\-version\fR Print version information and exit +.TP +\fB\-f\fR, \fB\-\-fit-to-movie\fR + Fit images to movie size +.TP +\fB\-e\fR, \fB\-\-export\fR \fIassetname\fR + Make importable as asset with \fIassetname\fR .SH AUTHORS Rainer Böhme .TP Matthias Kramm + diff --git a/src/jpeg2swf.c b/src/jpeg2swf.c index 644df91..88688aa 100644 --- a/src/jpeg2swf.c +++ b/src/jpeg2swf.c @@ -487,14 +487,14 @@ static struct options_t options[] = { {"q", "quality"}, {"r", "rate"}, {"z", "zlib"}, -{"X", "width"}, -{"Y", "height"}, {"x", "xoffset"}, {"y", "yoffset"}, -{"e", "export"}, -{"f", "fit-to-movie"}, +{"X", "width"}, +{"Y", "height"}, {"v", "verbose"}, {"V", "version"}, +{"f", "fit-to-movie"}, +{"e", "export"}, {0,0} }; @@ -538,11 +538,10 @@ void args_callback_usage(char *name) printf("-y , --yoffset vertically offset images by \n"); printf("-X , --width Force movie width to (default: autodetect)\n"); printf("-Y , --height Force movie height to (default: autodetect)\n"); - printf("-f , --fit-to-movie Fit images to movie size\n"); - printf("-e , --export Make importable as asset with \n"); - printf("-v , --verbose Be verbose. Use more than one -v for greater effect \n"); - //printf("-q , --quiet Omit normal log messages, only log errors\n"); + printf("-v , --verbose Set verbose level to (0=quiet, 1=default, 2=debug)\n"); printf("-V , --version Print version information and exit\n"); + printf("-f , --fit-to-movie Fit images to movie size\n"); + printf("-e , --export Make importable as asset with \n"); printf("\n"); } diff --git a/src/png2swf.c b/src/png2swf.c index 541675d..abb654f 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -41,6 +41,7 @@ struct { int do_cgi; int version; char *outfile; + float scale; } global; struct { @@ -699,8 +700,8 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) swf_ShapeNew(&s); swf_GetMatrix(NULL, &m); - m.sx = 20 * 0x10000; - m.sy = 20 * 0x10000; + m.sx = (int)(20 * 0x10000); + m.sy = (int)(20 * 0x10000); m.tx = -10; m.ty = -10; fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 1); @@ -728,12 +729,15 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) t = swf_InsertTag(t, ST_PLACEOBJECT2); swf_GetMatrix(NULL, &m); + m.sx = (int)(0x10000 * global.scale); + m.sy = (int)(0x10000 * global.scale); + if(custom_move) { m.tx = move_x*20; m.ty = move_y*20; } else { - m.tx = (swf->movieSize.xmax - (int) header.width * 20) / 2; - m.ty = (swf->movieSize.ymax - (int) header.height * 20) / 2; + m.tx = (swf->movieSize.xmax - (int) (header.width * global.scale * 20)) / 2; + m.ty = (swf->movieSize.ymax - (int) (header.height * global.scale * 20)) / 2; } swf_ObjectPlace(t, id + 1, 50, &m, NULL, NULL); @@ -814,6 +818,11 @@ int args_callback_option(char *arg, char *val) res = 1; break; + case 's': + global.scale = atof(val)/100; + res = 1; + break; + case 'z': global.version = 6; res = 0; @@ -918,6 +927,7 @@ static struct options_t options[] = { {"q", "quiet"}, {"C", "cgi"}, {"V", "version"}, +{"s", "scale"}, {0,0} }; @@ -955,10 +965,11 @@ void args_callback_usage(char *name) printf("-z , --zlib Enable Flash 6 (MX) Zlib Compression\n"); printf("-X , --pixel Force movie width to (default: autodetect)\n"); printf("-Y , --pixel Force movie height to (default: autodetect)\n"); - printf("-v , --verbose Be verbose. Use more than one -v for greater effect \n"); + printf("-v , --verbose Set verbose level (0=quiet, 1=default, 2=debug)\n"); printf("-q , --quiet Omit normal log messages, only log errors\n"); printf("-C , --cgi For use as CGI- prepend http header, write to stdout\n"); printf("-V , --version Print version information and exit\n"); + printf("-s , --scale Scale image to % size.\n"); printf("\n"); } @@ -972,6 +983,7 @@ int main(int argc, char **argv) global.framerate = 1.0; global.verbose = 1; global.version = 4; + global.scale = 1.0; processargs(argc, argv); @@ -984,10 +996,8 @@ int main(int argc, char **argv) fprintf(stderr, "Processing %i file(s)...\n", global.nfiles); t = MovieStart(&swf, global.framerate, - global.force_width ? global.force_width : global. - max_image_width, - global.force_height ? global.force_height : global. - max_image_height); + global.force_width ? global.force_width : (int)(global.max_image_width*global.scale), + global.force_height ? global.force_height : (int)(global.max_image_height*global.scale)); { int i; -- 1.7.10.4