Find the gray value profile along the image diagonal by means of a vigra::LineIterator
Usage: example_profile infile
, generates profile.gif
#include <iostream>
#include <vigra/stdimage.hxx>
#include <vigra/imageiteratoradapter.hxx>
{
{
std::cout <<
"Usage: " <<
argv[0] <<
" infile" << std::endl;
std::cout << "(supported formats: " << impexListFormats() << ")" << std::endl;
return 1;
}
try
{
vigra_precondition(
info.isGrayscale(),
"Sorry, cannot operate on color images");
importImage(
info, destImage(
in));
int length = (w <
h) ?
h : w;
BImage::Iterator column =
out.upperLeft() +
Diff2D(0, 255);
{
BImage::Iterator
row(column);
}
std::cout << "Writing profile.gif" << std::endl;
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}
Two dimensional difference vector.
Definition diff2d.hxx:186
Argument object for the function exportImage().
Definition imageinfo.hxx:134
Argument object for the function importImage().
Definition imageinfo.hxx:391
Class for a single RGB value.
Definition rgbvalue.hxx:128
image import and export functions