Tone Gamut Operations
[Image Processing]

Collaboration diagram for Tone Gamut Operations:

Enumerations

enum  imToneGamut {
  IM_GAMUT_NORMALIZE, IM_GAMUT_POW, IM_GAMUT_LOG, IM_GAMUT_EXP,
  IM_GAMUT_INVERT, IM_GAMUT_ZEROSTART, IM_GAMUT_SOLARIZE, IM_GAMUT_SLICE,
  IM_GAMUT_EXPAND, IM_GAMUT_CROP, IM_GAMUT_BRIGHTCONT
}

Functions

void imProcessToneGamut (const imImage *src_image, imImage *dst_image, int op, float *param)
void imProcessUnNormalize (const imImage *src_image, imImage *dst_image)
void imProcessDirectConv (const imImage *src_image, imImage *dst_image)
void imProcessNegative (const imImage *src_image, imImage *dst_image)

Detailed Description

Operations that try to preserve the min-max interval in the output (the dynamic range).
See im_process_pon.h

Enumeration Type Documentation

Tone Gamut Operations.

Enumerator:
IM_GAMUT_NORMALIZE 

normalize = (a-min) / (max-min) (destiny image must be IM_FLOAT)

IM_GAMUT_POW 

pow = ((a-min) / (max-min))^gamma * (max-min) + min
param[0]=gamma

IM_GAMUT_LOG 

log = log(K * (a-min) / (max-min) + 1))*(max-min)/log(K+1) + min
param[0]=K (K>0)

IM_GAMUT_EXP 

exp = (exp(K * (a-min) / (max-min)) - 1))*(max-min)/(exp(K)-1) + min
param[0]=K

IM_GAMUT_INVERT 

invert = max - (a-min)

IM_GAMUT_ZEROSTART 

zerostart = a - min

IM_GAMUT_SOLARIZE 

solarize = a < level ? a: (level * (max-min) - a * (level-min)) / (max-level)
param[0]=level percentage (0-100) relative to min-max
photography solarization effect.

IM_GAMUT_SLICE 

slice = start < a || a > end ? min: binarize? max: a
param[0]=start, param[1]=end, param[2]=binarize

IM_GAMUT_EXPAND 

expand = a < start ? min: a > end ? max : (a-start)*(max-min)/(end-start) + min
param[0]=start, param[1]=end

IM_GAMUT_CROP 

crop = a < start ? start: a > end ? end : a
param[0]=start, param[1]=end

IM_GAMUT_BRIGHTCONT 

brightcont = a < min ? min: a > max ? max: a * tan(c_a) + b_s + (max-min)*(1 - tan(c_a))/2
param[0]=bright_shift (-100%..+100%), param[1]=contrast_factor (-100%..+100%)
change brightness and contrast simultaneously.

00506                  {
00507   IM_GAMUT_NORMALIZE, /**< normalize = (a-min) / (max-min)     (destiny image must be IM_FLOAT)   */
00508   IM_GAMUT_POW,       /**< pow       = ((a-min) / (max-min))^gamma * (max-min) + min                  \n
00509                                        param[0]=gamma                                             */
00510   IM_GAMUT_LOG,       /**< log       = log(K * (a-min) / (max-min) + 1))*(max-min)/log(K+1) + min     \n
00511                                        param[0]=K     (K>0)                                       */
00512   IM_GAMUT_EXP,       /**< exp       = (exp(K * (a-min) / (max-min)) - 1))*(max-min)/(exp(K)-1) + min \n
00513                                        param[0]=K                                                 */
00514   IM_GAMUT_INVERT,    /**< invert    = max - (a-min)                                              */
00515   IM_GAMUT_ZEROSTART, /**< zerostart = a - min                                                    */
00516   IM_GAMUT_SOLARIZE,  /**< solarize  = a < level ?  a:  (level * (max-min) - a * (level-min)) / (max-level) \n
00517                                        param[0]=level percentage (0-100) relative to min-max      \n
00518                                        photography solarization effect. */
00519   IM_GAMUT_SLICE,     /**< slice     = start < a || a > end ?  min:  binarize?  max: a                     \n
00520                                        param[0]=start,  param[1]=end,  param[2]=binarize          */
00521   IM_GAMUT_EXPAND,    /**< expand    = a < start ?  min: a > end ? max :  (a-start)*(max-min)/(end-start) + min  \n
00522                                        param[0]=start,  param[1]=end                              */
00523   IM_GAMUT_CROP,      /**< crop      = a < start ?  start: a > end ? end : a                                        \n
00524                                        param[0]=start,  param[1]=end                              */
00525   IM_GAMUT_BRIGHTCONT /**< brightcont = a < min ?  min:  a > max ?  max:  a * tan(c_a) + b_s + (max-min)*(1 - tan(c_a))/2  \n
00526                                         param[0]=bright_shift (-100%..+100%),  param[1]=contrast_factor (-100%..+100%)     \n
00527                                         change brightness and contrast simultaneously. */
00528 };


Function Documentation

void imProcessToneGamut ( const imImage src_image,
imImage dst_image,
int  op,
float *  param 
)

Apply a gamut operation with arguments.
Supports all data types except IM_CFLOAT.
The linear operation do a special convertion when min > 0 and max < 1, it forces min=0 and max=1.
IM_BYTE images have min=0 and max=255 always.
Can be done in place. When there is no extra params, can use NULL.

im.ProcessToneGamut(src_image: imImage, dst_image: imImage, op: number, param: table of number) [in Lua 5] 
im.ProcessToneGamutNew(src_image: imImage, op: number, param: table of number) -> new_image: imImage [in Lua 5] 
void imProcessUnNormalize ( const imImage src_image,
imImage dst_image 
)

Converts from (0-1) to (0-255), crop out of bounds values.
Source image must be IM_FLOAT, and destiny image must be IM_BYTE.

im.ProcessUnNormalize(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessUnNormalizeNew(src_image: imImage) -> new_image: imImage [in Lua 5] 
void imProcessDirectConv ( const imImage src_image,
imImage dst_image 
)

Directly converts IM_USHORT, IM_INT and IM_FLOAT into IM_BYTE images.
This can also be done using imConvertDataType with IM_CAST_DIRECT.

im.ProcessDirectConv(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessDirectConvNew(src_image: imImage) -> new_image: imImage [in Lua 5] 
void imProcessNegative ( const imImage src_image,
imImage dst_image 
)

A negative effect. Uses imProcessToneGamut with IM_GAMUT_INVERT for non MAP images.
Supports all color spaces and all data types except IM_CFLOAT.
Can be done in place.

im.ProcessNegative(src_image: imImage, dst_image: imImage) [in Lua 5] 
im.ProcessNegativeNew(src_image: imImage) -> new_image: imImage [in Lua 5] 

Generated on Thu Oct 1 11:40:08 2009 for IM by  doxygen 1.6.1