#include <iostream>
#include <stdio.h>
#include "vigra/stdimage.hxx"
#include "vigra/convolution.hxx"
#include "vigra/resizeimage.hxx"
template <class Image>
void reduceToNextLevel(Image & in, Image & out)
{
int width = in.width();
int height = in.height();
int newwidth = (width + 1) / 2;
int newheight = (height + 1) / 2;
out.resize(newwidth, newheight);
destImage(tmpimage1), kernel1d(filter));
destImage(tmpimage2), kernel1d(filter));
}
int main(int argc, char ** argv)
{
if(argc != 3)
{
std::cout << "Usage: " << argv[0] << " infile outfile" << std::endl;
return 1;
}
try
{
{
for(int i=1; i<4; ++i)
{
reduceToNextLevel(levels[i-1], levels[i]);
}
}
else
{
for(int i=1; i<4; ++i)
{
reduceToNextLevel(levels[i-1], levels[i]);
}
}
}
catch (vigra::StdException & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}