Changeset 1442
- Timestamp:
- Aug 9, 2004, 3:05:53 PM (22 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 8 edited
-
image/psImage.h (modified) (5 diffs)
-
image/psImageIO.h (modified) (3 diffs)
-
image/psImageManip.h (modified) (7 diffs)
-
image/psImageStats.c (modified) (2 diffs)
-
image/psImageStats.h (modified) (3 diffs)
-
imageops/psImageStats.c (modified) (2 diffs)
-
imageops/psImageStats.h (modified) (3 diffs)
-
mathtypes/psImage.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImage.h
r1441 r1442 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 09 23:40:55$14 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-10 01:05:53 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 typedef struct psImage 44 44 { 45 const psType type; ///< Image data type and dimension.46 const unsigned int numCols; ///< Number of columns in image47 const unsigned int numRows; ///< Number of rows in image.48 const int col0; ///< Column position relative to parent.49 const int row0; ///< Row position relative to parent.45 const psType type; ///< Image data type and dimension. 46 const unsigned int numCols; ///< Number of columns in image 47 const unsigned int numRows; ///< Number of rows in image. 48 const int col0; ///< Column position relative to parent. 49 const int row0; ///< Row position relative to parent. 50 50 51 51 union { 52 psU8* *U8; ///< Unsigned 8-bit integer data.53 psU16* *U16; ///< Unsigned 16-bit integer data.54 psU32* *U32; ///< Unsigned 32-bit integer data.55 psU64* *U64; ///< Unsigned 64-bit integer data.56 psS8* *S8; ///< Signed 8-bit integer data.57 psS16* *S16; ///< Signed 16-bit integer data.58 psS32* *S32; ///< Signed 32-bit integer data.59 psS64* *S64; ///< Signed 64-bit integer data.60 psF32* *F32; ///< Single-precision float data.61 psF64* *F64; ///< Double-precision float data.62 psC32* *C32; ///< Single-precision complex data.63 psC64* *C64; ///< Double-precision complex data.64 psPTR* *PTR; ///< Void pointers.65 psPTR* V; ///< Pointer to data.66 } data; ///< Union for data types.67 const struct psImage* parent; ///< Parent, if a subimage.68 int nChildren; ///< Number of subimages.69 struct psImage* *children; ///< Children of this region.52 psU8* *U8; ///< Unsigned 8-bit integer data. 53 psU16* *U16; ///< Unsigned 16-bit integer data. 54 psU32* *U32; ///< Unsigned 32-bit integer data. 55 psU64* *U64; ///< Unsigned 64-bit integer data. 56 psS8* *S8; ///< Signed 8-bit integer data. 57 psS16* *S16; ///< Signed 16-bit integer data. 58 psS32* *S32; ///< Signed 32-bit integer data. 59 psS64* *S64; ///< Signed 64-bit integer data. 60 psF32* *F32; ///< Single-precision float data. 61 psF64* *F64; ///< Double-precision float data. 62 psC32* *C32; ///< Single-precision complex data. 63 psC64* *C64; ///< Double-precision complex data. 64 psPTR* *PTR; ///< Void pointers. 65 psPTR* V; ///< Pointer to data. 66 } data; ///< Union for data types. 67 const struct psImage* parent; ///< Parent, if a subimage. 68 int nChildren; ///< Number of subimages. 69 struct psImage* *children; ///< Children of this region. 70 70 } 71 71 psImage; 72 73 /*****************************************************************************/74 75 /* FUNCTION PROTOTYPES */76 77 /*****************************************************************************/78 72 79 73 /** Create an image of the specified size and type. … … 85 79 * 86 80 */ 87 psImage* psImageAlloc(unsigned int numCols, ///< Number of rows in image. 88 unsigned int numRows, ///< Number of columns in image. 89 const psElemType type ///< Type of data for image. 90 ); 81 psImage* psImageAlloc( 82 unsigned int numCols, ///< Number of rows in image. 83 unsigned int numRows, ///< Number of columns in image. 84 const psElemType type ///< Type of data for image. 85 ); 91 86 92 87 /** Resize a given image to the given size/type. … … 95 90 * 96 91 */ 97 psImage* psImageRecycle(psImage* old, ///< the psImage to recycle by resizing image buffer 98 unsigned int numCols, ///< the desired number of columns in image 99 unsigned int numRows, ///< the desired number of rows in image 100 const psElemType type ///< the desired datatype of the image 101 ); 92 psImage* psImageRecycle( 93 psImage* old, ///< the psImage to recycle by resizing image buffer 94 unsigned int numCols, ///< the desired number of columns in image 95 unsigned int numRows, ///< the desired number of rows in image 96 const psElemType type ///< the desired datatype of the image 97 ); 102 98 103 99 /** Frees all children of a psImage. … … 106 102 * 107 103 */ 108 int psImageFreeChildren(psImage* image 104 int psImageFreeChildren( 105 psImage* image ///< psImage in which all children shall be deallocated 106 ); 109 107 110 /**< psImage in which all children shall be deallocated */ 111 ); 112 113 psF32 psImagePixelInterpolate(const psImage* input, 114 float x, float y, psF32 unexposedValue, psImageInterpolateMode mode); 108 /** Interpolate image pixel value given floating point coordinates. 109 * 110 * @return psF32 Pixel value interpolated from image or unexposedValue if 111 * given x,y doesn't coorespond to a valid image location 112 */ 113 psF32 psImagePixelInterpolate( 114 const psImage* input, ///< input image for interpolation 115 float x, ///< column location to derive value of 116 float y, ///< row location ot derive value of 117 psF32 unexposedValue, ///< return value if x,y location is not in image. 118 psImageInterpolateMode mode ///< interpolation mode 119 ); 115 120 116 121 #define p_psImagePixelInterpolateFcns(TYPE) \ -
trunk/psLib/src/image/psImageIO.h
r1441 r1442 10 10 * @author Robert DeSonia, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:40:55$12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-10 01:05:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 30 30 * signifies that a problem had occured. 31 31 */ 32 psImage* psImageReadSection(psImage* output, 32 psImage* psImageReadSection( 33 psImage* output, 34 /**< the output psImage to recycle, or NULL if new psImage desired */ 33 35 34 /**< the output psImage to recycle, or NULL if new psImage desired */35 int col0,36 int col0, 37 /**< the column index of the origin to start reading */ 36 38 37 /**< the column index of the origin to start reading */38 int row0,39 int row0, 40 /**< the row index of the origin to start reading */ 39 41 40 /**< the row index of the origin to start reading */41 int numCols,42 int numCols, 43 /**< the number of desired columns to read */ 42 44 43 /**< the number of desired columns to read */44 int numRows,45 int numRows, 46 /**< the number of desired rows to read */ 45 47 46 /**< the number of desired rows to read */47 int z,48 int z, 49 /**< the z index to read if file is organized as a 3D image cube. */ 48 50 49 /**< the z index to read if file is organized as a 3D image cube. */ 50 char *extname, 51 char *extname, 52 /**< the image extension to read (this should match the EXTNAME keyword in 53 * the extension If NULL, the extnum parameter is to be used instead 54 */ 51 55 52 /**< the image extension to read (this should match the EXTNAME keyword in53 * the extension If NULL, the extnum parameter is to be used instead54 */55 int extnum,56 int extnum, 57 /**< the image extension to read (0=PHU, 1=first extension, etc.) This is 58 * only used if extname is NULL 59 */ 56 60 57 /**< the image extension to read (0=PHU, 1=first extension, etc.) This is 58 * only used if extname is NULL 59 */ 60 char *filename 61 62 /**< the filename of the FITS image file to read */ 63 ); 61 char *filename 62 /**< the filename of the FITS image file to read */ 63 ); 64 64 65 65 /** Read an image or subimage from a FITS file specified by a filename. … … 67 67 * return bool TRUE is successful, otherwise FALSE. 68 68 */ 69 bool psImageWriteSection(psImage* input, 69 bool psImageWriteSection( 70 psImage* input, 71 /**< the psImage to write */ 70 72 71 /**< the psImage to write */72 int col0,73 int col0, 74 /**< the column index of the origin to start writing */ 73 75 74 /**< the column index of the origin to start writing */75 int row0,76 int row0, 77 /**< the row index of the origin to start writing */ 76 78 77 /**< the row index of the origin to start writing */78 int z,79 int z, 80 /**< the z index to start writing */ 79 81 80 /**< the z index to start writing */ 81 char *extname, 82 char *extname, 83 /**< the image extension to write (this should match the EXTNAME keyword in 84 * the extension If NULL, the extnum parameter is to be used instead 85 */ 82 86 83 /**< the image extension to write (this should match the EXTNAME keyword in84 * the extension If NULL, the extnum parameter is to be used instead85 */86 int extnum,87 int extnum, 88 /**< the image extension to write (0=PHU, 1=first extension, etc.) This is 89 * only used if extname is NULL. 90 */ 87 91 88 /**< the image extension to write (0=PHU, 1=first extension, etc.) This is 89 * only used if extname is NULL. 90 */ 91 char *filename 92 93 /**< the filename of the FITS image file to write */ 94 ); 92 char *filename 93 /**< the filename of the FITS image file to write */ 94 ); 95 95 96 96 /// @} -
trunk/psLib/src/image/psImageManip.h
r1441 r1442 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08- 09 23:40:55$13 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-10 01:05:53 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 * @return int The number of clipped pixels 33 33 */ 34 int psImageClip(psImage* input, ///< the image to clip 35 psF64 min, ///< the minimum image value allowed 36 psF64 vmin, ///< the value pixels < min are set to 37 psF64 max, ///< the maximum image value allowed 38 psF64 vmax ///< the value pixels > max are set to 39 ); 34 int psImageClip( 35 psImage* input, ///< the image to clip 36 psF64 min, ///< the minimum image value allowed 37 psF64 vmin, ///< the value pixels < min are set to 38 psF64 max, ///< the maximum image value allowed 39 psF64 vmax ///< the value pixels > max are set to 40 ); 40 41 41 42 /** Clip image values outside of a specified complex region … … 48 49 * @return int The number of clipped pixels 49 50 */ 50 int psImageClipComplexRegion(psImage* input, ///< the image to clip 51 psC64 min, ///< the minimum image value allowed 52 psC64 vmin, ///< the value pixels < min are set to 53 psC64 max, ///< the maximum image value allowed 54 psC64 vmax ///< the value pixels > max are set to 55 ); 51 int psImageClipComplexRegion( 52 psImage* input, ///< the image to clip 53 psC64 min, ///< the minimum image value allowed 54 psC64 vmin, ///< the value pixels < min are set to 55 psC64 max, ///< the maximum image value allowed 56 psC64 vmax ///< the value pixels > max are set to 57 ); 56 58 57 59 /** Clip NaN image pixels to given value. … … 62 64 * @return int The number of clipped pixels 63 65 */ 64 int psImageClipNaN(psImage* input, ///< the image to clip 65 psF64 value ///< the value to set all NaN/Inf values to 66 ); 66 int psImageClipNaN( 67 psImage* input, ///< the image to clip 68 psF64 value ///< the value to set all NaN/Inf values to 69 ); 67 70 68 71 /** Overlay subregion of image with another image … … 77 80 * @return int 0 if success, non-zero if failed. 78 81 */ 79 int psImageOverlaySection(psImage* image, ///< target image 80 const psImage* overlay, ///< the overlay image 81 int col0, ///< the column to start overlay 82 int row0, ///< the row to start overlay 83 const char *op ///< the operation to perform for overlay 84 ); 82 int psImageOverlaySection( 83 psImage* image, ///< target image 84 const psImage* overlay, ///< the overlay image 85 int col0, ///< the column to start overlay 86 int row0, ///< the row to start overlay 87 const char *op ///< the operation to perform for overlay 88 ); 85 89 86 90 /** Rebin image to new scale. … … 94 98 * @return psImage new image formed by rebinning input image. 95 99 */ 96 psImage* psImageRebin(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 97 const psImage* in, ///< input image 98 unsigned int scale, ///< the scale to rebin for each dimension 99 const psStats* stats ///< the statistic to perform when rebinning. Only one 100 // method should be set. 101 ); 100 psImage* psImageRebin( 101 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 102 const psImage* in, ///< input image 103 unsigned int scale, ///< the scale to rebin for each dimension 104 const psStats* stats 105 ///< the statistic to perform when rebinning. Only one method should be set. 106 ); 102 107 103 psImage* psImageResample(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 104 const psImage* in, ///< input image 105 int scale, psImageInterpolateMode mode); 108 /** Resample image to new scale. 109 * 110 * A new image is constructed in which the dimensions are increased by a 111 * factor of scale. The scale, always a positive number, is equal in each 112 * dimension. The output image is generated from all input image pixels. 113 * Each pixel in the output image is derived by interpolating between 114 * neighboring pixels using the specified interpolation method (mode). 115 * 116 * @return psImage* resampled image result 117 */ 118 psImage* psImageResample( 119 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 120 const psImage* in, ///< input image 121 int scale, ///< resample scaling factor 122 psImageInterpolateMode mode ///< the interpolation mode used in resampling 123 ); 106 124 107 psImage* psImageRotate(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 108 const psImage* in, ///< input image 109 float angle, float unexposedValue, psImageInterpolateMode mode); 125 /** Rotate the input image by given angle, specified in degrees. 126 * 127 * The output image must contain all of the pixels from the input image in 128 * their new frame. Pixels in the output image which do not map to input 129 * pixels should be set to exposed. The center of rotation is always the 130 * center pixel of the image. The rotation is specified in the sense that a 131 * positive angle is an anti-clockwise rotation. This function must be 132 * defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64, 133 * psC32, psC64. 134 * 135 * @return psImage* the rotated image result. 136 */ 137 psImage* psImageRotate( 138 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 139 const psImage* in, ///< input image 140 float angle, ///< the rotation angle in degrees. 141 float unexposedValue, ///< the output image pixel values for non-imagery areas 142 psImageInterpolateMode mode ///< the interpolation mode used 143 ); 110 144 111 psImage* psImageShift(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 112 const psImage* in, ///< input image 113 float dx, float dy, float unexposedValue, psImageInterpolateMode mode); 145 /** Shift image by an arbitrary number of pixels (dx,dy) in either direction. 146 * 147 * If the shift values are fractional, the output pixel values should 148 * interpolate between the input pixel values. The output image has the same 149 * dimensions as the input image. Pixels which fall off the edge of the 150 * output image are lost. Newly exposed pixels are set to the value given by 151 * exposed. This function must be defined for the following types: psU8, 152 * psU16, psS8, psS16, psF32, psF64, psC32, psC64. 153 * 154 * @return psImage* the shifted image result. 155 */ 156 psImage* psImageShift( 157 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 158 const psImage* in, ///< input image 159 float dx, ///< the shift in x direction. 160 float dy, ///< the shift in y direction. 161 float unexposedValue, ///< the output image pixel values for non-imagery areas 162 psImageInterpolateMode mode ///< the interpolation mode to use 163 ); 114 164 115 165 /** Roll image by an integer number of pixels in either direction. … … 121 171 * @return psImage* the rolled version of the input image. 122 172 */ 123 psImage* psImageRoll(psImage* out, ///< an psImage to recycle. If NULL, a new image is created 124 const psImage* in, ///< input image 125 int dx, ///< number of pixels to roll in the x-dimension 126 int dy ///< number of pixels to roll in the y-dimension 127 ); 173 psImage* psImageRoll( 174 psImage* out, ///< an psImage to recycle. If NULL, a new image is created 175 const psImage* in, ///< input image 176 int dx, ///< number of pixels to roll in the x-dimension 177 int dy ///< number of pixels to roll in the y-dimension 178 ); 128 179 129 180 #endif -
trunk/psLib/src/image/psImageStats.c
r1440 r1442 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:34:58$12 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-10 01:05:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 401 401 psFree(rScalingFactors); 402 402 403 return (0);404 } 403 return input; 404 } -
trunk/psLib/src/image/psImageStats.h
r1441 r1442 1 2 1 /** @file psImageStats.h 3 2 * \brief Routines for calculating statistics on images. … … 10 9 * @author George Gusciora, MHPCC 11 10 * 12 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:40:55$11 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-10 01:05:53 $ 14 13 * 15 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 26 /// @{ 28 27 29 /// This routine must determine the various statistics for the image. 30 psStats* psImageStats(psStats* stats, ///< defines statistics to be calculated 31 psImage* in, ///< image (or subimage) to calculate stats 32 psImage* mask, ///< mask data for image (NULL ok) 33 int maskVal); ///< mask Mask for mask 28 /** This routine must determine the various statistics for the image. 29 * 30 * Determine statistics for image (or subimage). The statistics to be 31 * determined are specified by stats. The mask allows pixels to be excluded 32 * if their corresponding mask pixel value matches the value of maskVal. 33 * This function must be defined for the following types: psS8, psU16, psF32, 34 * psF64. 35 * 36 * @return psStats* the resulting statistics result(s) 37 */ 38 psStats* psImageStats( 39 psStats* stats, ///< defines statistics to be calculated 40 psImage* in, ///< image (or subimage) to calculate stats 41 psImage* mask, ///< mask data for image (NULL ok) 42 int maskVal ///< mask Mask for mask 43 ); 34 44 35 psHistogram* psImageHistogram(psHistogram* out, ///< input histogram description & target 36 psImage* in, ///< Image data to be histogramed. 37 psImage* mask, ///< mask data for image (NULL ok) 38 unsigned int maskVal); ///< mask Mask for mask 45 /** Construct a histogram from an image (or subimage). 46 * 47 * The histogram to generate is specified by psHistogram hist (see section 48 * 4.3.2 in SDRS). This function must be defined for the following types: 49 * psS8, psU16, psF32, psF64. 50 * 51 * @return psHistogram* the resulting histogram 52 */ 53 psHistogram* psImageHistogram( 54 psHistogram* out, ///< input histogram description & target 55 psImage* in, ///< Image data to be histogramed. 56 psImage* mask, ///< mask data for image (NULL ok) 57 unsigned int maskVal ///< mask Mask for mask 58 ); 39 59 40 /// Fit a 2-D polynomial surface to an image. 41 psPolynomial2D* psImageFitPolynomial(const psImage* input, ///< image to fit 42 psPolynomial2D* coeffs ///< coefficient structure carries in 43 // desired terms & target 44 ); 60 /** Fit a 2-D polynomial surface to an image. 61 * 62 * The input structure coeffs contains the desired order and terms of 63 * interest. This function must be defined for the following types: psS8, 64 * psU16, psF32, psF64. 65 * 66 * @return psPolynomial2D* fitted polynomial result 67 * 68 */ 69 psPolynomial2D* psImageFitPolynomial( 70 const psImage* input, ///< image to fit 71 psPolynomial2D* coeffs ///< coefficient structure carries in desired terms & target 72 ); 45 73 46 /// Evaluate a 2-D polynomial surface to image pixels. 47 int psImageEvalPolynomial(const psImage* input, ///< image to fit 48 const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms 49 ); 74 /** Evaluate a 2-D polynomial surface for the image pixels. 75 * 76 * Given the input polynomial coefficients, set the image pixel values on the 77 * basis of the polynomial function. This function must be defined for the 78 * following types: psS8, psU16, psF32, psF64. 79 * 80 * @return psImage* the resulting image 81 */ 82 int psImageEvalPolynomial( 83 const psImage* input, ///< input image 84 const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms 85 ); 50 86 51 87 /// @} -
trunk/psLib/src/imageops/psImageStats.c
r1440 r1442 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:34:58$12 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-10 01:05:53 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 401 401 psFree(rScalingFactors); 402 402 403 return (0);404 } 403 return input; 404 } -
trunk/psLib/src/imageops/psImageStats.h
r1441 r1442 1 2 1 /** @file psImageStats.h 3 2 * \brief Routines for calculating statistics on images. … … 10 9 * @author George Gusciora, MHPCC 11 10 * 12 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08- 09 23:40:55$11 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-10 01:05:53 $ 14 13 * 15 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 26 /// @{ 28 27 29 /// This routine must determine the various statistics for the image. 30 psStats* psImageStats(psStats* stats, ///< defines statistics to be calculated 31 psImage* in, ///< image (or subimage) to calculate stats 32 psImage* mask, ///< mask data for image (NULL ok) 33 int maskVal); ///< mask Mask for mask 28 /** This routine must determine the various statistics for the image. 29 * 30 * Determine statistics for image (or subimage). The statistics to be 31 * determined are specified by stats. The mask allows pixels to be excluded 32 * if their corresponding mask pixel value matches the value of maskVal. 33 * This function must be defined for the following types: psS8, psU16, psF32, 34 * psF64. 35 * 36 * @return psStats* the resulting statistics result(s) 37 */ 38 psStats* psImageStats( 39 psStats* stats, ///< defines statistics to be calculated 40 psImage* in, ///< image (or subimage) to calculate stats 41 psImage* mask, ///< mask data for image (NULL ok) 42 int maskVal ///< mask Mask for mask 43 ); 34 44 35 psHistogram* psImageHistogram(psHistogram* out, ///< input histogram description & target 36 psImage* in, ///< Image data to be histogramed. 37 psImage* mask, ///< mask data for image (NULL ok) 38 unsigned int maskVal); ///< mask Mask for mask 45 /** Construct a histogram from an image (or subimage). 46 * 47 * The histogram to generate is specified by psHistogram hist (see section 48 * 4.3.2 in SDRS). This function must be defined for the following types: 49 * psS8, psU16, psF32, psF64. 50 * 51 * @return psHistogram* the resulting histogram 52 */ 53 psHistogram* psImageHistogram( 54 psHistogram* out, ///< input histogram description & target 55 psImage* in, ///< Image data to be histogramed. 56 psImage* mask, ///< mask data for image (NULL ok) 57 unsigned int maskVal ///< mask Mask for mask 58 ); 39 59 40 /// Fit a 2-D polynomial surface to an image. 41 psPolynomial2D* psImageFitPolynomial(const psImage* input, ///< image to fit 42 psPolynomial2D* coeffs ///< coefficient structure carries in 43 // desired terms & target 44 ); 60 /** Fit a 2-D polynomial surface to an image. 61 * 62 * The input structure coeffs contains the desired order and terms of 63 * interest. This function must be defined for the following types: psS8, 64 * psU16, psF32, psF64. 65 * 66 * @return psPolynomial2D* fitted polynomial result 67 * 68 */ 69 psPolynomial2D* psImageFitPolynomial( 70 const psImage* input, ///< image to fit 71 psPolynomial2D* coeffs ///< coefficient structure carries in desired terms & target 72 ); 45 73 46 /// Evaluate a 2-D polynomial surface to image pixels. 47 int psImageEvalPolynomial(const psImage* input, ///< image to fit 48 const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms 49 ); 74 /** Evaluate a 2-D polynomial surface for the image pixels. 75 * 76 * Given the input polynomial coefficients, set the image pixel values on the 77 * basis of the polynomial function. This function must be defined for the 78 * following types: psS8, psU16, psF32, psF64. 79 * 80 * @return psImage* the resulting image 81 */ 82 int psImageEvalPolynomial( 83 const psImage* input, ///< input image 84 const psPolynomial2D* coeffs ///< coefficient structure carries in desired terms 85 ); 50 86 51 87 /// @} -
trunk/psLib/src/mathtypes/psImage.h
r1441 r1442 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08- 09 23:40:55$14 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-10 01:05:53 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 typedef struct psImage 44 44 { 45 const psType type; ///< Image data type and dimension.46 const unsigned int numCols; ///< Number of columns in image47 const unsigned int numRows; ///< Number of rows in image.48 const int col0; ///< Column position relative to parent.49 const int row0; ///< Row position relative to parent.45 const psType type; ///< Image data type and dimension. 46 const unsigned int numCols; ///< Number of columns in image 47 const unsigned int numRows; ///< Number of rows in image. 48 const int col0; ///< Column position relative to parent. 49 const int row0; ///< Row position relative to parent. 50 50 51 51 union { 52 psU8* *U8; ///< Unsigned 8-bit integer data.53 psU16* *U16; ///< Unsigned 16-bit integer data.54 psU32* *U32; ///< Unsigned 32-bit integer data.55 psU64* *U64; ///< Unsigned 64-bit integer data.56 psS8* *S8; ///< Signed 8-bit integer data.57 psS16* *S16; ///< Signed 16-bit integer data.58 psS32* *S32; ///< Signed 32-bit integer data.59 psS64* *S64; ///< Signed 64-bit integer data.60 psF32* *F32; ///< Single-precision float data.61 psF64* *F64; ///< Double-precision float data.62 psC32* *C32; ///< Single-precision complex data.63 psC64* *C64; ///< Double-precision complex data.64 psPTR* *PTR; ///< Void pointers.65 psPTR* V; ///< Pointer to data.66 } data; ///< Union for data types.67 const struct psImage* parent; ///< Parent, if a subimage.68 int nChildren; ///< Number of subimages.69 struct psImage* *children; ///< Children of this region.52 psU8* *U8; ///< Unsigned 8-bit integer data. 53 psU16* *U16; ///< Unsigned 16-bit integer data. 54 psU32* *U32; ///< Unsigned 32-bit integer data. 55 psU64* *U64; ///< Unsigned 64-bit integer data. 56 psS8* *S8; ///< Signed 8-bit integer data. 57 psS16* *S16; ///< Signed 16-bit integer data. 58 psS32* *S32; ///< Signed 32-bit integer data. 59 psS64* *S64; ///< Signed 64-bit integer data. 60 psF32* *F32; ///< Single-precision float data. 61 psF64* *F64; ///< Double-precision float data. 62 psC32* *C32; ///< Single-precision complex data. 63 psC64* *C64; ///< Double-precision complex data. 64 psPTR* *PTR; ///< Void pointers. 65 psPTR* V; ///< Pointer to data. 66 } data; ///< Union for data types. 67 const struct psImage* parent; ///< Parent, if a subimage. 68 int nChildren; ///< Number of subimages. 69 struct psImage* *children; ///< Children of this region. 70 70 } 71 71 psImage; 72 73 /*****************************************************************************/74 75 /* FUNCTION PROTOTYPES */76 77 /*****************************************************************************/78 72 79 73 /** Create an image of the specified size and type. … … 85 79 * 86 80 */ 87 psImage* psImageAlloc(unsigned int numCols, ///< Number of rows in image. 88 unsigned int numRows, ///< Number of columns in image. 89 const psElemType type ///< Type of data for image. 90 ); 81 psImage* psImageAlloc( 82 unsigned int numCols, ///< Number of rows in image. 83 unsigned int numRows, ///< Number of columns in image. 84 const psElemType type ///< Type of data for image. 85 ); 91 86 92 87 /** Resize a given image to the given size/type. … … 95 90 * 96 91 */ 97 psImage* psImageRecycle(psImage* old, ///< the psImage to recycle by resizing image buffer 98 unsigned int numCols, ///< the desired number of columns in image 99 unsigned int numRows, ///< the desired number of rows in image 100 const psElemType type ///< the desired datatype of the image 101 ); 92 psImage* psImageRecycle( 93 psImage* old, ///< the psImage to recycle by resizing image buffer 94 unsigned int numCols, ///< the desired number of columns in image 95 unsigned int numRows, ///< the desired number of rows in image 96 const psElemType type ///< the desired datatype of the image 97 ); 102 98 103 99 /** Frees all children of a psImage. … … 106 102 * 107 103 */ 108 int psImageFreeChildren(psImage* image 104 int psImageFreeChildren( 105 psImage* image ///< psImage in which all children shall be deallocated 106 ); 109 107 110 /**< psImage in which all children shall be deallocated */ 111 ); 112 113 psF32 psImagePixelInterpolate(const psImage* input, 114 float x, float y, psF32 unexposedValue, psImageInterpolateMode mode); 108 /** Interpolate image pixel value given floating point coordinates. 109 * 110 * @return psF32 Pixel value interpolated from image or unexposedValue if 111 * given x,y doesn't coorespond to a valid image location 112 */ 113 psF32 psImagePixelInterpolate( 114 const psImage* input, ///< input image for interpolation 115 float x, ///< column location to derive value of 116 float y, ///< row location ot derive value of 117 psF32 unexposedValue, ///< return value if x,y location is not in image. 118 psImageInterpolateMode mode ///< interpolation mode 119 ); 115 120 116 121 #define p_psImagePixelInterpolateFcns(TYPE) \
Note:
See TracChangeset
for help on using the changeset viewer.
