psImagePixelManip.h

Go to the documentation of this file.
00001 /* @file  psImagePixelManip.h
00002  *
00003  * @brief Basic image pixel manipulation operations
00004  *
00005  * @author Robert DeSonia, MHPCC
00006  *
00007  * @version $Revision: 1.16 $ $Name:  $
00008  * @date $Date: 2007/01/23 22:47:23 $
00009  *
00010  * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
00011  */
00012 
00013 #ifndef PS_IMAGE_PIXEL_MANIP_H
00014 #define PS_IMAGE_PIXEL_MANIP_H
00015 
00016 /// @addtogroup ImageOps Image Operations
00017 /// @{
00018 
00019 #include "psImage.h"
00020 #include "psCoord.h"
00021 #include "psStats.h"
00022 #include "psPixels.h"
00023 
00024 /** Clip image values outside of range to given values
00025  *
00026  *  All pixels with values less than min are set to the value vmin.  all pixels
00027  *  with values greater than max are set to the value vmax. This function is
00028  *  defined for psU8, psU16, psS8, psS16, psF32, psF64, psC32, and psC64.
00029  *
00030  *  @return int     The number of clipped pixels
00031  */
00032 int psImageClip(
00033     psImage* input,                    ///< the image to clip
00034     double min,                        ///< the minimum image value allowed
00035     double vmin,                       ///< the value pixels < min are set to
00036     double max,                        ///< the maximum image value allowed
00037     double vmax                        ///< the value pixels > max are set to
00038 );
00039 
00040 /** Clip image values outside of a specified complex region
00041  *
00042  *  All pixels outside of the rectangular region in complex space formed by
00043  *  the min and max input parameters are set to the value vmax (if either
00044  *  the real or imaginary portion exceeds the respective max values), or vmin.
00045  *  This function is defined for psC32, and psC64 imagery only.
00046  *
00047  *  @return int     The number of clipped pixels
00048  */
00049 int psImageClipComplexRegion(
00050     psImage* input,                    ///< the image to clip
00051     double complex min,                ///< the minimum image value allowed
00052     double complex vmin,               ///< the value pixels < min are set to
00053     double complex max,                ///< the maximum image value allowed
00054     double complex vmax                ///< the value pixels > max are set to
00055 );
00056 
00057 /** Clip NaN image pixels to given value.
00058  *
00059  *  Pixels with NaN, +Inf, or -Inf values are set to the specified value. This
00060  *  function is defined for psF32, psF64, psC32, and psC64.
00061  *
00062  *  @return int     The number of clipped pixels
00063  */
00064 int psImageClipNaN(
00065     psImage* input,                    ///< the image to clip
00066     float value                        ///< the value to set all NaN/Inf values to
00067 );
00068 
00069 /** Overlay subregion of image with another image
00070  *
00071  *  Replace the pixels in the image which correspond to the pixels in OVERLAY
00072  *  with values derived from the IMAGE and OVERLAY based on the given operator
00073  *  OP.  Valid operators are "=" (set image value to OVERLAY value), "+" (add
00074  *  OVERLAY value to image value), "-" (subtract OVERLAY from image), "*"
00075  *  (multiply OVERLAY times image), "/" (divide image by OVERLAY).  This
00076  *  function is defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
00077  *
00078  *  @return int         0 if success, non-zero if failed.
00079  */
00080 int psImageOverlaySection(
00081     psImage* image,                    ///< target image
00082     const psImage* overlay,            ///< the overlay image
00083     int x0,                            ///< the column to start overlay
00084     int y0,                            ///< the row to start overlay
00085     const char *op                     ///< the operation to perform for overlay
00086 );
00087 
00088 /// @}
00089 #endif // #ifndef PS_IMAGE_PIXEL_MANIP_H

Generated on Fri Feb 2 22:24:35 2007 for pslib by  doxygen 1.5.1