00001 /***************************************************************************** 00002 * Date: January 29, 2002 00003 * January 6, 2004: 00004 * Modified by Rasmus Munk Larsen, rmunk@quake.stanford.edu, 00005 * to add a single precision version and to improve speed. 00006 *---------------------------------------------------------------------------- 00007 * This C program is based on the following three papers: 00008 * [1] M. Unser, 00009 * "Splines: A Perfect Fit for Signal and Image Processing," 00010 * IEEE Signal Processing Magazine, vol. 16, no. 6, pp. 22-38, 00011 * November 1999. 00012 * [2] M. Unser, A. Aldroubi and M. Eden, 00013 * "B-Spline Signal Processing: Part I--Theory," 00014 * IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 821-832, 00015 * February 1993. 00016 * [3] M. Unser, A. Aldroubi and M. Eden, 00017 * "B-Spline Signal Processing: Part II--Efficient Design and Applications," 00018 * IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 834-848, 00019 * February 1993. 00020 *---------------------------------------------------------------------------- 00021 * EPFL/STI/IOA/BIG 00022 * Philippe Thevenaz 00023 * Bldg. BM-Ecublens 4.137 00024 * CH-1015 Lausanne 00025 *---------------------------------------------------------------------------- 00026 * phone (CET): +41(21)693.51.61 00027 * fax: +41(21)693.37.01 00028 * RFC-822: philippe.thevenaz@epfl.ch 00029 * X-400: /C=ch/A=400net/P=switch/O=epfl/S=thevenaz/G=philippe/ 00030 * URL: http://bigwww.epfl.ch/ 00031 *---------------------------------------------------------------------------- 00032 * This file is best viewed with 4-space tabs (the bars below should be aligned) 00033 * | | | | | | | | | | | | | | | | | | | 00034 * |...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...|...| 00035 ****************************************************************************/ 00036 /*--------------------------------------------------------------------------*/ 00037 extern float fInterpolatedValue 00038 ( 00039 float *Bcoeff, /* input B-spline array of coefficients */ 00040 long Width, /* width of the image */ 00041 long Height, /* height of the image */ 00042 float x, /* x coordinate where to interpolate */ 00043 float y, /* y coordinate where to interpolate */ 00044 long SplineDegree/* degree of the spline model */ 00045 ); 00046 00047 00048 extern void fAffine 00049 ( 00050 float *Bcoeff, /* input B-spline array of coefficients */ 00051 float *Image, /* output image */ 00052 long Width, /* width of the image */ 00053 long Height, /* height of the image */ 00054 float a11, /* (1,1) element in linear transformation matrix */ 00055 float a12, /* (1,2) element in linear transformation matrix */ 00056 float a21, /* (2,1) element in linear transformation matrix */ 00057 float a22, /* (2,2) element in linear transformation matrix */ 00058 float xShift, /* Horizontal shift */ 00059 float yShift, /* Vertical shift */ 00060 long Masking, /* Whether to mask pixels outside the original image */ 00061 long SplineDegree/* degree of the spline model */ 00062 ); 00063 00064 extern double dInterpolatedValue 00065 ( 00066 double *Bcoeff, /* input B-spline array of coefficients */ 00067 long Width, /* width of the image */ 00068 long Height, /* height of the image */ 00069 double x, /* x coordinate where to interpolate */ 00070 double y, /* y coordinate where to interpolate */ 00071 long SplineDegree/* degree of the spline model */ 00072 ); 00073 00074 00075 extern void dAffine 00076 ( 00077 double *Bcoeff, /* input B-spline array of coefficients */ 00078 double *Image, /* output image */ 00079 long Width, /* width of the image */ 00080 long Height, /* height of the image */ 00081 double a11, /* (1,1) element in linear transformation matrix */ 00082 double a12, /* (1,2) element in linear transformation matrix */ 00083 double a21, /* (2,1) element in linear transformation matrix */ 00084 double a22, /* (2,2) element in linear transformation matrix */ 00085 double xShift, /* Horizontal shift */ 00086 double yShift, /* Vertical shift */ 00087 long Masking, /* Whether to mask pixels outside the original image */ 00088 long SplineDegree /* degree of the spline model */ 00089 ); 00090