Read an image file and write out a subimage
Usage: example_subimage infile outfile
#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/stdimagefunctions.hxx>
int main(int argc, char ** argv)
{
if(argc != 3)
{
std::cout << "Usage: " << argv[0] << " infile outfile" << std::endl;
std::cout << "(supported formats: " << impexListFormats() << ")" << std::endl;
return 1;
}
try
{
int sub_x0 = info.
width() / 4;
int sub_y0 = info.
height() / 4;
int sub_x1 = info.
width() - sub_x0;
int sub_y1 = info.
height() - sub_y0;
{
importImage(info, in);
}
else
{
importImage(info, in);
}
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}
Argument object for the function exportImage().
Definition imageinfo.hxx:134
Argument object for the function importImage().
Definition imageinfo.hxx:391
Base class for, and view to, vigra::MultiArray.
Definition multi_fwd.hxx:127
Main MultiArray class containing the memory management.
Definition multi_fwd.hxx:131
Class for fixed size vectors.
Definition tinyvector.hxx:1008
image import and export functions