IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1442


Ignore:
Timestamp:
Aug 9, 2004, 3:05:53 PM (22 years ago)
Author:
desonia
Message:

doxygen comments added.

Location:
trunk/psLib/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImage.h

    r1441 r1442  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.31 $ $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 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343typedef struct psImage
    4444{
    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.
     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.
    5050
    5151    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.
    7070}
    7171psImage;
    72 
    73 /*****************************************************************************/
    74 
    75 /* FUNCTION PROTOTYPES                                                       */
    76 
    77 /*****************************************************************************/
    7872
    7973/** Create an image of the specified size and type.
     
    8579 *
    8680 */
    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                      );
     81psImage* 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);
    9186
    9287/** Resize a given image to the given size/type.
     
    9590 *
    9691 */
    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                        );
     92psImage* 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);
    10298
    10399/** Frees all children of a psImage.
     
    106102 *
    107103 */
    108 int psImageFreeChildren(psImage* image
     104int psImageFreeChildren(
     105    psImage* image                     ///< psImage in which all children shall be deallocated
     106);
    109107
    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 */
     113psF32 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);
    115120
    116121#define p_psImagePixelInterpolateFcns(TYPE) \
  • trunk/psLib/src/image/psImageIO.h

    r1441 r1442  
    1010 *  @author Robert DeSonia, MHPCC
    1111 *
    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 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3030 *                          signifies that a problem had occured.
    3131 */
    32 psImage* psImageReadSection(psImage* output,
     32psImage* psImageReadSection(
     33    psImage* output,
     34    /**< the output psImage to recycle, or NULL if new psImage desired */
    3335
    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 */
    3638
    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 */
    3941
    40                             /**< the row index of the origin to start reading */
    41                             int numCols,
     42    int numCols,
     43    /**< the number of desired columns to read */
    4244
    43                             /**< the number of desired columns to read */
    44                             int numRows,
     45    int numRows,
     46    /**< the number of desired rows to read */
    4547
    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. */
    4850
    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        */
    5155
    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                              */
    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        */
    5660
    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);
    6464
    6565/** Read an image or subimage from a FITS file specified by a filename.
     
    6767 *  return bool         TRUE is successful, otherwise FALSE.
    6868 */
    69 bool psImageWriteSection(psImage* input,
     69bool psImageWriteSection(
     70    psImage* input,
     71    /**< the psImage to write */
    7072
    71                          /**< the psImage to write */
    72                          int col0,
     73    int col0,
     74    /**< the column index of the origin to start writing */
    7375
    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 */
    7678
    77                          /**< the row index of the origin to start writing */
    78                          int z,
     79    int z,
     80    /**< the z index to start writing */
    7981
    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    */
    8286
    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                           */
    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    */
    8791
    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);
    9595
    9696/// @}
  • trunk/psLib/src/image/psImageManip.h

    r1441 r1442  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.10 $ $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 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232 *  @return int     The number of clipped pixels
    3333 */
    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                );
     34int 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);
    4041
    4142/** Clip image values outside of a specified complex region
     
    4849 *  @return int     The number of clipped pixels
    4950 */
    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                             );
     51int 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);
    5658
    5759/** Clip NaN image pixels to given value.
     
    6264 *  @return int     The number of clipped pixels
    6365 */
    64 int psImageClipNaN(psImage* input,     ///< the image to clip
    65                    psF64 value  ///< the value to set all NaN/Inf values to
    66                   );
     66int psImageClipNaN(
     67    psImage* input,                    ///< the image to clip
     68    psF64 value                        ///< the value to set all NaN/Inf values to
     69);
    6770
    6871/** Overlay subregion of image with another image
     
    7780 *  @return int         0 if success, non-zero if failed.
    7881 */
    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                          );
     82int 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);
    8589
    8690/** Rebin image to new scale.
     
    9498 *  @return psImage    new image formed by rebinning input image.
    9599 */
    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                      );
     100psImage* 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);
    102107
    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 */
     118psImage* 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);
    106124
    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 */
     137psImage* 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);
    110144
    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 */
     156psImage* 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);
    114164
    115165/** Roll image by an integer number of pixels in either direction.
     
    121171 *  @return psImage* the rolled version of the input image.
    122172 */
    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                     );
     173psImage* 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);
    128179
    129180#endif
  • trunk/psLib/src/image/psImageStats.c

    r1440 r1442  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.31 $ $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 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    401401    psFree(rScalingFactors);
    402402
    403     return (0);
    404 }
     403    return input;
     404}
  • trunk/psLib/src/image/psImageStats.h

    r1441 r1442  
    1 
    21/** @file psImageStats.h
    32*  \brief Routines for calculating statistics on images.
     
    109*  @author George Gusciora, MHPCC
    1110*
    12 *  @version $Revision: 1.14 $ $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 $
    1413*
    1514*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2726/// @{
    2827
    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 */
     38psStats* 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);
    3444
    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 */
     53psHistogram* 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);
    3959
    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 */
     69psPolynomial2D* psImageFitPolynomial(
     70    const psImage* input,              ///< image to fit
     71    psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
     72);
    4573
    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 */
     82int psImageEvalPolynomial(
     83    const psImage* input,              ///< input image
     84    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
     85);
    5086
    5187/// @}
  • trunk/psLib/src/imageops/psImageStats.c

    r1440 r1442  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.31 $ $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 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    401401    psFree(rScalingFactors);
    402402
    403     return (0);
    404 }
     403    return input;
     404}
  • trunk/psLib/src/imageops/psImageStats.h

    r1441 r1442  
    1 
    21/** @file psImageStats.h
    32*  \brief Routines for calculating statistics on images.
     
    109*  @author George Gusciora, MHPCC
    1110*
    12 *  @version $Revision: 1.14 $ $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 $
    1413*
    1514*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2726/// @{
    2827
    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 */
     38psStats* 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);
    3444
    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 */
     53psHistogram* 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);
    3959
    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 */
     69psPolynomial2D* psImageFitPolynomial(
     70    const psImage* input,              ///< image to fit
     71    psPolynomial2D* coeffs             ///< coefficient structure carries in desired terms & target
     72);
    4573
    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 */
     82int psImageEvalPolynomial(
     83    const psImage* input,              ///< input image
     84    const psPolynomial2D* coeffs       ///< coefficient structure carries in desired terms
     85);
    5086
    5187/// @}
  • trunk/psLib/src/mathtypes/psImage.h

    r1441 r1442  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.31 $ $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 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4343typedef struct psImage
    4444{
    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.
     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.
    5050
    5151    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.
    7070}
    7171psImage;
    72 
    73 /*****************************************************************************/
    74 
    75 /* FUNCTION PROTOTYPES                                                       */
    76 
    77 /*****************************************************************************/
    7872
    7973/** Create an image of the specified size and type.
     
    8579 *
    8680 */
    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                      );
     81psImage* 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);
    9186
    9287/** Resize a given image to the given size/type.
     
    9590 *
    9691 */
    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                        );
     92psImage* 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);
    10298
    10399/** Frees all children of a psImage.
     
    106102 *
    107103 */
    108 int psImageFreeChildren(psImage* image
     104int psImageFreeChildren(
     105    psImage* image                     ///< psImage in which all children shall be deallocated
     106);
    109107
    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 */
     113psF32 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);
    115120
    116121#define p_psImagePixelInterpolateFcns(TYPE) \
Note: See TracChangeset for help on using the changeset viewer.