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