00001 #include <cstdlib> 00002 00003 #include <oln/lrde/efigi/misc.hh> 00004 #include <oln/lrde/efigi/io.hh> 00005 #include <oln/lrde/efigi/req.hh> 00006 00007 #include <oln/convol/fast_gaussian.hh> 00008 00009 00010 00011 void usage(char* argv[]) 00012 { 00013 std::cerr << "usage: " << argv[0] 00014 << " input.pfm fileout.pfm x y dx dy" << std::endl; 00015 exit(0); 00016 } 00017 00018 00019 00020 00021 int main(int argc, char* argv[]) 00022 { 00023 using namespace oln; 00024 00025 if (argc != 7) 00026 usage(argv); 00027 00028 assert(sigma > 0); 00029 image2d<float> input = efigi::load_pfm(argv[1]); 00030 coord x = atoi(argv[3]); 00031 coord y = atoi(argv[4]); 00032 coord dx = atoi(argv[5]); 00033 coord dy = atoi(argv[6]); 00034 image2d<float> output = efigi::crop(input, x, y, dx, dy); 00035 efigi::save_pfm(output, argv[2]); 00036 }