2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #define INPUT_FILENAME "morph_test1.swf"
23 #include "MovieTester.h"
24 #include "MovieClip.h"
25 #include "DisplayObject.h"
26 #include "DisplayList.h"
33 using namespace gnash
;
37 main(int /*argc*/, char** /*argv*/)
39 //string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
40 string filename
= string(INPUT_FILENAME
);
41 MovieTester
tester(filename
);
43 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
44 dbglogfile
.setVerbosity(1);
47 rgba
red(255,0,0,255); //start color
48 rgba
green(0,255,0,255); //end color
50 MovieClip
* root
= tester
.getRootMovie();
52 check_equals(root
->get_frame_count(), 7);
56 // fill color: 1.0*red + 0.0*green
57 // center coordinates: <start_x+50, start_y+50>
58 check_pixel(50, 50, 50, red
, 2); // morph ratio = 0
62 // 0.8*red + 0.2*green
63 // center coordinates: <0.8*start_x+0.2*end_x+50, 0.8*start_y+0.2*end_y+50>
64 check_pixel(190, 150, 50, rgba(204,51,0,255), 2); // morph ratio = 0.2
68 // fill color: 0.6*red + 0.4*green
69 check_pixel(330, 250, 50, rgba(153,102,0,255), 2); // morph ratio = 0.4
73 // fill color: 0.4*red + 0.6*green
74 check_pixel(470, 350, 50, rgba(102,153,0,255), 2); // morph ratio = 0.6
78 // fill color: 0.2*red + 0.8*green
79 check_pixel(610, 450, 50, rgba(51,204,0,255), 2); // morph ratio = 0.8
83 // fill color: 0.0*red + 1.0*green
84 check_pixel(750, 550, 50, rgba(0,255,0,255), 2); // morph ratio = 1.0