X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fexample%2Fjpegtest.c;h=4e195d900bca87396277ac9d9775e4217242a9ab;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=76eb1ea660edc0d235528cec15846da18bb5a805;hpb=fc554a43712b76d16b41ec77dd311b4a78b1ef6b;p=swftools.git diff --git a/lib/example/jpegtest.c b/lib/example/jpegtest.c index 76eb1ea..4e195d9 100644 --- a/lib/example/jpegtest.c +++ b/lib/example/jpegtest.c @@ -1,24 +1,47 @@ -// linux/gcc cc jpegtest.c ../rfxswf.c -funsigned-char -o jpegtest -lm -ljpeg; cp jpegtest /home/www/cgi-bin/jpegtest +/* jpegtest.c + + Example for including and mapping jpeg images to swf shapes + + Part of the swftools package. + + Copyright (c) 2000, 2001 Rainer Böhme + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include +#include +#include #include "../rfxswf.h" -#define WIDTH 256 -#define HEIGHT 256 -#define QUALITY 85 +#define WIDTH 256 +#define HEIGHT 256 +#define QUALITY 85 -#define ID_BITS 1 -#define ID_SHAPE 2 +#define ID_BITS 1 +#define ID_SHAPE 2 -int main ( int argc, char ** argv) +int main( int argc, char ** argv) { SWF swf; - LPTAG t; + TAG* t; RGBA rgb; - LPSHAPE s; + SHAPE* s; MATRIX m; SRECT r; - LPJPEGBITS jpeg; + JPEGBITS* jpeg; + + int f; // file handle int ls; // line style int fs; // fill style @@ -26,25 +49,27 @@ int main ( int argc, char ** argv) memset(&swf,0x00,sizeof(SWF)); - swf.FileVersion = 4; - swf.FrameRate = 0x1800; - swf.MovieSize.xmax = 20*WIDTH; - swf.MovieSize.ymax = 20*HEIGHT; + swf.fileVersion = 4; + swf.frameRate = 0x1800; + swf.movieSize.xmax = 20*WIDTH; + swf.movieSize.ymax = 20*HEIGHT; - swf.FirstTag = InsertTag(NULL,ST_SETBACKGROUNDCOLOR); - t = swf.FirstTag; + swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR); + t = swf.firstTag; rgb.r = 0xff; rgb.b = 0xff; rgb.g = 0xff; - SetRGB(t,&rgb); + swf_SetRGB(t,&rgb); - t = InsertTag(t,ST_DEFINEBITSJPEG2); + t = swf_InsertTag(t,ST_DEFINEBITSJPEG2); - SetU16(t,ID_BITS); - SetJPEGBits(t,"eye.jpg",QUALITY); + swf_SetU16(t,ID_BITS); +// swf_SetJPEGBits(t,"test.jpg",QUALITY); <- use this to include an image from disk -/* jpeg = SetJPEGBitsStart(t,WIDTH,HEIGHT,QUALITY); +// That's the way to use memory bitmaps (24bit,RGB) + + jpeg = swf_SetJPEGBitsStart(t,WIDTH,HEIGHT,QUALITY); { int y; for (y=0;y