IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 6, 2004, 4:56:52 PM (22 years ago)
Author:
harman
Message:

Added new psImage files

File:
1 edited

Legend:

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

    r597 r599  
     1/** @file  psImage.h
     2 *
     3 *  @brief Contains basic image definitions and operations
     4 *
     5 *  This file defines the basic type for an image struct and functions useful in manupulating images.
     6 *
     7 *  @author Ross Harman, MHPCC
     8 *   
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-05-07 02:56:52 $
     11 *
     12 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     13 */
    114# ifndef PS_IMAGE_H
    215# define PS_IMAGE_H
    316
    4 /** \file psImage.h
    5  *  \brief Basic image definitions and operations.
    6  *  \ingroup AstroGroup
    7  */
    8 
    9 /// basic image data structure.
     17#include <complex.h>
     18
     19/******************************************************************************/
     20/*  DEFINE STATEMENTS                                                         */
     21/******************************************************************************/
     22
     23// None
     24
     25/******************************************************************************/
     26/*  TYPE DEFINITIONS                                                          */
     27/******************************************************************************/
     28
     29/** Basic image data structure.
     30 *
     31 * Struct for maintaining image data of varying types. It also contains information about image size, parent
     32 * images and children images.
     33 *
     34 */
    1035typedef struct psImage
    1136{
    12     psType type;    ///< image data type and dimension
    13     int nx, ny;    ///< size of image
    14     int x0, y0;    ///< data region relative to parent
     37    psType type;                    ///< Image data type and dimension.
     38    int nx, ny;                     ///< Size of image.
     39    int x0, y0;                     ///< Data region relative to parent.
    1540    union {
    16         psF32 **rows;          ///< == rows_f32
    17         psS8  **rows_s8;  ///< pointers to psS8 data
    18         psS16 **rows_s16;  ///< pointers to psS16 data
    19         psS32 **rows_s32;  ///< pointers to psS32 data
    20         psU8  **rows_u8;  ///< pointers to psU8 data
    21         psU16 **rows_u16;  ///< pointers to psU16 data
    22         psU32 **rows_u32;  ///< pointers to psU32 data
    23         psF32 **rows_f32;  ///< pointers to psF32 data
    24         psF64 **rows_f64;  ///< pointers to psF64 data
    25         psComplex **rows_complex; ///< pointers to psComplex data
    26     } rows;
    27     struct psImage *parent;  ///< parent, if a subimage
    28     int Nchildren;   ///< number of subimages
    29     struct psImage *children;  ///< children of this region; array of Nchildren pointers
     41        float **rows                ///< Pointers to floating point data (default).
     42        short **rows_s;             ///< Pointers to short integer data.
     43        int **rows_i;               ///< Pointers to integer data.
     44        long **rows_l ;             ///< Pointers to long integer data.
     45        unsigned short **rows_us;   ///< Pointers to unsigned short integer data.
     46        unsigned int **rows_ui;     ///< Pointers to unsigned integer data.
     47        unsigned long **rows_ul;    ///< Pointers to unsigned long integer data.
     48        float **rows_f              ///< Pointers to floating point data.
     49        double **rows_d             ///< Pointers to double precision data.
     50        complex float **rows_cf     ///< Pointers to complex floating point data.
     51    } rows;                         ///< Union for data types.
     52    struct psImage *parent;         ///< Parent, if a subimage.
     53    int nChildren;                  ///< Number of subimages.
     54    struct psImage *children;       ///< Children of this region.
    3055}
    3156psImage;
    3257
    33 /** Functions **************************************************************/
    34 /** \addtogroup AstroGroup Astronomy-Specific Utilities
    35  *  \{
    36  */
    37 
    38 /*** Image structure manipulation ***/
    39 
    40 /// Create an image of the specified size and type.
    41 psImage *
    42 psImageAlloc (int nx,   ///< image width
    43               int ny,   ///< image height
    44               psType type  ///< image data type
    45              );
    46 
    47 /// Create a subimage of the specified area.
    48 psImage *
    49 psImageSubset(psImage *out,  ///< Subimage to return, or NULL
    50               const psImage *image, ///< parent image
    51               int nx,   ///< subimage width (<= image.nx - x0)
    52               int ny,   ///< subimage width (<= image.ny - y0)
    53               int x0,   ///< subimage x-offset (0 <= x0 < nx)
    54               int y0   ///< subimage y-offset (0 <= y0 < ny)
    55              );
    56 
    57 /// Destroy the specified image (destroy children if they exist).
    58 void
    59 psImageFree(psImage *restrict image ///< free this image
    60            );
     58/*****************************************************************************/
     59/* FUNCTION PROTOTYPES                                                       */
     60/*****************************************************************************/
     61
     62
     63/** Create an image of the specified size and type.
     64 *
     65 * Uses psLib memory allocation functions to create an image struct of the specified size and type.
     66 *
     67 * @return psImage*: Pointer to psImage.
     68 *
     69 */
     70psImage *psImageAlloc(
     71    int nx,     ///< Image width.
     72    int ny,     ///< Image height.
     73    psType type ///< Image data type.
     74);
     75
     76/** Create a subimage of the specified area.
     77 *
     78 * Uses psLib memory allocation functions to create an image based on a larger one.
     79 *
     80 * @return psImage*: Pointer to psImage.
     81 *
     82 */
     83psImage *psImageSubset(
     84    psImage *out,           ///< Subimage to return, or NULL.
     85    const psImage *image,   ///< Parent image.
     86    int nx,                 ///< Subimage width (<= image.nx - x0).
     87    int ny,                 ///< Subimage width (<= image.ny - y0).
     88    int x0,                 ///< Subimage x-offset (0 <= x0 < nx).
     89    int y0                  ///< Subimage y-offset (0 <= y0 < ny).
     90);
     91
     92/** Destroy the specified image.
     93 *
     94 *  Uses psLib memory deallocation functions to free an image and any existing children.
     95 *
     96 * @return psImage*: Pointer to psImage.
     97 *
     98 */
     99void psImageFree(
     100    psImage *restrict image ///< free this image
     101);
     102
     103
     104
     105// DOXYGEN COMMENTING FORMAT NOT YET FULLY IMPLEMENTED BEYOND THIS POINT
     106
     107
    61108
    62109/** Destroy the pixels of the specified image */
Note: See TracChangeset for help on using the changeset viewer.