IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1426 for trunk/psLib/src/image


Ignore:
Timestamp:
Aug 9, 2004, 12:44:25 PM (22 years ago)
Author:
desonia
Message:

fixed some stupid indent-induced formating problems and added doxygen
comments.

Location:
trunk/psLib/src/image
Files:
4 edited

Legend:

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

    r1407 r1426  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-08-07 00:06:06 $
     14 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-08-09 22:44:25 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1818 */
    1919#ifndef PS_IMAGE_H
    20 #    define PS_IMAGE_H
     20#define PS_IMAGE_H
    2121
    22 #    include <complex.h>
     22#include <complex.h>
    2323
    24 #    include "psType.h"
     24#include "psType.h"
    2525
    2626/// @addtogroup Image
    2727/// @{
    2828
     29/** enumeration of options in interpolation
     30 *
     31 */
    2932typedef enum {
    30     PS_INTERPOLATE_FLAT,
    31     PS_INTERPOLATE_BILINEAR
     33    PS_INTERPOLATE_FLAT,               ///< 'flat' interpolation (nearest pixel)
     34    PS_INTERPOLATE_BILINEAR            ///< bi-linear interpolation
    3235} psImageInterpolateMode;
    3336
     
    4043typedef struct psImage
    4144{
    42     const psType type;          // /< Image data type and dimension.
    43     const unsigned int numCols; // /< Number of columns in image
    44     const unsigned int numRows; // /< Number of rows in image.
    45     const int col0;             // /< Column position relative to parent.
    46     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.
    4750
    4851    union {
    49         psU8 **U8;              // /< Unsigned 8-bit integer data.
    50         psU16 **U16;            // /< Unsigned 16-bit integer data.
    51         psU32 **U32;            // /< Unsigned 32-bit integer data.
    52         psU64 **U64;            // /< Unsigned 64-bit integer data.
    53         psS8 **S8;              // /< Signed 8-bit integer data.
    54         psS16 **S16;            // /< Signed 16-bit integer data.
    55         psS32 **S32;            // /< Signed 32-bit integer data.
    56         psS64 **S64;            // /< Signed 64-bit integer data.
    57         psF32 **F32;            // /< Single-precision float data.
    58         psF64 **F64;            // /< Double-precision float data.
    59         psC32 **C32;            // /< Single-precision complex data.
    60         psC64 **C64;            // /< Double-precision complex data.
    61         psPTR **PTR;            // /< Void pointers.
    62         psPTR *V;               // /< Pointer to data.
    63     } data;                     // /< Union for data types.
    64     const struct psImage *parent;       // /< Parent, if a subimage.
    65     int nChildren;              // /< Number of subimages.
    66     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.
    6770}
    6871psImage;
     
    8285 *
    8386 */
    84 psImage *psImageAlloc(unsigned int numCols,     // /< Number of rows in image.
    85                       unsigned int numRows,     // /< Number of columns in image.
    86                       const psElemType type     // /< Type of data for image.
     87psImage *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.
    8790                     );
    8891
     
    9295 *
    9396 */
    94 psImage *psImageRecycle(psImage * old,  // /< the psImage to recycle by resizing image buffer
    95                         unsigned int numCols,   // /< the desired number of columns in image
    96                         unsigned int numRows,   // /< the desired number of rows in image
    97                         const psElemType type   // /< the desired datatype of the image
     97psImage *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
    98101                       );
    99102
  • trunk/psLib/src/image/psImageExtraction.h

    r1407 r1426  
    1010*  @author Robert DeSonia, MHPCC
    1111*
    12 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-07 00:06:06 $
     12*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-09 22:44:25 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626/// @{
    2727
     28/* Cut direction flag.  Used with psImageCut function.
     29 */
    2830typedef enum {
    29     PS_CUT_X_POS,
    30     PS_CUT_X_NEG,
    31     PS_CUT_Y_POS,
    32     PS_CUT_Y_NEG,
     31    PS_CUT_X_POS,                      ///< Cut in the x dimension from left to right
     32    PS_CUT_X_NEG,                      ///< Cut in the x dimension from rigth to left
     33    PS_CUT_Y_POS,                      ///< Cut in the y dimension from bottom up
     34    PS_CUT_Y_NEG,                      ///< Cut in the y dimension from top down.
    3335} psImageCutDirection;
    3436
    3537/** Create a subimage of the specified area.
    36 *
    37 * Uses psLib memory allocation functions to create an image based on a larger
    38 * one.
    39 *
    40 * @return psImage*: Pointer to psImage.
    41 *
    42 */
    43 psImage *psImageSubset(psImage * out,   // /< Subimage to return, or NULL.
    44                        psImage * image, // /< Parent image.
    45                        unsigned int numCols,    // /< Subimage width (<= image.nCols - col0).
    46                        unsigned int numRows,    // /< Subimage height (<= image.nRows - row0).
    47                        unsigned int col0,       // /< Subimage col-offset (0 <= col0 < nCol).
    48                        unsigned int row0        // /< Subimage row-offset (0 <= row0 < nCol).
    49                       );
     38 *
     39 * Uses psLib memory allocation functions to create an image based on a larger
     40 * one.
     41 *
     42 * @return psImage*: Pointer to psImage.
     43 *
     44 */
     45psImage* psImageSubset(
     46    psImage* out,                      ///< image to recycle, or NULL.
     47    psImage* image,                    ///< Parent image.
     48    unsigned int numCols,              ///< Subimage width (<= image.nCols - col0).
     49    unsigned int numRows,              ///< Subimage height (<= image.nRows - row0).
     50    unsigned int col0,                 ///< Subimage col-offset (0 <= col0 < nCol).
     51    unsigned int row0                  ///< Subimage row-offset (0 <= row0 < nCol).
     52);
    5053
    5154/** Makes a copy of a psImage
     
    5558 *
    5659 */
    57 psImage *psImageCopy(psImage * restrict output,
     60psImage* psImageCopy(
     61    psImage* restrict output,          ///< if not NULL, a psImage that could be recycled.
     62    const psImage* input,              ///< the psImage to copy
     63    psElemType type                    ///< the desired datatype of the returned copy
     64);
    5865
    59                      /**< if not NULL, a psImage that could be recycled.  If it can not be used,
    60                       *   it will be freed via psImageFree
    61                       */
    62                      const psImage * input,
    6366
    64                      /**< the psImage to copy */
    65                      psElemType type
     67/** Extract pixels from rectlinear region to a vector (array of floats).
     68 *
     69 *  The output vector contains either nx or ny elements, based on the value of
     70 *  the direction: e.g., if direction is PS_CUT_X_POS, there are nx elements.
     71 *  The input region is collapsed in the perpendicular direction, and each
     72 *  element of the output vectors is derived from the statistics of the pixels
     73 *  at that direction coordinate. The statistic used to derive the output
     74 *  vector value is specified by stats. Only one of the statistics choices may
     75 *  be specified, otherwise the function must return an error. This function
     76 *  must be defined for the following types: psS8, psU16, psF32, psF64.
     77 *
     78 * @return psVector    the resulting vector
     79 */
     80psVector *psImageSlice(
     81    psVector* out,                     ///< psVector to recycle, or NULL.
     82    psVector* slicePositions,
     83    ///< If not NULL, it is populated with the coordinate in the slice dimension
     84    ///< coorsponding to the output vector's value of the same position in the
     85    ///< vector.  This vector maybe resized and retyped as appropriate.
     86    const psImage* restrict input,     ///< the input image in which to perform the slice
     87    const psImage* restrict mask,      ///< the mask for the input image.
     88    unsigned int maskVal,              ///< the mask value to apply to the mask
     89    unsigned int col,                  ///< the leftmost column of the slice region
     90    unsigned int row,                  ///< the bottommost row of the slice region
     91    unsigned int numCols,              ///< the number of columns in the slice region
     92    unsigned int numRows,              ///< the number of rows in the slice region
     93    psImageCutDirection direction,     ///< the slice dimension and direction
     94    const psStats* stats               ///< the statistic to perform in slice operation
     95);
    6696
    67                      /**< the desired datatype of the returned copy */
    68                     );
     97/** Extract pixels from an image along a line to a vector (array of floats).
     98 *
     99 *  The vector (xs,ys) - (xe,ye) forms the basis of the output vector. Pixels
     100 *  are considered in a rectangular region of width dw about this vector. The
     101 *  input region is collapsed in the perpendicular direction, and each element
     102 *  of the output vector represents pixel-sized boxes, where the value is
     103 *  derived from the statistics of the pixels interpolated along the
     104 *  perpendicular direction. The specific algorithm which must be used is
     105 *  described in the PSLib ADD (PSDC-430-006). The statistic used to derive
     106 *  the output vector value is specified by stats. Only one of the statistics
     107 *  choices may be specified, otherwise the function must return an error.
     108 *  This function must be defined for the following types: psS8, psU16, psF32,
     109 *  psF64.
     110 *
     111 *  @return psVector    resulting vector
     112 */
     113psVector *psImageCut(
     114    psVector* out,                     ///< psVector to recycle, or NULL.
     115    const psImage* input,              ///< the input image in which to perform the cut
     116    const psImage* restrict mask,      ///< the mask for the input image.
     117    unsigned int maskVal,              ///< the mask value to apply to the mask
     118    float startCol,                    ///< the column of the start of the cut line
     119    float startRow,                    ///< the row of the start of the cut line
     120    float endCol,                      ///< the column of the end of the cut line
     121    float endRow,                      ///< the row of the end of the cut line
     122    float width,                       ///< the distance about the line to perform the statistics
     123    const psStats* stats               ///< the statistic to perform in operation
     124);
    69125
    70 psVector *psImageSlice(psVector * out,
    71                        psVector * slicePositions,
    72                        const psImage * restrict input,
    73                        const psImage * restrict mask,
    74                        unsigned int maskVal,
    75                        unsigned int col,
    76                        unsigned int row,
    77                        unsigned int numCols,
    78                        unsigned int numRows, psImageCutDirection direction, const psStats * stats);
    79 
    80 psVector *psImageCut(psVector * out,
    81                      const psImage * input,
    82                      const psImage * restrict mask,
    83                      unsigned int maskVal,
    84                      float startCol,
    85                      float startRow, float endCol, float endRow, float width, const psStats * stats);
    86 
    87 psVector *psImageRadialCut(psVector * out,
    88                            const psImage * input,
    89                            const psImage * restrict mask,
    90                            unsigned int maskVal,
    91                            float centerCol, float centerRow, const psVector * radii, const psStats * stats);
     126/** Extract radial region data to a vector. A vector is constructed where each
     127 *  vector elements is derived from the statistics of the pixels which land
     128 *  within one of a sequence of radii. The radii are centered on the image
     129 *  pixel coordinate x,y, and are defined by the sequence of values in the
     130 *  vector radii. The specific algorithm which must be used is described in
     131 *  the PSLib ADD (PSDC-430-006). The statistic used to derive the output
     132 *  vector value is specified by stats. Only one of the statistics choices
     133 *  may be specified, otherwise the function must return an error. This
     134 *  function must be defined for the following types: psS8, psU16, psF32,
     135 *  psF64.
     136 *
     137 *  @return psVector    resulting vector
     138 */
     139psVector* psImageRadialCut(
     140    psVector* out,                     ///< psVector to recycle, or NULL.
     141    const psImage* input,              ///< the input image in which to perform the cut
     142    const psImage* restrict mask,      ///< the mask for the input image.
     143    unsigned int maskVal,              ///< the mask value to apply to the mask
     144    float centerCol,                   ///< the column of the center of the cut circle
     145    float centerRow,                   ///< the row of the center of the cut circle
     146    const psVector* radii,             ///< the radii of the cut circle
     147    const psStats* stats               ///< the statistic to perform in operation
     148);
    92149
    93150/// @}
  • trunk/psLib/src/image/psImageManip.h

    r1407 r1426  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-08-07 00:06:06 $
     13 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-08-09 22:44:25 $
    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
     34int 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
    3939               );
    4040
     
    4848 *  @return int     The number of clipped pixels
    4949 */
    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
     50int 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
    5555                            );
    5656
     
    6262 *  @return int     The number of clipped pixels
    6363 */
    64 int psImageClipNaN(psImage * input,     // /< the image to clip
    65                    psF64 value  // /< the value to set all NaN/Inf values to
     64int psImageClipNaN(psImage * input,     ///< the image to clip
     65                   psF64 value  ///< the value to set all NaN/Inf values to
    6666                  );
    6767
     
    7777 *  @return int         0 if success, non-zero if failed.
    7878 */
    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
     79int 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
    8484                         );
    8585
     
    9494 *  @return psImage    new image formed by rebinning input image.
    9595 */
    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
     96psImage *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
    100100                      // method should be set.
    101101                     );
    102102
    103 psImage *psImageResample(psImage * out, // /< an psImage to recycle.  If NULL, a new image is created
    104                          const psImage * in,    // /< input image
     103psImage *psImageResample(psImage * out, ///< an psImage to recycle.  If NULL, a new image is created
     104                         const psImage * in,    ///< input image
    105105                         int scale, psImageInterpolateMode mode);
    106106
    107 psImage *psImageRotate(psImage * out,   // /< an psImage to recycle.  If NULL, a new image is created
    108                        const psImage * in,      // /< input image
     107psImage *psImageRotate(psImage * out,   ///< an psImage to recycle.  If NULL, a new image is created
     108                       const psImage * in,      ///< input image
    109109                       float angle, float unexposedValue, psImageInterpolateMode mode);
    110110
    111 psImage *psImageShift(psImage * out,    // /< an psImage to recycle.  If NULL, a new image is created
    112                       const psImage * in,       // /< input image
     111psImage *psImageShift(psImage * out,    ///< an psImage to recycle.  If NULL, a new image is created
     112                      const psImage * in,       ///< input image
    113113                      float dx, float dy, float unexposedValue, psImageInterpolateMode mode);
    114114
     
    121121 *  @return psImage*    the rolled version of the input image.
    122122 */
    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
     123psImage *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
    127127                    );
    128128
  • trunk/psLib/src/image/psImageStats.h

    r1407 r1426  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-08-07 00:06:06 $
     12*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-08-09 22:44:25 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828
    2929/// 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
     30psStats *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
    3434
    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
     35psHistogram *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
    3939
    4040/// 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
     41psPolynomial2D *psImageFitPolynomial(const psImage * input,     ///< image to fit
     42                                     psPolynomial2D * coeffs    ///< coefficient structure carries in
    4343                                     // desired terms & target
    4444                                    );
    4545
    4646/// 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
     47int psImageEvalPolynomial(const psImage * input,        ///< image to fit
     48                          const psPolynomial2D * coeffs ///< coefficient structure carries in desired terms
    4949                         );
    5050
Note: See TracChangeset for help on using the changeset viewer.