2 #include <cpPlugins/Interface.h>
4 int main( int argc, char* argv[] )
9 std::cerr << "Usage: " << argv[ 0 ] << " image_file(s)" << std::endl;
14 // Create interface and load library
15 cpPlugins::Interface interface;
18 interface.LoadEnvironment( );
19 interface.GuessPlugins( );
21 catch( std::exception& err )
23 std::cerr << "Error caught: " << err.what( ) << std::endl;
29 auto reader = interface.CreateProcessObject( "IO", "ImageReader" );
30 if( reader.IsNull( ) )
33 << "Error caugh: Could not create a valid image reader."
40 auto parameters = reader->GetParameters( );
41 for( int i = 1; i < argc; ++i )
42 parameters->AddToOpenFileNameList( "FileNames", argv[ i ] );
47 reader->PrintExecutionOn( );
50 catch( std::exception& err )
52 std::cerr << "Error caugth: " << err.what( ) << std::endl;
57 // Show simple information
58 reader->GetOutputData( "Output" )->Print( std::cout );