Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

psImageStructManip.h

Go to the documentation of this file.
00001 /** @file  psImageStructManip.h
00002 *
00003 *  @brief Contains basic image structure manipulation operations, as specified
00004 *         in the PSLIB SDRS sections "Image Structure Manipulation".
00005 *
00006 *  @ingroup Image
00007 *
00008 *  @author Robert DeSonia, MHPCC
00009 *
00010 *  @version $Revision: 1.4 $ $Name: rel12 $
00011 *  @date $Date: 2006/04/17 22:00:03 $
00012 *
00013 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
00014 */
00015 
00016 #ifndef PSIMAGE_STRUCT_MANIP_H
00017 #define PSIMAGE_STRUCT_MANIP_H
00018 
00019 #include "psImage.h"
00020 #include "psRegion.h"
00021 
00022 /// @addtogroup Image
00023 /// @{
00024 
00025 /** Create a subimage of the specified area.
00026  *
00027  *  Define a subimage of the specified area of the given image. This function
00028  *  must raise an error if the requested subset area lies outside of the
00029  *  parent image and return NULL. The argument image is the parent image,
00030  *  region.x0, region.y0 specify the starting pixel of the subraster, and
00031  *  region.x1,region.y1 specify the extent of the desired subraster. Note
00032  *  that the row and column of this “upper right-hand corner” are NOT included
00033  *  in the region. In the event that x1 or y1 are negative, they shall be
00034  *  interpreted as being relative to the size of the parent image in that
00035  *  dimension. The entire subraster must be contained within the raster of the
00036  *  parent image. Note that the refCounter for the parent should be
00037  *  incremented.  This function must be defined for the following types: psU8,
00038  *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
00039  *
00040  *  @return psImage* : Pointer to psImage.
00041  *
00042  */
00043 psImage* psImageSubset(
00044     psImage* image,                    ///< Parent image.
00045     psRegion region                    ///< region of subimage
00046 );
00047 
00048 /** Makes a copy of a psImage
00049  *
00050  * @return psImage* Copy of the input psImage.  This may not be equal to the
00051  * output parameter
00052  *
00053  */
00054 psImage* psImageCopy(
00055     psImage* output,                   ///< if not NULL, a psImage that could be recycled.
00056     const psImage* input,              ///< the psImage to copy
00057     psElemType type                    ///< the desired datatype of the returned copy
00058 );
00059 
00060 /** Trim an image
00061  *
00062  *  Trim the specified image in-place, which involves shuffling the pixels
00063  *  around in memory.  The pixels in the region [col0:col1,row0:row1] shall consist
00064  *  the output image.  The column col1 and row row1 are NOT included in the range.
00065  *  In the event that x1 or y1 are non-positive, they shall be interpreted as
00066  *  being relative to the size of the parent image in that dimension.
00067  *
00068  *  If the entire specified subimage is not contained within the parent
00069  *  image, an error results and the return value will be NULL.
00070  *
00071  *  N.B. If the input psImage is a child of another psImage, no pixel data
00072  *  will be trimmed, rather it equivalent to calling psImageSubset.  If the input
00073  *  psImage is, however, a parent psImage, any children will be obliterated,
00074  *  i.e., freed from memory.
00075  *
00076  *  @return psImage*  trimmed image result
00077  */
00078 psImage* psImageTrim(
00079     psImage* image,                    ///< image to trim
00080     psRegion region                    ///< trim region
00081 );
00082 
00083 /// @}
00084 
00085 #endif // #ifndef PSIMAGE_STRUCT_MANIP_H

Generated on Mon Jul 3 14:13:44 2006 for Pan-STARRS Foundation Library by  doxygen 1.4.4