Changeset 1585
- Timestamp:
- Aug 18, 2004, 5:18:31 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 5 edited
-
psConvolve.h (modified) (1 diff)
-
psFFT.h (modified) (4 diffs)
-
psImage.h (modified) (15 diffs)
-
psMath.h (modified) (1 diff)
-
psMatrix.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psConvolve.h
r1425 r1585 33 33 int yMax ///< Size of the kernel in the positive y direction 34 34 ); 35 /** Destructor */36 void psKernelFree(psKernel *myKernel ///< Kernel to destroy37 );38 35 39 36 /** Returns the kernel of OT shifts made during the course of the exposure. */ -
trunk/archive/pslib/include/psFFT.h
r825 r1585 34 34 ; 35 35 36 /** Calculate power spectrum of a vector of floating-point numbers */37 psVector *38 psVectorPowerSpectrum(psVector *out, ///< Vector for output (or NULL)39 const psVector *vector) ///< Vector to obtain power spectrum of40 ;41 42 36 /** Get the real part of a vector */ 43 37 psVector * … … 65 59 ; 66 60 61 /** Calculate power spectrum of a vector of floating-point numbers */ 62 psVector * 63 psVectorPowerSpectrum(psVector *out, ///< Vector for output (or NULL) 64 const psVector *vector) ///< Vector to obtain power spectrum of 65 ; 66 67 67 /**** Image FFT & Complex functions ****/ 68 68 … … 72 72 const psImage *image, ///< image to transform (if forward, may be real) 73 73 psFFTFlags dir) ///< FFT direction 74 ;75 76 /** Calculate power spectrum of an image */77 psImage *78 psImagePowerSpectrum(psImage *out, ///< Image for output (or NULL)79 const psImage *image) ///< Image to obtain power spectrum of80 74 ; 81 75 … … 106 100 107 101 102 /** Calculate power spectrum of an image */ 103 psImage * 104 psImagePowerSpectrum(psImage *out, ///< Image for output (or NULL) 105 const psImage *image) ///< Image to obtain power spectrum of 106 ; 107 108 108 /* \} */ // End of MathGroup Functions 109 109 -
trunk/archive/pslib/include/psImage.h
r1576 r1585 48 48 psImage * 49 49 psImageSubset(const psImage *image, ///< parent image 50 int width,///< subimage width (<= image.ncols - col0)51 int height,///< subimage height (<= image.nrows - row0)50 int nx, ///< subimage width (<= image.ncols - col0) 51 int ny, ///< subimage height (<= image.nrows - row0) 52 52 int x0, ///< subimage starting col (0 <= col0 < ncols) 53 53 int y0) ///< subimage starting row (0 <= row0 < nrows) … … 57 57 psImage * 58 58 psImageSubsection(const psImage *image, ///< Parent image 59 const *section ///< Image section, of the form [x1:x2,y1:y2] 60 ); 61 62 63 /// Destroy the specified image (destroy children if they exist). 64 void 65 psImageFree(psImage *restrict image) ///< free this image 66 ; 67 68 /** Destroy the pixels of the specified image */ 69 psImage * 70 psImageFreePixels(psImage *restrict image) ///< Image whose pixels are to be freed 71 ; 59 const char *section ///< Image section, of the form [x1:x2,y1:y2] 60 ); 61 72 62 73 63 /// Create a copy of the specified image. … … 78 68 ; 79 69 70 80 71 /// Trim an image, in-place in memory 81 72 psImage * … … 85 76 ); 86 77 87 88 78 /*** various image pixel extractions ***/ 79 80 /** Direction in which to cut */ 81 typedef enum { 82 PS_CUT_X_POS, ///< Cut in positive x direction 83 PS_CUT_X_NEG, ///< Cut in negative x direction 84 PS_CUT_Y_POS, ///< Cut in positive y direction 85 PS_CUT_Y_NEG ///< Cut in negative y direction 86 } psImageCutDirection; 89 87 90 88 /// Extract pixels from rectlinear region to a vector. 91 89 psVector * 92 90 psImageSlice(psVector *out, ///< Vector to output, or NULL 93 const psImage *input, ///< extract slice from this image 94 int x, ///< starting x coord of region to slice 95 int y, ///< starting y coord of region to slice 96 int nx, ///< length of region in x 97 int ny, ///< length of region in y 98 int direction, ///< direction of vector along slice 99 const psStats *stats) ///< defines statistics used to find output values 100 ; 91 psVector *coords, ///< Returned coordinates along the slice, or NULL 92 const psImage *input, ///< Input image 93 const psImage *mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 94 unsigned int maskVal, ///< Value in mask to ignore 95 unsigned int x, ///< starting x coord of region to slice 96 unsigned int y, ///< starting y coord of region to slice 97 unsigned int nx, ///< length of region in x 98 unsigned int ny, ///< length of region in y 99 psImageCutDirection direction, ///< Direction in which to cut 100 const psStats *stats ///< defines statistics used to find output values 101 ); 101 102 102 103 /// Extract pixels along a line to a vector. … … 104 105 psImageCut(psVector *out, ///< Vector to output, or NULL 105 106 const psImage *input, ///< extract cut from this image 107 const psImage *mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 108 unsigned int maskVal, ///< Value in mask to ignore 106 109 float xs, ///< starting x coord of cut 107 110 float ys, ///< starting y coord of cut … … 109 112 float ye, ///< ending y coord of cut 110 113 float dw, ///< width of cut 111 const psStats *stats) ///< defines statistics used to find output values114 const psStats *stats) ///< defines statistics used to find output values 112 115 ; 113 116 … … 116 119 psImageRadialCut(psVector *out, ///< Vector to output, or NULL 117 120 const psImage *input, ///< extract profile from this image 121 const psImage *mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 122 unsigned int maskVal, ///< Value in mask to ignore 118 123 float x, ///< center x coord of annulii 119 124 float y, ///< center y coord of annulii … … 123 128 124 129 /*** various image geometry manipulation ***/ 130 131 /** How to do interpolation */ 132 typedef enum { 133 PS_INTERPOLATE_FLAT, 134 PS_INTERPOLATE_BILINEAR, 135 PS_INTERPOLATE_BICUBIC, 136 PS_INTERPOLATE_SINC 137 } psImageInterpolateMode mode; 138 125 139 /// Rebin image to new scale. 126 140 psImage * 127 141 psImageRebin(psImage *out, ///< Image to output, or NULL 128 const psImage *input, ///< rebin this image 129 float scale, ///< rebinning scale: doutput = scale*dinput 142 const psImage *in, ///< rebin this image 143 const psImage *restrict mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 144 unsigned int maskVal, ///< Value in mask to ignore 145 int scale, ///< rebinning scale 130 146 const psStats *stats) ///< defines statistics used to find output values 131 147 ; 132 148 149 /** Resample image to new scale */ 150 psImage * 151 psImageResample(psImage *out, ///< Image to output, or NULL 152 const psImage *in, ///< resample this image 153 int scale, ///< Factor by which to resample 154 psImageInterpolateMode mode ///< Interpolation method 155 ); 156 133 157 /// Rotate image by given angle. 134 158 psImage * 135 159 psImageRotate(psImage *out, ///< Image to output, or NULL 136 const psImage *input, ///< rotate this image 137 float angle) ///< rotate by this amount anti-clockwise (degrees) 138 ; 160 const psImage *in, ///< rotate this image 161 float angle ///< rotate by this amount anti-clockwise (degrees) 162 psC64 exposed, ///< Set exposed pixels to this value 163 psImageInterpolateMode mode ///< Interpolation method 164 ); 139 165 140 166 /// Shift image by an arbitrary number of pixels in either direction. … … 142 168 psImage * 143 169 psImageShift(psImage *out, ///< Image to output, or NULL 144 const psImage *in put,///< shift this image170 const psImage *in, ///< shift this image 145 171 float dx, ///< shift by this amount in x 146 172 float dy, ///< shift by this amount in y 147 float exposed) ///< set exposed pixels to this value 148 ; 173 psC64 exposed, ///< set exposed pixels to this value 174 psImageInterpolateMode mode ///< Interpolation method 175 ); 149 176 150 177 /// Roll image by an integer number of pixels in either direction. … … 152 179 psImage * 153 180 psImageRoll(psImage *out, ///< Image to output, or NULL 154 const psImage *in put, ///< roll this image181 const psImage *in, ///< roll this image 155 182 int dx, ///< roll this amount in x 156 183 int dy) ///< roll this amount in y … … 160 187 psStats * 161 188 psImageGetStats(psStats *stats, ///< defines statistics to be calculated & target 162 const psImage *input) ///< image (or subimage) to calculate stats 163 ; 189 const psImage *in, ///< image (or subimage) to calculate stats 190 const psImage *mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 191 unsigned int maskVal ///< Value in mask to ignore 192 ); 164 193 165 194 /// Construct a histogram from an image (or subimage). 166 195 psHistogram * 167 196 psImageHistogram(psHistogram *hist, ///< input histogram description & target 168 const psImage *input) ///< determine histogram of this image 169 ; 197 const psImage *in ///< determine histogram of this image 198 const psImage *mask, ///< Ignore those pixels where mask & maskVal == 1. May be NULL 199 unsigned int maskVal ///< Value in mask to ignore 200 ); 170 201 171 202 /// Fit a 2-D polynomial surface to an image. … … 177 208 /// Evaluate a 2-D polynomial surface to image pixels. 178 209 psImage * 179 psImageEvalPolynomial( const psImage *input,///< image to produce210 psImageEvalPolynomial(psImage *input, ///< image to produce 180 211 const psPolynomial2D *coeffs) ///< coefficient structure carries in desired terms 181 212 ; 213 214 /** Perform interpolation of image pixel values */ 215 psF64 216 psImagePixelInterpolate(const psImage *input, ///< Image on which to interpolate 217 float x, float y, ///< Fractional pixel coordinates at which to interpolate 218 psC64 unexposedValue, ///< Value for pixels that don't have an input value 219 psImageInterpolateMode mode ///< Interpolation method 220 ); 221 182 222 183 223 /*** image input/output routines ***/ … … 185 225 psImage * 186 226 psImageReadSection(psImage *output, ///< place data in this structure for output 187 int x , ///< starting x coord of region188 int y , ///< starting y coord of region227 int x0, ///< starting x coord of region 228 int y0, ///< starting y coord of region 189 229 int nx, ///< x size of region (-1 for full range) 190 230 int ny, ///< y size of region (-1 for full range) … … 192 232 const char *extname, ///< MEF extension name ("PHU" for primary header) 193 233 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 194 const char *filename) ///< file to read data from 195 ; 196 197 /// Read an image or subimage from file descriptor. 198 psImage * 199 psImageFReadSection(psImage *output, ///< place data in this structure for output 200 int x, ///< starting x coord of region 201 int y, ///< starting y coord of region 202 int nx, ///< x size of region (-1 for full range) 203 int ny, ///< y size of region (-1 for full range) 204 int z, ///< plane of interest 205 const char *extname, ///< MEF extension name ("PHU" for primary header) 206 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1) 207 FILE *f) ///< file descriptor to read data from 234 const char *filename) ///< file to read data from 208 235 ; 209 236 … … 219 246 ; 220 247 221 /// Write an image section to named file (which may exist).222 psImage *223 psImageFWriteSection(const psImage *input, ///< image to write out224 int x, ///< starting x coord of region225 int y, ///< starting y coord of region226 int z, ///< plane of interest227 const char *extname, ///< MEF extension name228 int extnum, ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)229 FILE *f) ///< file descriptor to write data to230 ;231 232 248 /*** basic pixel manipulations ***/ 233 249 /// Clip image values outside of range to given values. Return number of clipped pixels. 234 250 int 235 251 psImageClip(psImage *input, ///< Image to be clipped, and output 236 float min, ///< clip pixels with values < min 237 float vmin, ///< set min-clipped pixels to vmin 238 float max, ///< clip pixels with values > max 239 float vmax) ///< set max-clipped pixels to vmax 240 ; 252 double min, ///< clip pixels with values < min 253 double vmin, ///< set min-clipped pixels to vmin 254 double max, ///< clip pixels with values > max 255 double vmax) ///< set max-clipped pixels to vmax 256 ; 257 258 /** Clipping for complex data */ 259 int 260 psImageClipComplexRegion(psImage *input, ///< Image to be clipped, and output 261 complex double min, ///< clip pixels with values < min 262 complex double vmin, ///< set min-clipped pixels to vmin 263 complex double max, ///< clip pixels with values > max 264 complex double vmax ///< set max-clipped pixels to vmax 265 ); 241 266 242 267 /// Clip NaN image pixels to given value. Return number of clipped pixels. -
trunk/archive/pslib/include/psMath.h
r1574 r1585 49 49 void *in, ///< input 50 50 char *op) ///< operator 51 ;52 53 /** create a psType-ed structure from a constant double value. */54 p_psScalar *55 psScalar (double value);56 57 /** create a psType-ed structure from a specified type */58 p_psScalar *59 psScalarType (char *mode, ///< type description60 ...) ///< value (or values) of specified types61 51 ; 62 52 -
trunk/archive/pslib/include/psMatrix.h
r753 r1585 15 15 /* Linear Algebra */ 16 16 17 /** LU Decomposition of a matrix */ 18 psImage * 19 psMatrixLUD(psImage *out, ///< Matrix to return, or NULL 20 psVector *perm, ///< Permutation vector 21 const psImage *in) ///< Matrix to decompose 22 ; 23 24 /** LU Solution. Solves for and returns x in the equation Ax = b */ 25 psVector * 26 psMatrixLUSolve(psVector *out, ///< Vector to return, or NULL 27 const psImage *LU, ///< LU-decomposed matrix 28 const psVector *RHS, ///< right-hand-side of the equation 29 const psVector *perm ///< Permutation vector 30 ; 31 17 32 /** Invert matrix. Not using restrict, to allow inversion to be done in-place */ 18 33 psImage * 19 34 psMatrixInvert(psImage *out, ///< Matrix to return, or NULL 20 35 const psImage *myMatrix, ///< Matrix to be inverted 21 float * restrict determinant)///< Determinant to return, or NULL36 float *determinant) ///< Determinant to return, or NULL 22 37 ; 23 38 24 39 /** Matrix determinant */ 25 40 float 26 psMatrixDeterminant(const psImage * restrictmyMatrix) ///< Matrix to get determinant for41 psMatrixDeterminant(const psImage *myMatrix) ///< Matrix to get determinant for 27 42 ; 28 43 … … 40 55 ; 41 56 42 /** LU Decomposition of a matrix */43 psImage *44 psMatrixLUD(psImage *out, ///< Matrix to return, or NULL45 psImage *in) ///< Matrix to decompose46 ;47 48 /** LU Solution. Solves for and returns x in the equation Ax = b */49 psVector *50 psMatrixLUSolve(psVector *out, ///< Vector to return, or NULL51 const psImage *LU, ///< LU-decomposed matrix52 const psVector *RHS) ///< right-hand-side of the equation53 ;54 55 57 /** Eigenvectors of a matrix */ 56 58 psVector * … … 65 67 psVector * 66 68 psMatrixToVector(psVector *out, ///< Vector to return, or NULL 67 psImage *in)///< Matrix to convert69 const psImage *in) ///< Matrix to convert 68 70 ; 69 71 … … 71 73 psImage * 72 74 psVectorToMatrix(psImage *out, ///< Matrix to return, or NULL 73 psVector *in)///< Vector to convert75 const psVector *in) ///< Vector to convert 74 76 ; 75 77
Note:
See TracChangeset
for help on using the changeset viewer.
