IM: im_process_pon.h Source File
From IM - Imaging Libray
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: 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 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. Destiny images are all IM_GRAY/IM_BYTE. \n 00182 * Source and destiny have the same size. See \ref hsi . 00183 * \ingroup colorproc */ 00184 void imProcessSplitHSI(const imImage* src_image, imImage* h_image, imImage* s_image, imImage* i_image); 00185 00186 /** Merge HSI planes into a RGB image. \n 00187 * Source images must be IM_GRAY/IM_BYTE. Destiny image is all IM_RGB/IM_BYTE. \n 00188 * Source and destiny have the same size. See \ref hsi . 00189 * \ingroup colorproc */ 00190 void imProcessMergeHSI(const imImage* h_image, const imImage* s_image, const imImage* i_image3, imImage* dst_image); 00191 00192 /** Split a multicomponent image into separate components.\n 00193 * Destiny images must be IM_GRAY. Size and data types must be all the same.\n 00194 * The number of destiny images must match the depth of the source image. 00195 * \ingroup colorproc */ 00196 void imProcessSplitComponents(const imImage* src_image, imImage** dst_image); 00197 00198 /** Merges separate components into a multicomponent image.\n 00199 * Source images must be IM_GRAY. Size and data types must be all the same.\n 00200 * The number of source images must match the depth of the destiny image. 00201 * \ingroup colorproc */ 00202 void imProcessMergeComponents(const imImage** src_image_list, imImage* dst_image); 00203 00204 /** Normalize the color components by their sum. Example: c1 = c1/(c1+c2+c3). \n 00205 * Destiny image must be IM_FLOAT. 00206 * \ingroup colorproc */ 00207 void imProcessNormalizeComponents(const imImage* src_image, imImage* dst_image); 00208 00209 /** Replaces the source color by the destiny color. \n 00210 * The color will be type casted to the image data type. \n 00211 * The colors must have the same number of components of the images. \n 00212 * Supports all color spaces and all data types except IM_COMPLEX. 00213 * \ingroup colorproc */ 00214 void imProcessReplaceColor(const imImage* src_image, imImage* dst_image, float* src_color, float* dst_color); 00215 00216 00217 00218 /** \defgroup logic Logical Arithmetic Operations 00219 * \par 00220 * Logical binary math operations for images. 00221 * \par 00222 * See \ref im_process_pon.h 00223 * \ingroup process */ 00224 00225 /** Logical Operations. 00226 * \ingroup logic */ 00227 enum imLogicOp { 00228 IM_BIT_AND, /**< and = a & b */ 00229 IM_BIT_OR, /**< or = a | b */ 00230 IM_BIT_XOR /**< xor = ~(a | b) */ 00231 }; 00232 00233 /** Apply a logical operation.\n 00234 * Images must have data type IM_BYTE, IM_USHORT or IM_INT. Can be done in place. 00235 * \ingroup logic */ 00236 void imProcessBitwiseOp(const imImage* src_image1, const imImage* src_image2, imImage* dst_image, int op); 00237 00238 /** Apply a logical NOT operation.\n 00239 * Images must have data type IM_BYTE, IM_USHORT or IM_INT. Can be done in place. 00240 * \ingroup logic */ 00241 void imProcessBitwiseNot(const imImage* src_image, imImage* dst_image); 00242 00243 /** Apply a bit mask. \n 00244 * The same as imProcessBitwiseOp but the second image is replaced by a fixed mask. \n 00245 * Images must have data type IM_BYTE. It is valid only for AND, OR and XOR. Can be done in place. 00246 * \ingroup logic */ 00247 void imProcessBitMask(const imImage* src_image, imImage* dst_image, unsigned char mask, int op); 00248 00249 /** Extract or Reset a bit plane. For ex: 000X0000 or XXX0XXXX (plane=3).\n 00250 * Images must have data type IM_BYTE. Can be done in place. 00251 * \ingroup logic */ 00252 void imProcessBitPlane(const imImage* src_image, imImage* dst_image, int plane, int reset); 00253 00254 00255 00256 /** \defgroup render Synthetic Image Render 00257 * \par 00258 * Renders some 2D mathematical functions as images. All the functions operates in place 00259 * and supports all data types except IM_COMPLEX. 00260 * \par 00261 * See \ref im_process_pon.h 00262 * \ingroup process */ 00263 00264 /** Render Funtion. 00265 * \ingroup render */ 00266 typedef float (*imRenderFunc)(int x, int y, int d, float* param); 00267 00268 /** Render Conditional Funtion. 00269 * \ingroup render */ 00270 typedef float (*imRenderCondFunc)(int x, int y, int d, int *cond, float* param); 00271 00272 /** Render a synthetic image using a render function. \n 00273 * plus will make the render be added to the current image data, 00274 * or else all data will be replaced. All the render functions use this or the conditional function. \n 00275 * Returns zero if the counter aborted. 00276 * \ingroup render */ 00277 int imProcessRenderOp(imImage* image, imRenderFunc render_func, char* render_name, float* param, int plus); 00278 00279 /** Render a sintetic image using a conditional render function. \n 00280 * Data will be rendered only if the condional param is true. \n 00281 * Returns zero if the counter aborted. 00282 * \ingroup render */ 00283 int imProcessRenderCondOp(imImage* image, imRenderCondFunc render_func, char* render_name, float* param); 00284 00285 /** Render speckle noise on existing data. Can be done in place. 00286 * \ingroup render */ 00287 int imProcessRenderAddSpeckleNoise(const imImage* src_image, imImage* dst_image, float percent); 00288 00289 /** Render gaussian noise on existing data. Can be done in place. 00290 * \ingroup render */ 00291 int imProcessRenderAddGaussianNoise(const imImage* src_image, imImage* dst_image, float mean, float stddev); 00292 00293 /** Render uniform noise on existing data. Can be done in place. 00294 * \ingroup render */ 00295 int imProcessRenderAddUniformNoise(const imImage* src_image, imImage* dst_image, float mean, float stddev); 00296 00297 /** Render random noise. 00298 * \ingroup render */ 00299 int imProcessRenderRandomNoise(imImage* image); 00300 00301 /** Render a constant. The number of values must match the depth of the image. 00302 * \ingroup render */ 00303 int imProcessRenderConstant(imImage* image, float* value); 00304 00305 /** Render a centered wheel. 00306 * \ingroup render */ 00307 int imProcessRenderWheel(imImage* image, int int_radius, int ext_radius); 00308 00309 /** Render a centered cone. 00310 * \ingroup render */ 00311 int imProcessRenderCone(imImage* image, int radius); 00312 00313 /** Render a centered tent. 00314 * \ingroup render */ 00315 int imProcessRenderTent(imImage* image, int width, int height); 00316 00317 /** Render a ramp. Direction can be vertical (1) or horizontal (0). 00318 * \ingroup render */ 00319 int imProcessRenderRamp(imImage* image, int start, int end, int dir); 00320 00321 /** Render a centered box. 00322 * \ingroup render */ 00323 int imProcessRenderBox(imImage* image, int width, int height); 00324 00325 /** Render a centered sinc. 00326 * \ingroup render */ 00327 int imProcessRenderSinc(imImage* image, float xperiod, float yperiod); 00328 00329 /** Render a centered gaussian. 00330 * \ingroup render */ 00331 int imProcessRenderGaussian(imImage* image, float stddev); 00332 00333 /** Render the laplacian of a centered gaussian. 00334 * \ingroup render */ 00335 int imProcessRenderLapOfGaussian(imImage* image, float stddev); 00336 00337 /** Render a centered cosine. 00338 * \ingroup render */ 00339 int imProcessRenderCosine(imImage* image, float xperiod, float yperiod); 00340 00341 /** Render a centered grid. 00342 * \ingroup render */ 00343 int imProcessRenderGrid(imImage* image, int x_space, int y_space); 00344 00345 /** Render a centered chessboard. 00346 * \ingroup render */ 00347 int imProcessRenderChessboard(imImage* image, int x_space, int y_space); 00348 00349 00350 00351 /** \defgroup tonegamut Tone Gamut Operations 00352 * \par 00353 * Operations that try to preserve the min-max interval in the output (the dynamic range). 00354 * \par 00355 * See \ref im_process_pon.h 00356 * \ingroup process */ 00357 00358 00359 /** Tone Gamut Operations. 00360 * \ingroup tonegamut */ 00361 enum imToneGamut { 00362 IM_GAMUT_NORMALIZE, /**< normalize = (a-min) / (max-min) (destiny image must be IM_FLOAT) */ 00363 IM_GAMUT_POW, /**< pow = ((a-min) / (max-min))^gamma * (max-min) + min \n 00364 param[0]=gamma */ 00365 IM_GAMUT_LOG, /**< log = log(K * (a-min) / (max-min) + 1))*(max-min)/log(K+1) + min \n 00366 param[0]=K (K>0) */ 00367 IM_GAMUT_EXP, /**< exp = (exp(K * (a-min) / (max-min)) - 1))*(max-min)/(exp(K)-1) + min \n 00368 param[0]=K */ 00369 IM_GAMUT_INVERT, /**< invert = max - (a-min) */ 00370 IM_GAMUT_ZEROSTART, /**< zerostart = a - min */ 00371 IM_GAMUT_SOLARIZE, /**< solarize = a < level ? a: (level * (max-min) - a * (level-min)) / (max-level) \n 00372 param[0]=level percentage (0-100) relative to min-max \n 00373 photography solarization effect. */ 00374 IM_GAMUT_SLICE, /**< slice = start < a || a > end ? min: binarize? max: a \n 00375 param[0]=start, param[1]=end, param[2]=binarize */ 00376 IM_GAMUT_EXPAND, /**< expand = a < start ? min: a > end ? max : (a-start)*(max-min)/(end-start) + min \n 00377 param[0]=start, param[1]=end */ 00378 IM_GAMUT_CROP, /**< crop = a < start ? start: a > end ? end : a \n 00379 param[0]=start, param[1]=end */ 00380 IM_GAMUT_BRIGHTCONT /**< brightcont = a < min ? min: a > max ? max: a * tan(c_a) + b_s + (max-min)*(1 - tan(c_a))/2 \n 00381 param[0]=bright_shift (-100%..+100%), param[1]=contrast_factor (-100%..+100%) \n 00382 change brightness and contrast simultaneously. */ 00383 }; 00384 00385 /** Apply a gamut operation with arguments. \n 00386 * Supports all data types except IM_COMPLEX. \n 00387 * The linear operation do a special convertion when min > 0 and max < 1, it forces min=0 and max=1. \n 00388 * IM_BYTE images have min=0 and max=255 always. \n 00389 * Can be done in place. When there is no extra params use NULL. 00390 * \ingroup tonegamut */ 00391 void imProcessToneGamut(const imImage* src_image, imImage* dst_image, int op, float* param); 00392 00393 /** Converts from (0-1) to (0-255), crop out of bounds values. \n 00394 * Source image must be IM_FLOAT, and destiny image must be IM_BYTE. 00395 * \ingroup tonegamut */ 00396 void imProcessUnNormalize(const imImage* src_image, imImage* dst_image); 00397 00398 /** Directly converts IM_USHORT, IM_INT and IM_FLOAT into IM_BYTE images. \n 00399 * This can also be done using \ref imConvertDataType with IM_CAST_DIRECT. 00400 * \ingroup tonegamut */ 00401 void imProcessDirectConv(const imImage* src_image, imImage* dst_image); 00402 00403 /** A negative effect. Uses \ref imProcessToneGamut with IM_GAMUT_INVERT for non MAP images. \n 00404 * Supports all color spaces and all data types except IM_COMPLEX. 00405 * \ingroup tonegamut */ 00406 void imProcessNegative(const imImage* src_image, imImage* dst_image); 00407 00408 00409 00410 /** \defgroup threshold Threshold Operations 00411 * \par 00412 * Operations that converts a usually IM_GRAY/IM_BYTE image into a IM_BINARY image using several threshold techniques. 00413 * \par 00414 * See \ref im_process_pon.h 00415 * \ingroup process */ 00416 00417 /** Apply a manual threshold. \n 00418 * threshold = a <= level ? 0: value \n 00419 * Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source. \n 00420 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny. 00421 * \ingroup threshold */ 00422 void imProcessThreshold(const imImage* src_image, imImage* dst_image, int level, int value); 00423 00424 /** Apply a threshold by the difference of two images. \n 00425 * threshold = a1 <= a2 ? 0: 1 \n 00426 * Can be done in place. 00427 * \ingroup threshold */ 00428 void imProcessThresholdByDiff(const imImage* src_image1, const imImage* src_image2, imImage* dst_image); 00429 00430 /** Apply a threshold by the Hysteresis method. \n 00431 * Hysteresis thersholding of edge pixels. Starting at pixels with a 00432 * value greater than the HIGH threshold, trace a connected sequence 00433 * of pixels that have a value greater than the LOW threhsold. \n 00434 * Note: could not find the original source code author name. 00435 * \ingroup threshold */ 00436 void imProcessHysteresisThreshold(const imImage* src_image, imImage* dst_image, int low_thres, int high_thres); 00437 00438 /** Estimates hysteresis low and high threshold levels. 00439 * \ingroup threshold */ 00440 void imProcessHysteresisThresEstimate(const imImage* src_image, int *low_thres, int *high_thres); 00441 00442 /** Calculates the threshold level for manual threshold using an uniform error approach. \n 00443 * Extracted from XITE, Copyright 1991, Blab, UiO \n 00444 * http://www.ifi.uio.no/~blab/Software/Xite/ 00445 \verbatim 00446 Reference: 00447 S. M. Dunn & D. Harwood & L. S. Davis: 00448 "Local Estimation of the Uniform Error Threshold" 00449 IEEE Trans. on PAMI, Vol PAMI-6, No 6, Nov 1984. 00450 Comments: It only works well on images whith large objects. 00451 Author: Olav Borgli, BLAB, ifi, UiO 00452 Image processing lab, Department of Informatics, University of Oslo 00453 \endverbatim 00454 * Returns the used level. 00455 * \ingroup threshold */ 00456 int imProcessUniformErrThreshold(const imImage* src_image, imImage* dst_image); 00457 00458 /** Apply a dithering on each image channel by using a difusion error method. \n 00459 * It can be applied on any IM_BYTE images. It will "threshold" each channel indivudually, so 00460 * source and destiny must be of the same depth. 00461 * \ingroup threshold */ 00462 void imProcessDifusionErrThreshold(const imImage* src_image, imImage* dst_image, int level); 00463 00464 /** Calculates the threshold level for manual threshold using a percentage of pixels 00465 * that should stay bellow the threshold. \n 00466 * Returns the used level. 00467 * \ingroup threshold */ 00468 int imProcessPercentThreshold(const imImage* src_image, imImage* dst_image, float percent); 00469 00470 /** Calculates the threshold level for manual threshold using the Otsu approach. \n 00471 * Returns the used level. \n 00472 * Original implementation by Flavio Szenberg. 00473 * \ingroup threshold */ 00474 int imProcessOtsuThreshold(const imImage* src_image, imImage* dst_image); 00475 00476 /** Calculates the threshold level for manual threshold using (max-min)/2. \n 00477 * Returns the used level. \n 00478 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny. 00479 * \ingroup threshold */ 00480 int imProcessMinMaxThreshold(const imImage* src_image, imImage* dst_image); 00481 00482 /** Estimates Local Max threshold level for IM_BYTE images. 00483 * \ingroup threshold */ 00484 void imProcessLocaMaxThresEstimate(const imImage* src_image, int *thres); 00485 00486 /** Apply a manual threshold using an interval. \n 00487 * threshold = start_level <= a <= end_level ? 1: 0 \n 00488 * Normal value is 1 but another common value is 255. Can be done in place for IM_BYTE source. \n 00489 * Supports all integer IM_GRAY images as source, and IM_BINARY as destiny. 00490 * \ingroup threshold */ 00491 void imProcessSliceThreshold(const imImage* src_image, imImage* dst_image, int start_level, int end_level); 00492 00493 00494 /** \defgroup effects Special Effects 00495 * \par 00496 * Operations to change image appearance. 00497 * \par 00498 * See \ref im_process_pon.h 00499 * \ingroup process */ 00500 00501 00502 /** Generates a zoom in effect averaging colors inside a square region. \n 00503 * Operates only on IM_BYTE images. 00504 * \ingroup effects */ 00505 void imProcessPixelate(const imImage* src_image, imImage* dst_image, int box_size); 00506 00507 /** A simple Posterize effect. It reduces the number of colors in the image eliminating 00508 * less significant bit planes. Can have 1 to 7 levels. See \ref imProcessBitMask. \n 00509 * Image data type must be integer. 00510 * \ingroup effects */ 00511 void imProcessPosterize(const imImage* src_image, imImage* dst_image, int level); 00512 00513 00514 00515 #if defined(__cplusplus) 00516 } 00517 #endif 00518 00519 #endif