18using namespace Magick;
19int main(
int argc,
char **argv)
23 cout <<
"Usage: " << argv[0] <<
" file..." << endl;
28 InitializeMagick(*argv);
31 std::list<std::string> attributes;
33 attributes.push_back(
"TopLeftColor");
34 attributes.push_back(
"TopRightColor");
35 attributes.push_back(
"BottomLeftColor");
36 attributes.push_back(
"BottomRightColor");
37 attributes.push_back(
"filter:brightness:mean");
38 attributes.push_back(
"filter:brightness:standard-deviation");
39 attributes.push_back(
"filter:brightness:kurtosis");
40 attributes.push_back(
"filter:brightness:skewness");
41 attributes.push_back(
"filter:saturation:mean");
42 attributes.push_back(
"filter:saturation:standard-deviation");
43 attributes.push_back(
"filter:saturation:kurtosis");
44 attributes.push_back(
"filter:saturation:skewness");
46 char **arg = &argv[1];
51 cout <<
"File: " << fname << endl;
55 image.process(
"analyze",0,0);
57 list<std::string>::iterator pos = attributes.begin();
58 while(pos != attributes.end())
60 cout <<
" " << setw(16) << setfill(
' ') << setiosflags(ios::left)
61 << *pos <<
" = " << image.attribute(*pos) << endl;
67 cout << error_.what() << endl;