|
Revision 1, 1.3 KB
(checked in by cristy, 7 months ago)
|
|
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | #include <Magick++.h> |
|---|
| 9 | #include <string> |
|---|
| 10 | #include <iostream> |
|---|
| 11 | #include <list> |
|---|
| 12 | #include <vector> |
|---|
| 13 | |
|---|
| 14 | using namespace std; |
|---|
| 15 | |
|---|
| 16 | using namespace Magick; |
|---|
| 17 | |
|---|
| 18 | int main( int , char **argv) |
|---|
| 19 | { |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | InitializeMagick(*argv); |
|---|
| 23 | |
|---|
| 24 | int failures=0; |
|---|
| 25 | |
|---|
| 26 | try { |
|---|
| 27 | |
|---|
| 28 | string srcdir(""); |
|---|
| 29 | if(getenv("SRCDIR") != 0) |
|---|
| 30 | srcdir = getenv("SRCDIR"); |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | list<Image> imageList; |
|---|
| 37 | readImages( &imageList, srcdir + "test_image_anim.miff" ); |
|---|
| 38 | |
|---|
| 39 | list<Image> morphed; |
|---|
| 40 | morphImages( &morphed, imageList.begin(), imageList.end(), 3 ); |
|---|
| 41 | |
|---|
| 42 | if ( morphed.size() != 21 ) |
|---|
| 43 | { |
|---|
| 44 | ++failures; |
|---|
| 45 | cout << "Line: " << __LINE__ |
|---|
| 46 | << " Morph images failed, number of frames is " |
|---|
| 47 | << morphed.size() |
|---|
| 48 | << " rather than 21 as expected." << endl; |
|---|
| 49 | } |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | catch( Exception &error_ ) |
|---|
| 53 | { |
|---|
| 54 | cout << "Caught exception: " << error_.what() << endl; |
|---|
| 55 | return 1; |
|---|
| 56 | } |
|---|
| 57 | catch( exception &error_ ) |
|---|
| 58 | { |
|---|
| 59 | cout << "Caught exception: " << error_.what() << endl; |
|---|
| 60 | return 1; |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | if ( failures ) |
|---|
| 64 | { |
|---|
| 65 | cout << failures << " failures" << endl; |
|---|
| 66 | return 1; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | return 0; |
|---|
| 70 | } |
|---|