IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 617


Ignore:
Timestamp:
May 7, 2004, 2:54:41 PM (22 years ago)
Author:
Paul Price
Message:

Removed "output" in psImageSubset --- always want a new image.

Removed psImageFreeChildren --- it produces dangling pointers, so it's
dangerous.

Added element type to psImageCopy, which allows type conversion.

Added "const" to some psImage functions, and changed the order of
variables in some of the functions to put the output first.

Changed psImageRadialCut to specify radii directly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psImage.h

    r527 r617  
    1010typedef struct psImage {
    1111    psType type;                        ///< image data type and dimension
    12     int nx, ny;                         ///< size of image
    13     int x0, y0;                         ///< data region relative to parent
     12    const int nx, ny;                   ///< size of image
     13    const int x0, y0;                   ///< data region relative to parent
    1414    union {
    1515        float **rows;                   ///< Pointers to floating-point data (default)
     
    2424        complex float **rows_complex;   ///< Pointers to complex floating-point data
    2525    } rows;
    26     struct psImage *parent;             ///< parent, if a subimage
     26    const struct psImage *parent;       ///< parent, if a subimage
    2727    int Nchildren;                      ///< number of subimages
    2828    struct psImage *children;           ///< children of this region; array of Nchildren pointers
     
    4040psImageAlloc (int nx,                   ///< image width
    4141              int ny,                   ///< image height
    42               psType type               ///< image data type
     42              psElemType type           ///< image data type
    4343    );
    4444
    4545/// Create a subimage of the specified area.
    4646psImage *
    47 psImageSubset(psImage *out,             ///< Subimage to return, or NULL
    48               const psImage *image,     ///< parent image
     47psImageSubset(const psImage *image,     ///< parent image
    4948              int nx,                   ///< subimage width (<= image.nx - x0) 
    5049              int ny,                   ///< subimage width (<= image.ny - y0) 
     
    6362    );
    6463
    65 /// Destroy the children of the specified image.  Returns number of children freed.
    66 int
    67 psImageFreeChildren(const psImage *image ///< free children of this image
    68     );
    69 
    7064/// Create a copy of the specified image.
    7165psImage *
    7266psImageCopy(psImage *output,            ///< target structure for output image data
    73             const psImage *input        ///< copy this image
     67            const psImage *input,       ///< copy this image
     68            psElemType type             ///< element type of output image
    7469    );
    7570
     
    106101                 float x,               ///< center x coord of annulii
    107102                 float y,               ///< center y coord of annulii
    108                  float radius,          ///< outer radius of annulii
    109                  float dr,              ///< radial step size of annulii
     103                 const psFloatArray *radii, ///< Radii of the annuli
    110104                 const psStats *stats   ///< defines statistics used to find output values
    111105    );
    112 
    113 /* Contour is a high-level function */
    114 #if 0
    115 /// Extract a 2-d contour from an image at the given threshold.
    116 psFloatArray *
    117 psImageContour(psFloatArray *out,       ///< Vector to output, or NULL
    118                const psImage *input,    ///< create contour for this image
    119                float threshold, ///< contour image at this threshold
    120                int binning              ///< bin image by this value for contour calculation
    121     );
    122 #endif
    123106
    124107/*** various image geometry manipulation ***/
     
    159142/// Determine statistics for image (or subimage).
    160143psStats *
    161 psImageGetStats(const psImage *input,   ///< image (or subimage) to calculate stats
    162                 psStats *stats          ///< defines statistics to be calculated & target
    163     );
     144psImageGetStats(psStats *stats,         ///< defines statistics to be calculated & target
     145                const psImage *input    ///< image (or subimage) to calculate stats
     146                );
    164147
    165148/// Construct a histogram from an image (or subimage).
     
    171154/// Fit a 2-D polynomial surface to an image.
    172155psPolynomial2D *
    173 psImageFitPolynomial(const psImage *input, ///< image to fit
    174                      psPolynomial2D *coeffs ///< coefficient structure carries in desired terms & target
     156psImageFitPolynomial(psPolynomial2D *coeffs, ///< coefficient structure carries in desired terms & target
     157                     const psImage *input ///< image to fit
    175158    );
    176159
    177160/// Evaluate a 2-D polynomial surface to image pixels.
    178 int
    179 psImageEvalPolynomial(const psImage *input, ///< image to fit
     161psImage *
     162psImageEvalPolynomial(const psImage *input, ///< image to produce
    180163                      const psPolynomial2D *coeffs ///< coefficient structure carries in desired terms
    181164    );
     
    210193/// Write an image section to named file (which may exist).
    211194psImage *
    212 psImageWriteSection(psImage *input,    ///< image to write out
     195psImageWriteSection(const psImage *input, ///< image to write out
    213196                    int x,              ///< starting x coord of region           
    214197                    int y,              ///< starting y coord of region           
     
    221204/// Write an image section to named file (which may exist).
    222205psImage *
    223 psImageFWriteSection(psImage *input,    ///< image to write out
     206psImageFWriteSection(const psImage *input, ///< image to write out
    224207                     int x,             ///< starting x coord of region           
    225208                     int y,             ///< starting y coord of region           
     
    240223/// Read only header from image file descriptor.
    241224psMetadata *
    242 psImageFReadHeader(psMetadata *output, ///< read data to this structure
     225psImageFReadHeader(psMetadata *output,  ///< read data to this structure
    243226                   const char *extname, ///< MEF extension name ("PHU" for primary header)
    244227                   int extnum,          ///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)
     
    249232/// Clip image values outside of range to given values.  Return number of clipped pixels.
    250233int
    251 psImageClip(psImage *input,             ///< clip this image
     234psImageClip(psImage *input,             ///< Image to be clipped, and output
    252235            float min,                  ///< clip pixels with values < min
    253236            float vmin,                 ///< set min-clipped pixels to vmin
Note: See TracChangeset for help on using the changeset viewer.