core/vil/vil_resample_bilin.h
Go to the documentation of this file.
00001 // This is core/vil/vil_resample_bilin.h
00002 #ifndef vil_resample_bilin_h_
00003 #define vil_resample_bilin_h_
00004 //:
00005 // \file
00006 // \brief Sample grid of points with bilinear interpolation in one image and place in another
00007 // \author Tim Cootes
00008 //
00009 // The vil bicub source files were derived from the corresponding
00010 // vil bilin files, thus the vil bilin/bicub source files are very
00011 // similar.  If you modify something in this file, there is a
00012 // corresponding bicub file that would likely also benefit from
00013 // the same change.
00014 
00015 #include <vil/vil_image_view.h>
00016 
00017 //: Sample grid of points in one image and place in another, using bilinear interpolation.
00018 //  dest_image(i,j,p) is sampled from the src_image at
00019 //  (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1]
00020 //  dest_image resized to (n1,n2,src_image.nplanes())
00021 //  Points outside image return zero.
00022 // \sa vil_resample_bicub
00023 // \relatesalso vil_image_view
00024 template <class sType, class dType>
00025 void vil_resample_bilin(const vil_image_view<sType>& src_image,
00026                         vil_image_view<dType>& dest_image,
00027                         double x0, double y0, double dx1, double dy1,
00028                         double dx2, double dy2, int n1, int n2);
00029 
00030 //: Resample image to a specified width (n1) and height (n2)
00031 // \sa vil_resample_bicub
00032 // \relatesalso vil_image_view
00033 template <class sType, class dType>
00034 void vil_resample_bilin(const vil_image_view<sType>& src_image,
00035                         vil_image_view<dType>& dest_image,
00036                         int n1, int n2);
00037 
00038 //: Sample grid of points in one image and place in another, using bilinear interpolation.
00039 //  dest_image(i,j,p) is sampled from the src_image at
00040 //  (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1]
00041 //  dest_image resized to (n1,n2,src_image.nplanes())
00042 //  Points outside image return the value of the nearest valid pixel.
00043 // \relatesalso vil_image_view
00044 template <class sType, class dType>
00045 void vil_resample_bilin_edge_extend(const vil_image_view<sType>& src_image,
00046                                     vil_image_view<dType>& dest_image,
00047                                     double x0, double y0, double dx1, double dy1,
00048                                     double dx2, double dy2, int n1, int n2);
00049 
00050 //: Resample image to a specified width (n1) and height (n2)
00051 // \relatesalso vil_image_view
00052 template <class sType, class dType>
00053 void vil_resample_bilin_edge_extend(const vil_image_view<sType>& src_image,
00054                                     vil_image_view<dType>& dest_image,
00055                                     int n1, int n2);
00056 
00057 #endif // vil_resample_bilin_h_