Enumerations | Functions

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
}
enum  imToneGamutFlags { IM_GAMUT_MINMAX = 0x0100 }

Functions

void imProcessToneGamut (const imImage *src_image, imImage *dst_image, int op, float *params)
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)
float imProcessCalcAutoGamma (const imImage *image)
void imProcessShiftHSI (const imImage *src_image, imImage *dst_image, float h_shift, float s_shift, float i_shift)

Detailed Description

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

Enumeration Type Documentation

Tone Gamut Operations.

Enumerator:
IM_GAMUT_NORMALIZE 

normalize = (a-min) / (max-min) (result is always real)

IM_GAMUT_POW 

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

IM_GAMUT_LOG 

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

IM_GAMUT_EXP 

exp = (exp(K * (a-min) / (max-min)) - 1))*(max-min)/(exp(K)-1) + min
params[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)
params[0]=level percentage (0-100) relative to min-max
photography solarization effect.

IM_GAMUT_SLICE 

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

IM_GAMUT_EXPAND 

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

IM_GAMUT_CROP 

crop = a < start ? start: a > end ? end : a
params[0]=start, params[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
params[0]=bright_shift (-100%..+100%), params[1]=contrast_factor (-100%..+100%)
change brightness and contrast simultaneously.

Tone Gamut Flags. Combine with imToneGamut values with bitwise or (|).

Enumerator:
IM_GAMUT_MINMAX 

min and max are given in params (params[0]=min, params[1]=max), all other parameters shift 2 positions.


Function Documentation

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

Apply a gamut operation with arguments.
Supports all data types except complex.
For IM_GAMUT_NORMALIZE when min > 0 and max < 1, it will just do a copy.
IM_BYTE images have min=0 and max=255 always.
To control min and max values use the IM_GAMUT_MINMAX flag. Can be done in-place. When there is no extra parameters, params can use NULL.

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

See also Image Enhance Utilities in Lua.

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 real, and target 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 integer and real data types into IM_BYTE images.
This can also be done using imConvertDataType with IM_CAST_DIRECT flag.

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 complex.
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] 
float imProcessCalcAutoGamma ( const imImage image  ) 

Calculates an automatic gamma factor.
gamma=log((mean-min)/(max-min))/log(0.5); Usefull for imProcessToneGamut when using IM_GAMUT_POW.

im.ProcessCalcAutoGamma(image: imImage) -> gamma: number [in Lua 5] 
void imProcessShiftHSI ( const imImage src_image,
imImage dst_image,
float  h_shift,
float  s_shift,
float  i_shift 
)

Apply a shift using HSI coordinates.
Supports all data types except complex.
Can be done in-place.

im.ProcessShiftHSI(src_image: imImage, dst_image: imImage, h_shift, s_shift, i_shift: number) [in Lua 5] 
im.ProcessShiftHSI(src_image: imImage, h_shift, s_shift, i_shift: number) -> new_image: imImage [in Lua 5]