#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
{
if(info.isGrayscale())
{
levels[0].
resize(info.width(), info.height());
for(int i=1; i<4; ++i)
{
reduceToNextLevel(levels[i-1], levels[i]);
}
}
else
{
levels[0].
resize(info.width(), info.height());
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;
}
Fundamental class template for images.
Definition basicimage.hxx:476
void resize(std::ptrdiff_t width, std::ptrdiff_t height)
Definition basicimage.hxx:778
Argument object for the function exportImage().
Definition imageinfo.hxx:134
Argument object for the function importImage().
Definition imageinfo.hxx:391
Generic 1 dimensional convolution kernel.
Definition separableconvolution.hxx:1367
Kernel1D & initExplicitly(int left, int right)
Definition separableconvolution.hxx:2100
void exportImage(...)
Write an image to a file.
void importImage(...)
Read an image from a file.
image import and export functions
void separableConvolveX(...)
Performs a 1 dimensional convolution in x direction.
BasicImage< RGBValue< UInt8 > > BRGBImage
Definition stdimage.hxx:164
std::string impexListFormats()
List the image formats VIGRA can read and write.
void separableConvolveY(...)
Performs a 1 dimensional convolution in y direction.
void resizeImageNoInterpolation(...)
Resize image by repeating the nearest pixel values.
BasicImage< UInt8 > BImage
Definition stdimage.hxx:62