00001 /* @file psImageMaskOps.h 00002 * 00003 * @brief Contains basic image pixel manipulation operations, as 00004 * specified in the PSLIB SDRS sections "Mask Operations" 00005 * 00006 * @author David Robbins, MHPCC 00007 * 00008 * @version $Revision: 1.2 $ $Name: $ 00009 * @date $Date: 2007/01/23 22:47:23 $ 00010 * 00011 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 00012 */ 00013 00014 #ifndef PS_IMAGE_MASK_OPS_H 00015 #define PS_IMAGE_MASK_OPS_H 00016 00017 /// @addtogroup ImageOps Image Operations 00018 /// @{ 00019 00020 #include "psImage.h" 00021 #include "psCoord.h" 00022 #include "psStats.h" 00023 #include "psPixels.h" 00024 00025 /** Sets the bits inside the region, ignoring pixels outside. 00026 * 00027 * The pixels are set by combining the existing pixel value and the given maskValue 00028 * with a logical operation. The allowed operations are =, AND, OR, and XOR. 00029 */ 00030 void psImageMaskRegion( 00031 psImage *image, ///< the image to set 00032 psRegion region, ///< the specified region 00033 const char *op, ///< the logical operation 00034 psMaskType maskValue ///< the specified bits 00035 ); 00036 00037 /** Sets the bits outside the region, ignoring pixels inside. 00038 * 00039 * The pixels are set by combining the existing pixel value and the given maskValue 00040 * with a logical operation. The allowed operations are =, AND, OR, and XOR. 00041 */ 00042 void psImageKeepRegion( 00043 psImage *image, ///< the image to set 00044 psRegion region, ///< the specified region 00045 const char *op, ///< the logical operation 00046 psMaskType maskValue ///< the specified bits 00047 ); 00048 00049 /** Sets the bits inside the circle, ignoring the pixels outside. 00050 * 00051 * The pixel values are set by combining the existing pixel value and the given maskValue 00052 * with a logical operation. The allowed operations are =, AND, OR, and XOR. 00053 */ 00054 void psImageMaskCircle( 00055 psImage *image, ///< the image to set 00056 double x, ///< the x coordinate of the circle's center 00057 double y, ///< the y coordinate of the circle's center 00058 double radius, ///< the radius of the specified circle 00059 const char *op, ///< the logical operation 00060 psMaskType maskValue ///< the specified bits 00061 ); 00062 00063 /** Sets the bits outside the circle, ignoring the pixels inside. 00064 * 00065 * The pixel values are set by combining the existing pixel value and the given maskValue 00066 * with a logical operation. The allowed operations are =, AND, OR, and XOR. 00067 */ 00068 void psImageKeepCircle( 00069 psImage *image, ///< the image to set 00070 double x, ///< the x coordinate of the circle's center 00071 double y, ///< the y coordinate of the circle's center 00072 double radius, ///< the radius of the specified circle 00073 const char *op, ///< the logical operation 00074 psMaskType maskValue ///< the specified bits 00075 ); 00076 00077 /** Grows the specified values on the imput mask image, in, returning the result. 00078 * 00079 * If out is NULL, then a new image of the same type and dimension as in shall 00080 * be allocated and returned; otherwise out shall be modified. If out is non- 00081 * NULL and does not have the same size and type as in, the function shall 00082 * generate an error and return NULL. Pixels in the in image within growSize 00083 * pixels (either horizontal or vertical) of a pixel which matches the maskVal 00084 * shall have the corresponding pixel in the out image set to the growVal. 00085 * 00086 * @return psImage*: 00087 */ 00088 psImage *psImageGrowMask( 00089 psImage *out, ///< the image to set and return 00090 const psImage *in, ///< the input to image 00091 psMaskType maskVal, ///< the specified mask value 00092 unsigned int growSize, ///< the range of values from maskVal 00093 psMaskType growVal ///< the output value to set 00094 ); 00095 00096 /// @} 00097 #endif // #ifndef PS_MASK_OPS_H
1.5.1