16using namespace Magick;
17int main(
int argc,
char **argv)
21 cout <<
"Usage: " << argv[0] <<
" file..." << endl;
26 InitializeMagick(*argv);
29 std::list<std::string> attributes;
31 attributes.push_back(
"TopLeftColor");
32 attributes.push_back(
"TopRightColor");
33 attributes.push_back(
"BottomLeftColor");
34 attributes.push_back(
"BottomRightColor");
35 attributes.push_back(
"filter:brightness:mean");
36 attributes.push_back(
"filter:brightness:standard-deviation");
37 attributes.push_back(
"filter:brightness:kurtosis");
38 attributes.push_back(
"filter:brightness:skewness");
39 attributes.push_back(
"filter:saturation:mean");
40 attributes.push_back(
"filter:saturation:standard-deviation");
41 attributes.push_back(
"filter:saturation:kurtosis");
42 attributes.push_back(
"filter:saturation:skewness");
44 char **arg = &argv[1];
49 cout <<
"File: " << fname << endl;
53 image.process(
"analyze",0,0);
55 list<std::string>::iterator pos = attributes.begin();
56 while(pos != attributes.end())
58 cout <<
" " << setw(16) << setfill(
' ') << setiosflags(ios::left)
59 << *pos <<
" = " << image.attribute(*pos) << endl;
65 cout << error_.what() << endl;