16using namespace Magick;
18int main(
int ,
char ** )
30 if(getenv(
"SRCDIR") != 0)
31 srcdir = getenv(
"SRCDIR");
37 list<Image> imageList;
38 readImages( &imageList, srcdir +
"test_image_anim.miff" );
40 vector<Image> montage;
44 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
48 if ( montage[0].montageGeometry() != targetGeometry )
51 cout <<
"Line: " << __LINE__
52 <<
" Montage geometry ("
53 << string(montage[0].montageGeometry())
54 <<
") is incorrect (expected "
55 << string(targetGeometry)
61 if ( montage[0].columns() != 768 || montage[0].rows() != 504 )
64 cout <<
"Line: " << __LINE__
65 <<
" Montage columns/rows ("
66 << montage[0].columns() <<
"x"
68 <<
") incorrect. (expected 768x504)" << endl;
73 montageOpts.borderColor(
"green" );
74 montageOpts.borderWidth( 1 );
75 montageOpts.compose( OverCompositeOp );
76 montageOpts.fileName(
"Montage" );
77 montageOpts.frameGeometry(
"6x6+3+3" );
78 montageOpts.geometry(
"50x50+2+2>");
79 montageOpts.gravity( CenterGravity );
80 montageOpts.penColor(
"yellow" );
81 montageOpts.shadow(
true );
82 montageOpts.texture(
"granite:" );
83 montageOpts.tile(
"2x1");
84 montageImages( &montage, imageList.begin(), imageList.end(), montageOpts );
86 if ( montage.size() != 3 )
89 cout <<
"Line: " << __LINE__
90 <<
" Montage images failed, number of montage frames is "
92 <<
" rather than 3 as expected." << endl;
97 if ( montage[0].montageGeometry() != targetGeometry )
100 cout <<
"Line: " << __LINE__
101 <<
" Montage geometry ("
102 << string(montage[0].montageGeometry())
103 <<
") is incorrect (expected "
104 << string(targetGeometry)
110 if ( montage[0].columns() != 136 || montage[0].rows() != 70 )
113 cout <<
"Line: " << __LINE__
114 <<
" Montage columns/rows ("
115 << montage[0].columns() <<
"x"
117 <<
") incorrect. (expected 136x70)" << endl;
123 cout <<
"Caught exception: " << error_.what() << endl;
126 catch( exception &error_ )
128 cout <<
"Caught exception: " << error_.what() << endl;
134 cout << failures <<
" failures" << endl;