This source file includes following definitions.
- main
#include <Magick++.h>
#include <iostream>
#include <iomanip>
#include <list>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
if ( argc < 2 )
{
cout << "Usage: " << argv[0] << " file..." << endl;
exit( 1 );
}
InitializeMagick(*argv);
{
std::list<std::string> attributes;
attributes.push_back("TopLeftColor");
attributes.push_back("TopRightColor");
attributes.push_back("BottomLeftColor");
attributes.push_back("BottomRightColor");
attributes.push_back("filter:brightness:mean");
attributes.push_back("filter:brightness:standard-deviation");
attributes.push_back("filter:brightness:kurtosis");
attributes.push_back("filter:brightness:skewness");
attributes.push_back("filter:saturation:mean");
attributes.push_back("filter:saturation:standard-deviation");
attributes.push_back("filter:saturation:kurtosis");
attributes.push_back("filter:saturation:skewness");
char **arg = &argv[1];
while ( *arg )
{
string fname(*arg);
try {
cout << "File: " << fname << endl;
Image image( fname );
image.process("analyze",0,0);
list<std::string>::iterator pos = attributes.begin();
while(pos != attributes.end())
{
cout << " " << setw(16) << setfill(' ') << setiosflags(ios::left)
<< *pos << " = " << image.attribute(*pos) << endl;
pos++;
}
}
catch( Exception &error_ )
{
cout << error_.what() << endl;
}
++arg;
}
}
return 0;
}