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.1.1.1 $ $Name:  $
00011 *  @date $Date: 2005/09/14 20:42:48 $
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 
00021 /// @addtogroup Image
00022 /// @{
00023 
00024 /** Create a subimage of the specified area.
00025  *
00026  *  Define a subimage of the specified area of the given image. This function
00027  *  must raise an error if the requested subset area lies outside of the
00028  *  parent image and return NULL. The argument image is the parent image,
00029  *  region.x0, region.y0 specify the starting pixel of the subraster, and
00030  *  region.x1,region.y1 specify the extent of the desired subraster. Note
00031  *  that the row and column of this “upper right-hand corner” are NOT included
00032  *  in the region. In the event that x1 or y1 are negative, they shall be
00033  *  interpreted as being relative to the size of the parent image in that
00034  *  dimension. The entire subraster must be contained within the raster of the
00035  *  parent image. Note that the refCounter for the parent should be
00036  *  incremented.  This function must be defined for the following types: psU8,
00037  *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
00038  *
00039  *  @return psImage* : Pointer to psImage.
00040  *
00041  */
00042 psImage* psImageSubset(
00043     psImage* image,                    ///< Parent image.
00044     psRegion region                    ///< region of subimage
00045 );
00046 
00047 /** Makes a copy of a psImage
00048  *
00049  * @return psImage* Copy of the input psImage.  This may not be equal to the
00050  * output parameter
00051  *
00052  */
00053 psImage* psImageCopy(
00054     psImage* output,                   ///< if not NULL, a psImage that could be recycled.
00055     const psImage* input,              ///< the psImage to copy
00056     psElemType type                    ///< the desired datatype of the returned copy
00057 );
00058 
00059 /** Trim an image
00060  *
00061  *  Trim the specified image in-place, which involves shuffling the pixels
00062  *  around in memory.  The pixels in the region [col0:col1,row0:row1] shall consist
00063  *  the output image.  The column col1 and row row1 are NOT included in the range.
00064  *  In the event that x1 or y1 are non-positive, they shall be interpreted as
00065  *  being relative to the size of the parent image in that dimension.
00066  *
00067  *  If the entire specified subimage is not contained within the parent
00068  *  image, an error results and the return value will be NULL.
00069  *
00070  *  N.B. If the input psImage is a child of another psImage, no pixel data
00071  *  will be trimmed, rather it equivalent to calling psImageSubset.  If the input
00072  *  psImage is, however, a parent psImage, any children will be obliterated,
00073  *  i.e., freed from memory.
00074  *
00075  *  @return psImage*  trimmed image result
00076  */
00077 psImage* psImageTrim(
00078     psImage* image,                    ///< image to trim
00079     psRegion region                    ///< trim region
00080 );
00081 
00082 /// @}
00083 
00084 #endif // #ifndef PSIMAGE_STRUCT_MANIP_H

Generated on Wed Sep 14 10:42:48 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2