add blend mode tests
[swfdec.git] / test / image / morph-end.c
blob2445796388c2c1e65f825466ba77c01df4e3c540
1 /* gcc -Wall `pkg-config --libs --cflags libming glib-2.0` morph-end.c -o morph-end && ./morph-end
2 */
4 #include <ming.h>
5 #include <glib.h>
6 #include <stdio.h>
8 extern void
9 SWFMatrix_set (SWFMatrix m, float a, float b, float c, float d, int x, int y);
12 static void do_shape (SWFShape shape, int i)
14 SWFFillStyle style;
16 style = SWFShape_addSolidFillStyle (shape, 255, i ? 255 : 0, 0, 255);
18 i = i ? 10 : 50;
19 SWFShape_setLeftFillStyle (shape, style);
20 SWFShape_movePenTo (shape, i, i);
21 SWFShape_drawLineTo (shape, i, 2 * i);
22 SWFShape_drawLineTo (shape, 2 * i, 2 * i);
23 SWFShape_drawLineTo (shape, 2 * i, i);
24 SWFShape_drawLineTo (shape, i, i);
28 static void
29 do_movie (int version)
31 SWFMovie movie;
32 SWFMorph morph;
33 SWFDisplayItem item;
34 char *s;
36 movie = newSWFMovieWithVersion (version);
37 SWFMovie_setRate (movie, 1);
38 SWFMovie_setDimension (movie, 200, 150);
40 morph = newSWFMorphShape ();
42 do_shape (SWFMorph_getShape1 (morph), 0);
43 do_shape (SWFMorph_getShape2 (morph), 1);
44 item = SWFMovie_add (movie, morph);
45 SWFDisplayItem_setRatio (item, 1.0);
46 SWFMovie_nextFrame (movie);
48 s = g_strdup_printf ("morph-end-%d.swf", version);
49 SWFMovie_save (movie, s);
50 g_free (s);
53 int
54 main (int argc, char **argv)
56 int i;
58 if (Ming_init ())
59 return 1;
61 for (i = 4; i < 9; i++)
62 do_movie (i);
64 return 0;