Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vimt_bilin_interp.h

Go to the documentation of this file.
00001 // This is mul/vimt/vimt_bilin_interp.h
00002 #ifndef vimt_bilin_interp_h_
00003 #define vimt_bilin_interp_h_
00004 //:
00005 //  \file
00006 //  \brief Bilinear interpolation functions for 2D images
00007 //  \author Tim Cootes
00008 
00009 #include <vil/vil_bilin_interp.h>
00010 #include <vimt/vimt_image_2d_of.h>
00011 
00012 //: Compute bilinear interpolation at (x,y) in world coordinates, no bound checks
00013 //  Interpolates given plane of image.image() at image.world2im(p)
00014 template<class T>
00015 inline double vimt_bilin_interp_safe(const vimt_image_2d_of<T>& image,
00016                                      const vgl_point_2d<double>& p,
00017                                      int plane=0)
00018 {
00019   vgl_point_2d<double> im_p = image.world2im()(p);
00020   const vil_image_view<T>& im = image.image();
00021   return vil_bilin_interp_safe(im_p.x(),im_p.y(),
00022                                 im.top_left_ptr()+plane*im.planestep(),
00023                                 im.ni(),im.nj(),  im.istep(),im.jstep());
00024 }
00025 
00026 #endif // vimt_bilin_interp_h_

Generated on Thu Jan 10 14:43:58 2008 for contrib/mul/vimt by  doxygen 1.4.4