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