#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/rgbvalue.hxx>
#include <vigra/resizeimage.hxx>
template<class ImageType>
int method, const char *outputFilename)
{
ImageType in(info.
shape());
ImageType out(newSize);
importImage(info, destImage(in));
switch(method)
{
case 0:
break;
case 1:
break;
case 2:
BSpline<2, double>());
break;
case 3:
BSpline<3, double>());
break;
case 4:
BSpline<4, double>());
break;
case 5:
BSpline<5, double>());
break;
case 6:
BSpline<6, double>());
break;
case 7:
BSpline<7, double>());
break;
default:
std::cerr << "Invalid method " << method << " (must be 0..7)!\n";
return false;
}
return true;
}
int main(int argc, char ** argv)
{
using namespace vigra;
if((argc < 3) || (argc > 5))
{
std::cout << "Usage: " << argv[0] << " infile outfile [factor] [method]" << std::endl;
std::cout << "If factor or method are not provided, you will be asked for\nthem on the command line." << std::endl;
return 1;
}
try
{
double sizefactor;
if(argc > 3)
{
sizefactor = atof(argv[3]);
}
else
{
std::cerr << "Resize factor ? ";
std::cin >> sizefactor;
}
int method;
if(argc > 4)
{
method = atoi(argv[4]);
}
else
{
std::cerr << "Method (0: pixel repetition, 1: linear, 2-7: spline) ? ";
std::cin >> method;
}
Shape2 newSize((info.shape() - Shape2(1,1)) * sizefactor + Shape2(1,1));
if(info.isGrayscale())
{
return 1;
}
else
{
return 1;
}
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}