Changeset 633 for trunk/psLib/src/image/psImage.h
- Timestamp:
- May 10, 2004, 10:20:42 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/image/psImage.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/image/psImage.h
r599 r633 7 7 * @author Ross Harman, MHPCC 8 8 * 9 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-05- 07 02:56:52 $9 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-05-10 20:20:42 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 36 36 { 37 37 psType type; ///< Image data type and dimension. 38 int nx, ny; ///< Size of image. 39 int x0, y0; ///< Data region relative to parent. 38 int nCols; ///< Number of rows in image 39 int nRows; ///< Number of columns in image. 40 int col0; ///< Row position relative to parent. 41 int row0; ///< Column position relative to parent. 40 42 union { 41 float **rows ///< Pointers to floating point data (default).42 43 short **rows_s; ///< Pointers to short integer data. 43 44 int **rows_i; ///< Pointers to integer data. … … 46 47 unsigned int **rows_ui; ///< Pointers to unsigned integer data. 47 48 unsigned long **rows_ul; ///< Pointers to unsigned long integer data. 48 float **rows_f ///< Pointers to floating point data.49 double **rows_d ///< Pointers to double precision data.50 complex float **rows_cf ///< Pointers to complex floating point data.49 float **rows_f; ///< Pointers to floating point data. 50 double **rows_d; ///< Pointers to double precision data. 51 complex float **rows_cf; ///< Pointers to complex floating point data. 51 52 } rows; ///< Union for data types. 52 53 struct psImage *parent; ///< Parent, if a subimage. … … 69 70 */ 70 71 psImage *psImageAlloc( 71 int n x, ///< Image width.72 int n y, ///< Image height.73 psType type ///< Image data type.72 int nCols, ///< Number of rows in image. 73 int nRows, ///< Number of columns in image. 74 psType type ///< Type of data for image. 74 75 ); 75 76 … … 84 85 psImage *out, ///< Subimage to return, or NULL. 85 86 const psImage *image, ///< Parent image. 86 int n x, ///< Subimage width (<= image.nx - x0).87 int n y, ///< Subimage width (<= image.ny - y0).88 int x0, ///< Subimage x-offset (0 <= x0 < nx).89 int y0 ///< Subimage y-offset (0 <= y0 < ny).87 int nCols, ///< Subimage width (<= image.nCols - col0). 88 int nRows, ///< Subimage height (<= image.nRows - row0). 89 int col0, ///< Subimage col-offset (0 <= col0 < nCol). 90 int row0 ///< Subimage row-offset (0 <= row0 < nCol). 90 91 ); 91 92 … … 98 99 */ 99 100 void psImageFree( 100 psImage *restrict image ///< free this image101 psImage *restrict image ///< Free psImage 101 102 ); 102 103 103 104 105 // DOXYGEN COMMENTING FORMAT NOT YET FULLY IMPLEMENTED BEYOND THIS POINT106 107 108 109 /** Destroy the pixels of the specified image */110 psImage *111 psImageFreePixels(psImage *restrict image ///< Image whose pixels are to be freed112 );113 114 /// Destroy the children of the specified image. Returns number of children freed.115 int116 psImageFreeChildren(const psImage *image ///< free children of this image117 );118 119 /// Create a copy of the specified image.120 psImage *121 psImageCopy(psImage *output, ///< target structure for output image data122 const psImage *input ///< copy this image123 );124 125 /*** various image pixel extractions ***/126 127 /// Extract pixels from rectlinear region to a vector.128 psFloatArray *129 psImageSlice(psFloatArray *out, ///< Vector to output, or NULL130 const psImage *input, ///< extract slice from this image131 int x, ///< starting x coord of region to slice132 int y, ///< starting y coord of region to slice133 int nx, ///< width of region in x134 int ny, ///< width of region in y135 int direction, ///< direction of vector along slice136 const psStats *stats ///< defines statistics used to find output values137 );138 139 /// Extract pixels along a line to a vector.140 psFloatArray *141 psImageCut(psFloatArray *out, ///< Vector to output, or NULL142 const psImage *input, ///< extract cut from this image143 float xs, ///< starting x coord of cut144 float ys, ///< starting y coord of cut145 float xe, ///< ending x coord of cut146 float ye, ///< ending y coord of cut147 float dw, ///< width of cut148 const psStats *stats ///< defines statistics used to find output values149 );150 151 /// Extract radial annulii data to a vector.152 psFloatArray *153 psImageRadialCut(psFloatArray *out, ///< Vector to output, or NULL154 const psImage *input, ///< extract profile from this image155 float x, ///< center x coord of annulii156 float y, ///< center y coord of annulii157 float radius, ///< outer radius of annulii158 float dr, ///< radial step size of annulii159 const psStats *stats ///< defines statistics used to find output values160 );161 162 /* Contour is a high-level function */163 #if 0164 /// Extract a 2-d contour from an image at the given threshold.165 psFloatArray *166 psImageContour(psFloatArray *out, ///< Vector to output, or NULL167 const psImage *input, ///< create contour for this image168 float threshold, ///< contour image at this threshold169 int binning ///< bin image by this value for contour calculation170 );171 104 #endif 172 173 /*** various image geometry manipulation ***/174 /// Rebin image to new scale.175 psImage *176 psImageRebin(psImage *out, ///< Image to output, or NULL177 const psImage *input, ///< rebin this image178 float scale, ///< rebinning scale: doutput = scale*dinput179 const psStats *stats ///< defines statistics used to find output values180 );181 182 /// Rotate image by given angle.183 psImage *184 psImageRotate(psImage *out, ///< Image to output, or NULL185 const psImage *input, ///< rotate this image186 float angle ///< rotate by this amount anti-clockwise (degrees)187 );188 189 /// Shift image by an arbitrary number of pixels in either direction.190 /// Drop edge pixels, and set newly exposed pixels to 'exposed'.191 psImage *192 psImageShift(psImage *out, ///< Image to output, or NULL193 const psImage *input, ///< shift this image194 float dx, ///< shift by this amount in x195 float dy, ///< shift by this amount in y196 float exposed ///< set exposed pixels to this value197 );198 199 /// Roll image by an integer number of pixels in either direction.200 /// Edge pixels wrap to the other side (no values are lost).201 psImage *202 psImageRoll(psImage *out, ///< Image to output, or NULL203 const psImage *input, ///< roll this image204 int dx, ///< roll this amount in x205 int dy ///< roll this amount in y206 );207 208 /// Determine statistics for image (or subimage).209 psStats *210 psImageGetStats(const psImage *input, ///< image (or subimage) to calculate stats211 psStats *stats ///< defines statistics to be calculated & target212 );213 214 /// Construct a histogram from an image (or subimage).215 psHistogram *216 psImageHistogram(psHistogram *hist, ///< input histogram description & target217 const psImage *input ///< determine histogram of this image218 );219 220 /// Fit a 2-D polynomial surface to an image.221 psPolynomial2D *222 psImageFitPolynomial(const psImage *input, ///< image to fit223 psPolynomial2D *coeffs ///< coefficient structure carries in desired terms & target224 );225 226 /// Evaluate a 2-D polynomial surface to image pixels.227 int228 psImageEvalPolynomial(const psImage *input, ///< image to fit229 const psPolynomial2D *coeffs ///< coefficient structure carries in desired terms230 );231 232 /*** image input/output routines ***/233 /// Read an image or subimage from a named file.234 psImage *235 psImageReadSection(psImage *output, ///< place data in this structure for output236 int x, ///< starting x coord of region237 int y, ///< starting y coord of region238 int nx, ///< x size of region (-1 for full range)239 int ny, ///< y size of region (-1 for full range)240 int z, ///< plane of interest241 const char *extname, ///< MEF extension name ("PHU" for primary header)242 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)243 const char *filename ///< file to read data from244 );245 246 /// Read an image or subimage from file descriptor.247 psImage *248 psImageFReadSection(psImage *output, ///< place data in this structure for output249 int x, ///< starting x coord of region250 int y, ///< starting y coord of region251 int nx, ///< x size of region (-1 for full range)252 int ny, ///< y size of region (-1 for full range)253 int z, ///< plane of interest254 const char *extname, ///< MEF extension name ("PHU" for primary header)255 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)256 FILE *f ///< file descriptor to read data from257 );258 259 /// Write an image section to named file (which may exist).260 psImage *261 psImageWriteSection(psImage *input, ///< image to write out262 int x, ///< starting x coord of region263 int y, ///< starting y coord of region264 int z, ///< plane of interest265 const char *extname, ///< MEF extension name ("PHU" for primary header)266 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)267 const char *filename ///< file to write data to268 );269 270 /// Write an image section to named file (which may exist).271 psImage *272 psImageFWriteSection(psImage *input, ///< image to write out273 int x, ///< starting x coord of region274 int y, ///< starting y coord of region275 int z, ///< plane of interest276 const char *extname, ///< MEF extension name277 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)278 FILE *f ///< file descriptor to write data to279 );280 281 /// Read only header from image file.282 psMetadata *283 psImageReadHeader(psMetadata *output, ///< read data to this structure284 const char *extname, ///< MEF extension name ("PHU" for primary header)285 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)286 const char *filename ///< file to read from287 );288 289 /// Read only header from image file descriptor.290 psMetadata *291 psImageFReadHeader(psMetadata *output, ///< read data to this structure292 const char *extname, ///< MEF extension name ("PHU" for primary header)293 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)294 FILE *f ///< file descriptor to read from295 );296 297 /*** basic pixel manipulations ***/298 /// Clip image values outside of range to given values. Return number of clipped pixels.299 int300 psImageClip(psImage *input, ///< clip this image301 float min, ///< clip pixels with values < min302 float vmin, ///< set min-clipped pixels to vmin303 float max, ///< clip pixels with values > max304 float vmax ///< set max-clipped pixels to vmax305 );306 307 /// Clip NaN image pixels to given value. Return number of clipped pixels.308 int309 psImageClipNaN(psImage *input, ///< clip this image & target310 float value ///< set nan pixels to this value311 );312 313 /// Overlay subregion of image with another image. Return number of pixels replaced.314 int315 psImageOverlaySection(psImage *image, ///< input image & target316 const psImage *overlay, ///< image to overlay317 int x0, ///< x offset of overlay subimage318 int y0, ///< y offset of overlay subimage319 const char *op ///< overlay operation320 );321 322 /* \} */ // End of AstroGroup Functions323 324 # endif325 /* image overlay operations326 PS_OVERLAY_EQUALS = '=',327 PS_OVERLAY_ADD = '+',328 PS_OVERLAY_SUBTRACT = '-',329 PS_OVERLAY_MULTIPLY = '*',330 PS_OVERLAY_DIVIDE = '/',331 */
Note:
See TracChangeset
for help on using the changeset viewer.
