Go to the documentation of this file.00001
00002 #ifndef vil3d_decimate_h_
00003 #define vil3d_decimate_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011 #include <vil3d/vil3d_fwd.h>
00012
00013
00014
00015
00016
00017
00018
00019
00020 template<class T>
00021 inline vil3d_image_view<T> vil3d_decimate(const vil3d_image_view<T> &im,
00022 unsigned i_factor, unsigned j_factor=0, unsigned k_factor=0)
00023 {
00024 if (j_factor==0) j_factor=i_factor;
00025 if (k_factor==0) k_factor=i_factor;
00026
00027 return vil3d_image_view<T>(
00028 im.memory_chunk(), im.origin_ptr(), (im.ni()+i_factor-1u)/i_factor,
00029 (im.nj()+j_factor-1u)/j_factor, (im.nk()+k_factor-1u)/k_factor, im.nplanes(),
00030 im.istep()*i_factor, im.jstep()*j_factor, im.kstep()*k_factor,
00031 im.planestep() );
00032 }
00033
00034 #endif // vil3d_decimate_h_