contrib/tbl/vipl/vipl_convert.txx
Go to the documentation of this file.
00001 #ifndef vipl_convert_txx_
00002 #define vipl_convert_txx_
00003 
00004 #include "vipl_convert.h"
00005 
00006 #include <vcl_compiler.h>
00007 #ifdef VCL_VC
00008 # pragma warning(disable:4244) // disable conversion warning for explicit cast at line 23
00009 #endif
00010 
00011 template <class ImgIn,class ImgOut,class DataIn,class DataOut,class PixelItr>
00012 bool vipl_convert <ImgIn,ImgOut,DataIn,DataOut,PixelItr> :: section_applyop()
00013 {
00014   const ImgIn &in = this->in_data(0);
00015   ImgOut &out = this->out_data(0);
00016 
00017   int startx = vipl_filter<ImgIn,ImgOut,DataIn,DataOut,2,PixelItr>::start(this->X_Axis());
00018   int starty = vipl_filter<ImgIn,ImgOut,DataIn,DataOut,2,PixelItr>::start(this->Y_Axis());
00019   int stopx  = vipl_filter<ImgIn,ImgOut,DataIn,DataOut,2,PixelItr>::stop(this->X_Axis());
00020   int stopy  = vipl_filter<ImgIn,ImgOut,DataIn,DataOut,2,PixelItr>::stop(this->Y_Axis());
00021   for (int j = starty; j < stopy; ++j)
00022     for (int i = startx; i < stopx; ++i)
00023       fsetpixel(out, i, j, (DataOut)fgetpixel(in,i,j,DataIn(0)));
00024   return true;
00025 }
00026 
00027 #endif // vipl_convert_txx_