Changeset 278
- Timestamp:
- Mar 22, 2004, 4:33:23 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psImage.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psImage.h
r269 r278 39 39 psImageAlloc (int nx, ///< image width 40 40 int ny, ///< image height 41 psType type )///< image data type42 ;41 psType type ///< image data type 42 ); 43 43 44 44 /// Create a subimage of the specified area. 45 45 psImage * 46 psImageSubset (psImage *image, ///< parent image 47 int nx, ///< subimage width (<= image.nx - x0) 48 int ny, ///< subimage width (<= image.ny - y0) 49 int x0, ///< subimage x-offset (0 <= x0 < nx) 50 int y0) ///< subimage y-offset (0 <= y0 < ny) 51 ; 46 psImageSubset(psImage *out, //!< Subimage to return, or NULL 47 const psImage *image, ///< parent image 48 int nx, ///< subimage width (<= image.nx - x0) 49 int ny, ///< subimage width (<= image.ny - y0) 50 int x0, ///< subimage x-offset (0 <= x0 < nx) 51 int y0 ///< subimage y-offset (0 <= y0 < ny) 52 ); 52 53 53 54 /// Destroy the specified image (destroy children if they exist). 54 55 void 55 psImageFree (psImage *image) ///< free this image 56 ; 57 58 /// Destroy the children of the specified image. 56 psImageFree(psImage *restrict image ///< free this image 57 ); 58 59 /** Destroy the pixels of the specified image */ 60 psImage * 61 psImageFreePixels(psImage *restrict image //!< Image whose pixels are to be freed 62 ); 63 64 /// Destroy the children of the specified image. Returns number of children freed. 59 65 int 60 psImageFreeChildren (psImage *image)///< free children of this image61 ;66 psImageFreeChildren(const psImage *image ///< free children of this image 67 ); 62 68 63 69 /// Create a copy of the specified image. 64 70 psImage * 65 psImageCopy (psImage *output, ///< target structure for output image data66 psImage *input)///< copy this image67 ;71 psImageCopy(psImage *output, ///< target structure for output image data 72 const psImage *input ///< copy this image 73 ); 68 74 69 75 /*** various image pixel extractions ***/ … … 71 77 /// Extract pixels from rectlinear region to a vector. 72 78 psFloatArray * 73 psImageSlice (psImage *input, ///< extract slice from this image 74 int x, ///< starting x coord of region to slice 75 int y, ///< starting y coord of region to slice 76 int nx, ///< width of region in x 77 int ny, ///< width of region in y 78 int direction, ///< direction of vector along slice 79 psStats *stats) ///< defines statistics used to find output values 80 ; 79 psImageSlice(psFloatArray *out, //!< Vector to output, or NULL 80 const psImage *input, ///< extract slice from this image 81 int x, ///< starting x coord of region to slice 82 int y, ///< starting y coord of region to slice 83 int nx, ///< width of region in x 84 int ny, ///< width of region in y 85 int direction, ///< direction of vector along slice 86 const psStats *stats ///< defines statistics used to find output values 87 ); 81 88 82 89 /// Extract pixels along a line to a vector. 83 90 psFloatArray * 84 psImageCut (psImage *input, ///< extract cut from this image 85 float xs, ///< starting x coord of cut 86 float ys, ///< starting y coord of cut 87 float xe, ///< ending x coord of cut 88 float ye, ///< ending y coord of cut 89 float dw, ///< width of cut 90 psStats *stats) ///< defines statistics used to find output values 91 ; 91 psImageCut(psFloatArray *out, //!< Vector to output, or NULL 92 const psImage *input, ///< extract cut from this image 93 float xs, ///< starting x coord of cut 94 float ys, ///< starting y coord of cut 95 float xe, ///< ending x coord of cut 96 float ye, ///< ending y coord of cut 97 float dw, ///< width of cut 98 const psStats *stats ///< defines statistics used to find output values 99 ); 92 100 93 101 /// Extract radial annulii data to a vector. 94 102 psFloatArray * 95 psImageRadialCut (psImage *input, ///< extract profile from this image 96 float x, ///< center x coord of annulii 97 float y, ///< center y coord of annulii 98 float radius, ///< outer radius of annulii 99 float dr, ///< radial step size of annulii 100 psStats *stats) ///< defines statistics used to find output values 101 ; 103 psImageRadialCut(psFloatArray *out, //!< Vector to output, or NULL 104 const psImage *input, ///< extract profile from this image 105 float x, ///< center x coord of annulii 106 float y, ///< center y coord of annulii 107 float radius, ///< outer radius of annulii 108 float dr, ///< radial step size of annulii 109 const psStats *stats ///< defines statistics used to find output values 110 ); 102 111 103 112 /// Extract a 2-d contour from an image at the given threshold. 104 113 psFloatArray * 105 psImageContour (psImage *input, ///< create contour for this image 106 float threshold, ///< contour image at this threshold 107 int binning) ///< bin image by this value for contour calculation 108 ; 114 psImageContour(psFloatArray *out, //!< Vector to output, or NULL 115 const psImage *input, ///< create contour for this image 116 float threshold, ///< contour image at this threshold 117 int binning ///< bin image by this value for contour calculation 118 ); 109 119 110 120 /*** various image geometry manipulation ***/ 111 121 /// Rebin image to new scale. 112 122 psImage * 113 psImageRebin (psImage *input, ///< rebin this image 114 float scale, ///< rebinning scale: doutput = scale*dinput 115 psStats *stats) ///< defines statistics used to find output values 116 ; 123 psImageRebin(psImage *out, //!< Image to output, or NULL 124 const psImage *input, ///< rebin this image 125 float scale, ///< rebinning scale: doutput = scale*dinput 126 const psStats *stats ///< defines statistics used to find output values 127 ); 117 128 118 129 /// Rotate image by given angle. 119 130 psImage * 120 psImageRotate (psImage *input, ///< rotate this image 121 float angle) ///< rotate by this amount (degrees) 122 ; 131 psImageRotate(psImage *out, //!< Image to output, or NULL 132 const psImage *input, ///< rotate this image 133 float angle ///< rotate by this amount anti-clockwise (degrees) 134 ); 123 135 124 136 /// Shift image by an arbitrary number of pixels in either direction. 125 137 /// Drop edge pixels, and set newly exposed pixels to 'exposed'. 126 138 psImage * 127 psImageShift (psImage *input, ///< shift this image 128 float dx, ///< shift by this amount in x 129 float dy, ///< shift by this amount in y 130 float exposed) ///< set exposed pixels to this value 131 ; 139 psImageShift(psImage *out, //!< Image to output, or NULL 140 const psImage *input, ///< shift this image 141 float dx, ///< shift by this amount in x 142 float dy, ///< shift by this amount in y 143 float exposed ///< set exposed pixels to this value 144 ); 132 145 133 146 /// Roll image by an integer number of pixels in either direction. 134 147 /// Edge pixels wrap to the other side (no values are lost). 135 148 psImage * 136 psImageRoll (psImage *input, ///< roll this image 137 int dx, ///< roll this amount in x 138 int dy) ///< roll this amount in y 139 ; 149 psImageRoll(psImage *out, //!< Image to output, or NULL 150 const psImage *input, ///< roll this image 151 int dx, ///< roll this amount in x 152 int dy ///< roll this amount in y 153 ); 140 154 141 155 /// Determine statistics for image (or subimage). 142 156 psStats * 143 psImageGetStats (psImage *input, ///< image (or subimage) to calculate stats 144 psStats *stats) ///< defines statistics to be calculated 145 ; 157 psImageGetStats(psImage *out, //!< Image to output, or NULL 158 const psImage *input, ///< image (or subimage) to calculate stats 159 psStats *stats ///< defines statistics to be calculated & target 160 ); 146 161 147 162 /// Construct a histogram from an image (or subimage). 148 163 psHistogram * 149 psImageHistogram (psHistogram *hist, ///< input histogram description & target150 psImage *input)///< determine histogram of this image151 ;164 psImageHistogram(psHistogram *hist, ///< input histogram description & target 165 const psImage *input ///< determine histogram of this image 166 ); 152 167 153 168 /// Fit a 2-D polynomial surface to an image. 154 169 psPolynomial2D * 155 psImageFitPolynomial (psImage *input,///< image to fit156 psPolynomial2D *coeffs) ///< coefficient structure carries in desired terms157 ;170 psImageFitPolynomial(const psImage *input, ///< image to fit 171 psPolynomial2D *coeffs ///< coefficient structure carries in desired terms & target 172 ); 158 173 159 174 /// Evaluate a 2-D polynomial surface to image pixels. 160 175 int 161 psImageEvalPolynomial (psImage *input,///< image to fit162 psPolynomial2D *coeffs)///< coefficient structure carries in desired terms163 ;176 psImageEvalPolynomial(const psImage *input, ///< image to fit 177 const psPolynomial2D *coeffs ///< coefficient structure carries in desired terms 178 ); 164 179 165 180 /*** image input/output routines ***/ 166 181 /// Read an image or subimage from a named file. 167 182 psImage * 168 psImageReadSection (psImage *output, ///< place data in this structure for output 169 int x, ///< starting x coord of region 170 int y, ///< starting y coord of region 171 int nx, ///< x size of region (-1 for full range) 172 int ny, ///< y size of region (-1 for full range) 173 int z, ///< plane of interest 174 char *extname, ///< MEF extension name ("PHU" for primary header) 183 psImageReadSection(psImage *output, ///< place data in this structure for output 184 int x, ///< starting x coord of region 185 int y, ///< starting y coord of region 186 int nx, ///< x size of region (-1 for full range) 187 int ny, ///< y size of region (-1 for full range) 188 int z, ///< plane of interest 189 const char *extname, ///< MEF extension name ("PHU" for primary header) 190 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 191 const char *filename ///< file to read data from 192 ); 193 194 /// Read an image or subimage from file descriptor. 195 psImage * 196 psImageFReadSection(psImage *output, ///< place data in this structure for output 197 int x, ///< starting x coord of region 198 int y, ///< starting y coord of region 199 int dx, ///< x size of region (-1 for full range) 200 int dy, ///< y size of region (-1 for full range) 201 int z, ///< plane of interest 202 const char *extname, ///< MEF extension name ("PHU" for primary header) 175 203 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 176 char *filename) ///< file to read data from 177 ; 178 179 /// Read an image or subimage from file descriptor. 180 psImage * 181 psImageFReadSection (psImage *output, ///< place data in this structure for output 182 int x, ///< starting x coord of region 183 int y, ///< starting y coord of region 184 int dx, ///< x size of region (-1 for full range) 185 int dy, ///< y size of region (-1 for full range) 186 int z, ///< plane of interest 187 char *extname, ///< MEF extension name ("PHU" for primary header) 188 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 189 FILE *f) ///< file descriptor to read data from 190 ; 204 const FILE *f ///< file descriptor to read data from 205 ); 191 206 192 207 /// Write an image section to named file (which may exist). 193 208 psImage * 194 psImageWriteSection (psImage *input, ///< image to write out195 int x, ///< starting x coord of region196 int y, ///< starting y coord of region197 int z, ///< plane of interest198 char *extname, ///< MEF extension name ("PHU" for primary header)199 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)200 char *filename)///< file to write data to201 ;209 psImageWriteSection(psImage *input, ///< image to write out 210 int x, ///< starting x coord of region 211 int y, ///< starting y coord of region 212 int z, ///< plane of interest 213 const char *extname, ///< MEF extension name ("PHU" for primary header) 214 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 215 const char *filename ///< file to write data to 216 ); 202 217 203 218 /// Write an image section to named file (which may exist). … … 207 222 int y, ///< starting y coord of region 208 223 int z, ///< plane of interest 209 c har *extname,///< MEF extension name224 const char *extname, ///< MEF extension name 210 225 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 211 FILE *f)///< file descriptor to write data to212 ;226 const FILE *f ///< file descriptor to write data to 227 ); 213 228 214 229 /// Read only header from image file. 215 structpsMetadata *216 psImageReadHeader( struct psMetadata *output,///< read data to this structure217 c har *extname, ///< MEF extension name ("PHU" for primary header)230 psMetadata * 231 psImageReadHeader(psMetadata *output, ///< read data to this structure 232 const char *extname, ///< MEF extension name ("PHU" for primary header) 218 233 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 219 c har *filename)///< file to read from220 ;234 const char *filename ///< file to read from 235 ); 221 236 222 237 /// Read only header from image file descriptor. 223 structpsMetadata *224 psImageFReadHeader (structpsMetadata *output, ///< read data to this structure225 char *extname,///< MEF extension name ("PHU" for primary header)226 int extnum,///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)227 FILE *f)///< file descriptor to read from228 ;238 psMetadata * 239 psImageFReadHeader(psMetadata *output, ///< read data to this structure 240 const char *extname, ///< MEF extension name ("PHU" for primary header) 241 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 242 const FILE *f ///< file descriptor to read from 243 ); 229 244 230 245 /*** image FFT operations ***/ 231 246 /// Perform an FFT on the image. 232 247 psImage * 233 psImageFFT (psImage *input, ///< image to FFT234 int direction)///< FFT direction235 ;248 psImageFFT(psImage *input, ///< image to FFT 249 int direction ///< FFT direction 250 ); 236 251 237 252 /*** basic pixel manipulations ***/ 238 /// Clip image values outside of range to given values. 253 /// Clip image values outside of range to given values. Return number of clipped pixels. 239 254 int 240 psImageClip (psImage *input, ///< clip this image241 float min,///< clip pixels with values < min242 float vmin, ///< set min-clipped pixels to vmin243 float max,///< clip pixels with values > max244 float vmax)///< set max-clipped pixels to vmax245 ;246 247 /// Clip NaN image pixels to given value. 255 psImageClip(psImage *input, ///< clip this image 256 float min, ///< clip pixels with values < min 257 float vmin, ///< set min-clipped pixels to vmin 258 float max, ///< clip pixels with values > max 259 float vmax ///< set max-clipped pixels to vmax 260 ); 261 262 /// Clip NaN image pixels to given value. Return number of clipped pixels. 248 263 int 249 psImageClipNaN (psImage *input, ///< clip this image250 float value)///< set nan pixels to this value251 ;252 253 /// Overlay subregion of image with another image. 264 psImageClipNaN(psImage *input, ///< clip this image & target 265 float value ///< set nan pixels to this value 266 ); 267 268 /// Overlay subregion of image with another image. Return number of pixels replaced. 254 269 int 255 psImageOverlaySection (psImage *image, ///< input image256 psImage *overlay,///< image to overlay257 int x0,///< x offset of overlay subimage258 int y0,///< y offset of overlay subimage259 char *operator)///< overlay operation260 ;270 psImageOverlaySection(psImage *image, ///< input image & target 271 const psImage *overlay, ///< image to overlay 272 int x0, ///< x offset of overlay subimage 273 int y0, ///< y offset of overlay subimage 274 const char *operator ///< overlay operation 275 ); 261 276 262 277 /* \} */ // End of AstroGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
