Changeset 20306 for trunk/psLib/src/imageops/psImageInterpolate.h
- Timestamp:
- Oct 21, 2008, 4:10:37 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageInterpolate.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageInterpolate.h
r19140 r20306 7 7 * @author Paul Price, Institute for Astronomy 8 8 * 9 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2008- 08-21 01:12:44$9 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2008-10-22 02:10:37 $ 11 11 * Copyright 2004-2007 Institute for Astronomy, University of Hawaii 12 12 */ … … 18 18 /// Enumeration of options in interpolation 19 19 typedef enum { 20 PS_INTERPOLATE_NONE , ///< no interpolate defined (error state)21 PS_INTERPOLATE_FLAT, ///< Flat interpolation (nearest pixel)22 PS_INTERPOLATE_BILINEAR, ///< Bilinear interpolation23 PS_INTERPOLATE_BI CUBE, ///< Bicubic interpolation with 3x3 region24 PS_INTERPOLATE_GAUSS, ///< Gaussian inteprolation with 3x3 region25 PS_INTERPOLATE_LANCZOS2, ///< Sinc interpolation with 4x4 pixel kernel26 PS_INTERPOLATE_LANCZOS3, ///< Sinc interpolation with 6x6 pixel kernel27 PS_INTERPOLATE_LANCZOS4, ///< Sinc interpolation with 8x8 pixel kernel20 PS_INTERPOLATE_NONE = 0, ///< No interpolate defined (error state) 21 PS_INTERPOLATE_FLAT, ///< Flat interpolation (nearest pixel) 22 PS_INTERPOLATE_BILINEAR, ///< Bilinear interpolation 23 PS_INTERPOLATE_BIQUADRATIC, ///< Biquadratic interpolation with 3x3 region 24 PS_INTERPOLATE_GAUSS, ///< Gaussian inteprolation with 3x3 region 25 PS_INTERPOLATE_LANCZOS2, ///< Sinc interpolation with 4x4 pixel kernel 26 PS_INTERPOLATE_LANCZOS3, ///< Sinc interpolation with 6x6 pixel kernel 27 PS_INTERPOLATE_LANCZOS4, ///< Sinc interpolation with 8x8 pixel kernel 28 28 } psImageInterpolateMode; 29 29 … … 54 54 float poorFrac; ///< Fraction of flux in bad pixels before output is marked bad 55 55 bool shifting; ///< Shifting images? Don't interpolate if the shift is exact. 56 } psImageInterpolateOptions; 56 int numKernels; ///< Number of pre-calculated kernels 57 const psImage *kernel, *kernel2; ///< 1D interpolation kernel and kernel^2 (row) for each spacing 58 const psVector *sumKernel2; ///< Sum of kernel^2 for each spacing 59 } psImageInterpolation; 57 60 58 61 59 62 /// Allocator 60 psImageInterpolateOptions *psImageInterpolateOptionsAlloc(psImageInterpolateMode mode, // Interpolation mode 61 const psImage *image, // Input image 62 const psImage *variance, // Variance image 63 const psImage *mask, // Mask image 64 psMaskType maskVal, // Value to mask 65 double badImage, // Value for image if bad 66 double badVariance, // Value for variance if bad 67 psMaskType badMask, // Mask value for bad pixels 68 psMaskType poorMask, // Mask value for poor pixels 69 float poorFrac // Fraction of flux for question 63 psImageInterpolation *psImageInterpolationAlloc( 64 psImageInterpolateMode mode, // Interpolation mode 65 const psImage *image, // Input image 66 const psImage *variance, // Variance image 67 const psImage *mask, // Mask image 68 psMaskType maskVal, // Value to mask 69 double badImage, // Value for image if bad 70 double badVariance, // Value for variance if bad 71 psMaskType badMask, // Mask value for bad pixels 72 psMaskType poorMask, // Mask value for poor pixels 73 float poorFrac, // Fraction of flux for question 74 int numKernels // Number of interpolation kernels to pre-calculate 70 75 ) PS_ATTR_MALLOC; 71 76 72 77 73 74 78 /// Interpolate image pixel value given floating point coordinates. 75 psImageInterpolateStatus psImageInterpolate(double *imageValue, ///< Return value for image 76 double *varianceValue, ///< Return value for variance 77 psMaskType *maskValue, ///< Return value for mask 78 float x, float y, ///< Location to which to interpolate 79 const psImageInterpolateOptions *options ///< Options 79 psImageInterpolateStatus psImageInterpolate( 80 double *imageValue, ///< Return value for image 81 double *varianceValue, ///< Return value for variance 82 psMaskType *maskValue, ///< Return value for mask 83 float x, float y, ///< Location to which to interpolate 84 const psImageInterpolation *options ///< Options 80 85 ); 81 82 86 83 87 // Return the appropriate interpolation mode given a char string name for that mode … … 91 95 /// factor. 92 96 float psImageInterpolateVarianceFactor(float x, float y, ///< Position of interest 93 const psImageInterpolateOptions *options ///< Interpolation options97 psImageInterpolateMode mode ///< Interpolation mode 94 98 ); 95 99
Note:
See TracChangeset
for help on using the changeset viewer.
