IM: im_process_pon.h Source File

IM - An Imaging Tool

im_process_pon.h

Go to the documentation of this file.
00001 /** \file
00002  * \brief Image Processing - Pontual Operations
00003  *
00004  * See Copyright Notice in im_lib.h
00005  * $Id: im_process_pon.h,v 1.2 2005/06/06 18:12:14 scuri Exp $
00006  */
00007 
00008 #ifndef __IM_PROCESS_PON_H
00009 #define __IM_PROCESS_PON_H
00010 
00011 #include "im_image.h"
00012 
00013 #if defined(__cplusplus)
00014 extern "C" {
00015 #endif
00016 
00017 
00018 
00019 /** \defgroup arithm Arithmetic Operations 
00020  * \par
00021  * Simple math operations for images.
00022  * \par
00023  * See \ref im_process_pon.h
00024  * \ingroup process */
00025 
00026 /** Unary Arithmetic Operations.
00027  * Inverse and log may lead to math exceptions.
00028  * \ingroup arithm */
00029 enum imUnaryOp {
00030   IM_UN_EQL,    /**< equal             =     a        */
00031   IM_UN_ABS,    /**< abssolute         =    |a|       */
00032   IM_UN_LESS,   /**< less              =    -a        */
00033   IM_UN_INC,    /**< increment        +=     a        */
00034   IM_UN_INV,    /**< invert            =   1/a       (#) */
00035   IM_UN_SQR,    /**< square            =     a*a      */
00036   IM_UN_SQRT,   /**< square root       =     a^(1/2)  */
00037   IM_UN_LOG,    /**< natural logarithm =  ln(a)      (#) */
00038   IM_UN_EXP,    /**< exponential       = exp(a)       */
00039   IM_UN_SIN,    /**< sine              = sin(a)       */
00040   IM_UN_COS,    /**< cosine            = cos(a)       */
00041   IM_UN_CONJ,   /**< complex conjugate =     ar - ai*i                   */
00042   IM_UN_CPXNORM /**< complex normalization by magnitude = a / cpxmag(a)  */
00043 };
00044 
00045 /** Apply an arithmetic unary operation. \n
00046  * Can be done in place, images must match size, does not need to match type.
00047  * \ingroup arithm */
00048 void imProcessUnArithmeticOp(const imImage* src_image, imImage* dst_image, int op);
00049 
00050 /** Binary Arithmetic Operations.
00051  * Inverse and log may lead to math exceptions.
00052  * \ingroup arithm */
00053 enum imBinaryOp {
00054   IM_BIN_ADD,    /**< add         =    a+b            */
00055   IM_BIN_SUB,    /**< subtract    =    a-b            */
00056   IM_BIN_MUL,    /**< multiply    =    a*b            */
00057   IM_BIN_DIV,    /**< divide      =    a/b            (#) */
00058   IM_BIN_DIFF,   /**< difference  =    |a-b|          */
00059   IM_BIN_POW,    /**< power       =    a^b            */
00060   IM_BIN_MIN,    /**< minimum     =    (a < b)? a: b  */
00061   IM_BIN_MAX     /**< maximum     =    (a > b)? a: b  */
00062 };
00063 
00064 /** Apply a binary arithmetic operation. \n
00065  * Can be done in place, images must match size. \n
00066  * Source images must match type, destiny image can be several types depending on source: \n
00067  * \li byte -> byte, ushort, int, float
00068  * \li ushort -> ushort, int, float
00069  * \li int -> int, float
00070  * \li float -> float
00071  * \li complex -> complex
00072  * One exception is that you can combine complex with float resulting complex.
00073  * \ingroup arithm */
00074 void imProcessArithmeticOp(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int op);
00075 
00076 /** Apply a binary arithmetic operation with a constant value. \n
00077  * Can be done in place, images must match size. \n
00078  * Destiny image can be several types depending on source: \n
00079  * \li byte -> byte, ushort, int, float
00080  * \li ushort -> byte, ushort, int, float
00081  * \li int -> byte, ushort, int, float
00082  * \li float -> float
00083  * \li complex -> complex
00084  * The constant value is type casted to an apropriate type before the operation.
00085  * \ingroup arithm */
00086 void imProcessArithmeticConstOp(const imImage* src_image, float src_const, imImage* dst_image, int op);
00087 
00088 /** Blend two images using an alpha value = [a * alpha + b * (1 - alpha)]. \n
00089  * Can be done in place, images must match size and type.
00090  * \ingroup arithm */
00091 void imProcessBlend(const imImage* src_image1, imImage* src_image2, imImage* dst_image, float alpha);
00092 
00093 /** Split a complex image into two images with real and imaginary parts \n
00094  * or magnitude and phase parts (polar = 1). \n
00095  * Source image must be IM_COMPLEX, destiny images must be IM_FLOAT.
00096  * \ingroup arithm */
00097 void imProcessSplitComplex(const imImage* src_image, imImage* dst_image1, imImage* dst_image2, int polar);
00098 
00099 /** Merges two images as the real and imaginary parts of a complex image, \n
00100  * or as magnitude and phase parts (polar = 1). \n
00101  * Source images must be IM_FLOAT, destiny image must be IM_COMPLEX.
00102  * \ingroup arithm */
00103 void imProcessMergeComplex(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int polar);
00104 
00105 /** Calculates the mean of multiple images. \n
00106  * Images must match size and type.
00107  * \ingroup arithm */
00108 void imProcessMultipleMean(const imImage** src_image_list, int src_image_count, imImage* dst_image);
00109 
00110 /** Calculates the standard deviation of multiple images. \n
00111  * Images must match size and type.
00112  * \ingroup arithm */
00113 void imProcessMultipleStdDev(const imImage** src_image_list, int src_image_count, const imImage *mean_image, imImage* dst_image);
00114 
00115 /** Calculates the auto-covariance of an image with the mean of a set of images. \n
00116  * Images must match size and type. Returns zero if the counter aborted.
00117  * \ingroup arithm */
00118 int imProcessAutoCovariance(const imImage* src_image, const imImage* mean_image, imImage* dst_image);
00119 
00120 /** Multiplies the conjugate of one complex image with another complex image. \n
00121  * Images must match size. Conj(img1) * img2 \n
00122  * Can be done in-place.
00123  * \ingroup arithm */
00124 void imProcessMultiplyConj(const imImage* src_image1, const imImage* src_image2, imImage* dst_image);
00125 
00126 
00127 
00128 /** \defgroup quantize Additional Image Quantization Operations
00129  * \par
00130  * Additionally operations to the \ref imConvertColorSpace function.
00131  * \par
00132  * See \ref im_process_pon.h
00133  * \ingroup process */
00134 
00135 /** Converts a RGB image to a MAP image using uniform quantization 
00136  * with an optional 8x8 ordered dither. The RGB image must have data type IM_BYTE.
00137  * \ingroup quantize */
00138 void imProcessQuantizeRGBUniform(const imImage* src_image, imImage* dst_image, int dither);
00139 
00140 /** Quantizes a gray scale image in less that 256 grays using uniform quantization. \n
00141  * Both images must be IM_BYTE/IM_GRAY. Can be done in place. 
00142  * \ingroup quantize */
00143 void imProcessQuantizeGrayUniform(const imImage* src_image, imImage* dst_image, int grays);
00144 
00145 
00146 
00147 /** \defgroup histo Histogram Based Operations
00148  * \par
00149  * See \ref im_process_pon.h
00150  * \ingroup process */
00151 
00152 /** Performs an histogram expansion. \n
00153  * Percentage defines an amount of pixels to include at start and end.
00154  * If its is zero only empty counts of the histogram will be considered. \n
00155  * Images must be IM_BYTE/(IM_RGB or IM_GRAY). Can be done in place. 
00156  * \ingroup histo */
00157 void imProcessExpandHistogram(const imImage* src_image, imImage* dst_image, float percent);
00158 
00159 /** Performs an histogram equalization. \n
00160  * Images must be IM_BYTE/(IM_RGB or IM_GRAY). Can be done in place. 
00161  * \ingroup histo */
00162 void imProcessEqualizeHistogram(const imImage* src_image, imImage* dst_image);
00163 
00164 
00165 
00166 /** \defgroup colorproc Color Processing Operations
00167  * \par
00168  * Operations to change the color components configuration.
00169  * \par
00170  * See \ref im_process_pon.h
00171  * \ingroup process */
00172 
00173 /** Split a RGB image into luma and chroma. \n
00174  * Chroma is calculated as R-Y,G-Y,B-Y. Source image must be IM_RGB/IM_BYTE. \n
00175  * luma image is IM_GRAY/IM_BYTE and chroma is IM_RGB/IM_BYTE. \n
00176  * Source and destiny must have the same size. 
00177  * \ingroup colorproc */
00178 void imProcessSplitYChroma(const imImage* src_image, imImage* y_image, imImage* chroma_image);
00179 
00180 /** Split a RGB image into HSI planes. \n
00181  * Source image must be IM_RGB/IM_BYTE,IM_FLOAT. Destiny images are all IM_GRAY/IM_FLOAT. \n
00182  * Source images must normalized to 0-1 if type is IM_FLOAT (\ref imProcessToneGamut can be used). See \ref hsi for a definition of the color conversion.\n
00183  * Source and destiny must have the same size. 
00184  * \ingroup colorproc */
00185 void imProcessSplitHSI(const imImage* src_image, imImage* h_image, imImage* s_image, imImage* i_image);
00186 
00187 /** Merge HSI planes into a RGB image. \n
00188  * Source images must be IM_GRAY/IM_FLOAT. Destiny image can be IM_RGB/IM_BYTE,IM_FLOAT. \n
00189  * Source and destiny must have the same size. See \ref hsi for a definition of the color conversion.
00190  * \ingroup colorproc */
00191 void imProcessMergeHSI(const imImage* h_image, const imImage* s_image, const imImage* i_image3, imImage* dst_image);
00192 
00193 /** Split a multicomponent image into separate components.\n
00194  * Destiny images must be IM_GRAY. Size and data types must be all the same.\n
00195  * The number of destiny images must match the depth of the source image.
00196  * \ingroup colorproc */
00197 void imProcessSplitComponents(const imImage* src_image, imImage** dst_image);
00198 
00199 /** Merges separate components into a multicomponent image.\n
00200  * Source images must be IM_GRAY. Size and data types must be all the same.\n
00201  * The number of source images must match the depth of the destiny image.
00202  * \ingroup colorproc */
00203 void imProcessMergeComponents(const imImage** src_image_list, imImage* dst_image);
00204 
00205 /** Normalize the color components by their sum. Example: c1 = c1/(c1+c2+c3). \n
00206  * Destiny image must be IM_FLOAT. 
00207  * \ingroup colorproc */
00208 void imProcessNormalizeComponents(const imImage* src_image, imImage* dst_image);
00209 
00210 /** Replaces the source color by the destiny color. \n
00211  * The color will be type casted to the image data type. \n
00212  * The colors must have the same number of components of the images. \n
00213  * Supports all color spaces and all data types except IM_COMPLEX.
00214  * \ingroup colorproc */
00215 void imProcessReplaceColor(const imImage* src_image, imImage* dst_image, float* src_color, float* dst_color);
00216 
00217 
00218 
00219 /** \defgroup logic Logical Arithmetic Operations 
00220  * \par
00221  * Logical binary math operations for images.
00222  * \par
00223  * See \ref im_process_pon.h
00224  * \ingroup process */
00225 
00226 /** Logical Operations.
00227  * \ingroup logic */
00228 enum imLogicOp {
00229   IM_BIT_AND,   /**< and  =   a & b   */
00230   IM_BIT_OR,    /**< or   =   a | b   */
00231   IM_BIT_XOR    /**< xor  = ~(a | b)  */
00232 };
00233 
00234 /** Apply a logical operation.\n
00235  * Images must have data type IM_BYTE, IM_USHORT or IM_INT. Can be done in place. 
00236  * \ingroup logic */
00237 void imProcessBitwiseOp(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int op);
00238 
00239 /** Apply a logical NOT operation.\n
00240  * Images must have data type IM_BYTE, IM_USHORT or IM_INT. Can be done in place. 
00241  * \ingroup logic */
00242 void imProcessBitwiseNot(const imImage* src_image, imImage* dst_image);
00243 
00244 /** Apply a bit mask. \n
00245  * The same as imProcessBitwiseOp but the second image is replaced by a fixed mask. \n
00246  * Images must have data type IM_BYTE. It is valid only for AND, OR and XOR. Can be done in place.
00247  * \ingroup logic */
00248 void imProcessBitMask(const imImage* src_image, imImage* dst_image, unsigned char mask, int op);
00249 
00250 /** Extract or Reset a bit plane. For ex: 000X0000 or XXX0XXXX (plane=3).\n
00251  * Images must have data type IM_BYTE. Can be done in place. 
00252  * \ingroup logic */
00253 void imProcessBitPlane(const imImage* src_image, imImage* dst_image, int plane, int reset);
00254 
00255 
00256 
00257 /** \defgroup render Synthetic Image Render
00258  * \par
00259  * Renders some 2D mathematical functions as images. All the functions operates in place 
00260  * and supports all data types except IM_COMPLEX.
00261  * \par
00262  * See \ref im_process_pon.h
00263  * \ingroup process */
00264 
00265 /** Render Funtion.
00266  * \ingroup render */
00267 typedef float (*imRenderFunc)(int x, int y, int d, float* param);
00268 
00269 /** Render Conditional Funtion.
00270  * \ingroup render */
00271 typedef float (*imRenderCondFunc)(int x, int y, int d, int *cond, float* param);
00272 
00273 /** Render a synthetic image using a render function. \n
00274  * plus will make the render be added to the current image data, 
00275  * or else all data will be replaced. All the render functions use this or the conditional function. \n
00276  * Returns zero if the counter aborted.
00277  * \ingroup render */
00278 int imProcessRenderOp(imImage* image, imRenderFunc render_func, char* render_name, float* param, int plus);
00279 
00280 /** Render a sintetic image using a conditional render function. \n
00281  * Data will be rendered only if the condional param is true. \n
00282  * Returns zero if the counter aborted.
00283  * \ingroup render */
00284 int imProcessRenderCondOp(imImage* image, imRenderCondFunc render_func, char* render_name, float* param);
00285 
00286 /** Render speckle noise on existing data. Can be done in place.
00287  * \ingroup render */
00288 int imProcessRenderAddSpeckleNoise(const imImage* src_image, imImage* dst_image, float percent);
00289 
00290 /** Render gaussian noise on existing data. Can be done in place.
00291  * \ingroup render */
00292 int imProcessRenderAddGaussianNoise(const imImage* src_image, imImage* dst_image, float mean, float stddev);
00293 
00294 /** Render uniform noise on existing data. Can be done in place.
00295  * \ingroup render */
00296 int imProcessRenderAddUniformNoise(const imImage* src_image, imImage* dst_image, float mean, float stddev);
00297 
00298 /** Render random noise.
00299  * \ingroup render */
00300 int imProcessRenderRandomNoise(imImage* image);
00301 
00302 /** Render a constant. The number of values must match the depth of the image.
00303  * \ingroup render */
00304 int imProcessRenderConstant(imImage* image, float* value);
00305 
00306 /** Render a centered wheel.
00307  * \ingroup render */
00308 int imProcessRenderWheel(imImage* image, int int_radius, int ext_radius);
00309 
00310 /** Render a centered cone.
00311  * \ingroup render */
00312 int imProcessRenderCone(imImage* image, int radius);
00313 
00314 /** Render a centered tent.
00315  * \ingroup render */
00316 int imProcessRenderTent(imImage* image, int width, int height);
00317 
00318 /** Render a ramp. Direction can be vertical (1) or horizontal (0).
00319  * \ingroup render */
00320 int imProcessRenderRamp(imImage* image, int start, int end, int dir);
00321 
00322 /** Render a centered box.
00323  * \ingroup render */
00324 int imProcessRenderBox(imImage* image, int width, int height);
00325 
00326 /** Render a centered sinc.
00327  * \ingroup render */
00328 int imProcessRenderSinc(imImage* image, float xperiod, float yperiod);
00329 
00330 /** Render a centered gaussian.
00331  * \ingroup render */
00332 int imProcessRenderGaussian(imImage* image, float stddev);
00333 
00334 /** Render the laplacian of a centered gaussian.
00335  * \ingroup render */
00336 int imProcessRenderLapOfGaussian(imImage* image, float stddev);
00337 
00338 /** Render a centered cosine.
00339  * \ingroup render */
00340 int imProcessRenderCosine(imImage* image, float xperiod, float yperiod);
00341 
00342 /** Render a centered grid.
00343  * \ingroup render */
00344 int imProcessRenderGrid(imImage* image, int x_space, int y_space);
00345 
00346 /** Render a centered chessboard.
00347  * \ingroup render */
00348 int imProcessRenderChessboard(imImage* image, int x_space, int y_space);
00349 
00350 
00351 
00352 /** \defgroup tonegamut Tone Gamut Operations
00353  * \par
00354  * Operations that try to preserve the min-max interval in the output (the dynamic range).
00355  * \par
00356  * See \ref im_process_pon.h
00357  * \ingroup process */
00358 
00359 
00360 /** Tone Gamut Operations.
00361  * \ingroup tonegamut */
00362 enum imToneGamut {
00363   IM_GAMUT_NORMALIZE, /**< normalize = (a-min) / (max-min)     (destiny image must be IM_FLOAT)   */
00364   IM_GAMUT_POW,       /**< pow       = ((a-min) / (max-min))^gamma * (max-min) + min                  \n
00365                                        param[0]=gamma                                             */
00366   IM_GAMUT_LOG,       /**< log       = log(K * (a-min) / (max-min) + 1))*(max-min)/log(K+1) + min     \n
00367                                        param[0]=K     (K>0)                                       */
00368   IM_GAMUT_EXP,       /**< exp       = (exp(K * (a-min) / (max-min)) - 1))*(max-min)/(exp(K)-1) + min \n
00369                                        param[0]=K                                                 */
00370   IM_GAMUT_INVERT,    /**< invert    = max - (a-min)                                              */
00371   IM_GAMUT_ZEROSTART, /**< zerostart = a - min                                                    */
00372   IM_GAMUT_SOLARIZE,  /**< solarize  = a < level ?  a:  (level * (max-min) - a * (level-min)) / (max-level) \n
00373                                        param[0]=level percentage (0-100) relative to min-max      \n
00374                                        photography solarization effect. */
00375   IM_GAMUT_SLICE,     /**< slice     = start < a || a > end ?  min:  binarize?  max: a                     \n
00376                                        param[0]=start,  param[1]=end,  param[2]=binarize          */
00377   IM_GAMUT_EXPAND,    /**< expand    = a < start ?  min: a > end ? max :  (a-start)*(max-min)/(end-start) + min  \n
00378                                        param[0]=start,  param[1]=end                              */
00379   IM_GAMUT_CROP,      /**< crop      = a < start ?  start: a > end ? end : a                                        \n
00380                                        param[0]=start,  param[1]=end                              */
00381   IM_GAMUT_BRIGHTCONT /**< brightcont = a < min ?  min:  a > max ?  max:  a * tan(c_a) + b_s + (max-min)*(1 - tan(c_a))/2  \n
00382                                         param[0]=bright_shift (-100%..+100%),  param[1]=contrast_factor (-100%..+100%)     \n
00383                                         change brightness and contrast simultaneously. */
00384 };
00385 
00386 /** Apply a gamut operation with arguments. \n
00387  * Supports all data types except IM_COMPLEX. \n
00388  * The linear operation do a special convertion when min > 0 and max < 1, it forces min=0 and max=1. \n
00389  * IM_BYTE images have min=0 and max=255 always. \n
00390  * Can be done in place. When there is no extra params use NULL.
00391  * \ingroup tonegamut */
00392 void imProcessToneGamut(const imImage* src_image, imImage* dst_image, int op, float* param);
00393 
00394 /** Converts from (0-1) to (0-255), crop out of bounds values. \n
00395  * Source image must be IM_FLOAT, and destiny image must be IM_BYTE.
00396  * \ingroup tonegamut */
00397 void imProcessUnNormalize(const imImage* src_image, imImage* dst_image);
00398 
00399 /** Directly converts IM_USHORT, IM_INT and IM_FLOAT into IM_BYTE images. \n
00400  * This can also be done using \ref imConvertDataType with IM_CAST_DIRECT.
00401  * \ingroup tonegamut */
00402 void imProcessDirectConv(const imImage* src_image, imImage* dst_image);
00403 
00404 /** A negative effect. Uses \ref imProcessToneGamut with IM_GAMUT_INVERT for non MAP images. \n
00405  * Supports all color spaces and all data types except IM_COMPLEX.
00406  * \ingroup tonegamut */
00407 void imProcessNegative(const imImage* src_image, imImage* dst_image);
00408 
00409 
00410 
00411 /** \defgroup threshold Threshold Operations
00412  * \par
00413  * Operations that converts a usually IM_GRAY/IM_BYTE image into a IM_BINARY image using several threshold techniques.
00414  * \par
00415  * See \ref im_process_pon.h
00416  * \ingroup process */
00417 
00418 /** Apply a manual threshold. \n
00419  * threshold = a <= level ? 0: value \n
00420  * Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source. \n
00421  * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
00422  * \ingroup threshold */
00423 void imProcessThreshold(const imImage* src_image, imImage* dst_image, int level, int value);
00424 
00425 /** Apply a threshold by the difference of two images. \n
00426  * threshold = a1 <= a2 ? 0: 1   \n
00427  * Can be done in place. 
00428  * \ingroup threshold */
00429 void imProcessThresholdByDiff(const imImage* src_image1, const imImage* src_image2, imImage* dst_image);
00430 
00431 /** Apply a threshold by the Hysteresis method. \n
00432  * Hysteresis thersholding of edge pixels. Starting at pixels with a
00433  * value greater than the HIGH threshold, trace a connected sequence
00434  * of pixels that have a value greater than the LOW threhsold. \n
00435  * Note: could not find the original source code author name.
00436  * \ingroup threshold */
00437 void imProcessHysteresisThreshold(const imImage* src_image, imImage* dst_image, int low_thres, int high_thres);
00438 
00439 /** Estimates hysteresis low and high threshold levels.
00440  * \ingroup threshold */
00441 void imProcessHysteresisThresEstimate(const imImage* src_image, int *low_thres, int *high_thres);
00442 
00443 /** Calculates the threshold level for manual threshold using an uniform error approach. \n
00444  * Extracted from XITE, Copyright 1991, Blab, UiO \n
00445  * http://www.ifi.uio.no/~blab/Software/Xite/
00446 \verbatim
00447   Reference:
00448     S. M. Dunn & D. Harwood & L. S. Davis:
00449     "Local Estimation of the Uniform Error Threshold"
00450     IEEE Trans. on PAMI, Vol PAMI-6, No 6, Nov 1984.
00451   Comments: It only works well on images whith large objects.
00452   Author: Olav Borgli, BLAB, ifi, UiO
00453   Image processing lab, Department of Informatics, University of Oslo
00454 \endverbatim
00455  * Returns the used level.
00456  * \ingroup threshold */
00457 int imProcessUniformErrThreshold(const imImage* src_image, imImage* dst_image);
00458 
00459 /** Apply a dithering on each image channel by using a difusion error method. \n
00460  * It can be applied on any IM_BYTE images. It will "threshold" each channel indivudually, so
00461  * source and destiny must be of the same depth.
00462  * \ingroup threshold */
00463 void imProcessDifusionErrThreshold(const imImage* src_image, imImage* dst_image, int level);
00464 
00465 /** Calculates the threshold level for manual threshold using a percentage of pixels
00466  * that should stay bellow the threshold. \n
00467  * Returns the used level.
00468  * \ingroup threshold */
00469 int imProcessPercentThreshold(const imImage* src_image, imImage* dst_image, float percent);
00470 
00471 /** Calculates the threshold level for manual threshold using the Otsu approach. \n
00472  * Returns the used level. \n
00473  * Original implementation by Flavio Szenberg.
00474  * \ingroup threshold */
00475 int imProcessOtsuThreshold(const imImage* src_image, imImage* dst_image);
00476 
00477 /** Calculates the threshold level for manual threshold using (max-min)/2. \n
00478  * Returns the used level. \n
00479  * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
00480  * \ingroup threshold */
00481 int imProcessMinMaxThreshold(const imImage* src_image, imImage* dst_image);
00482 
00483 /** Estimates Local Max threshold level for IM_BYTE images.
00484  * \ingroup threshold */
00485 void imProcessLocalMaxThresEstimate(const imImage* src_image, int *thres);
00486 
00487 /** Apply a manual threshold using an interval. \n
00488  * threshold = start_level <= a <= end_level ? 1: 0 \n
00489  * Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source. \n
00490  * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny.
00491  * \ingroup threshold */
00492 void imProcessSliceThreshold(const imImage* src_image, imImage* dst_image, int start_level, int end_level);
00493 
00494 
00495 /** \defgroup effects Special Effects
00496  * \par
00497  * Operations to change image appearance.
00498  * \par
00499  * See \ref im_process_pon.h
00500  * \ingroup process */
00501 
00502 
00503 /** Generates a zoom in effect averaging colors inside a square region. \n
00504  * Operates only on IM_BYTE images.
00505  * \ingroup effects */
00506 void imProcessPixelate(const imImage* src_image, imImage* dst_image, int box_size);
00507 
00508 /** A simple Posterize effect. It reduces the number of colors in the image eliminating 
00509  * less significant bit planes. Can have 1 to 7 levels. See \ref imProcessBitMask. \n
00510  * Image data type must be integer.
00511  * \ingroup effects */
00512 void imProcessPosterize(const imImage* src_image, imImage* dst_image, int level);
00513 
00514 
00515 
00516 #if defined(__cplusplus)
00517 }
00518 #endif
00519 
00520 #endif