Enumerations | |
enum | CxImage::ImageOpType { CxImage::OpAdd, CxImage::OpAnd, CxImage::OpXor, CxImage::OpOr, CxImage::OpMask, CxImage::OpSrcCopy, CxImage::OpDstCopy, CxImage::OpSub, CxImage::OpSrcBlend, CxImage::OpScreen, CxImage::OpAvg } |
Functions | |
bool | CxImage::Contour () |
bool | CxImage::HistogramStretch (long method=0, double threshold=0) |
bool | CxImage::HistogramEqualize () |
bool | CxImage::HistogramNormalize () |
bool | CxImage::HistogramRoot () |
bool | CxImage::HistogramLog () |
long | CxImage::Histogram (long *red, long *green=0, long *blue=0, long *gray=0, long colorspace=0) |
bool | CxImage::Jitter (long radius=2) |
bool | CxImage::Repair (float radius=0.25f, long niterations=1, long colorspace=0) |
bool | CxImage::Combine (CxImage *r, CxImage *g, CxImage *b, CxImage *a, long colorspace=0) |
bool | CxImage::FFT2 (CxImage *srcReal, CxImage *srcImag, CxImage *dstReal, CxImage *dstImag, long direction=1, bool bForceFFT=true, bool bMagnitude=true) |
bool | CxImage::Noise (long level) |
bool | CxImage::Median (long Ksize=3) |
bool | CxImage::Gamma (float gamma) |
bool | CxImage::GammaRGB (float gammaR, float gammaG, float gammaB) |
bool | CxImage::ShiftRGB (long r, long g, long b) |
bool | CxImage::Threshold (BYTE level) |
bool | CxImage::Threshold (CxImage *pThresholdMask) |
bool | CxImage::Threshold2 (BYTE level, bool bDirection, RGBQUAD nBkgndColor, bool bSetAlpha=false) |
bool | CxImage::Colorize (BYTE hue, BYTE sat, float blend=1.0f) |
bool | CxImage::Light (long brightness, long contrast=0) |
float | CxImage::Mean () |
bool | CxImage::Filter (long *kernel, long Ksize, long Kfactor, long Koffset) |
bool | CxImage::Erode (long Ksize=2) |
bool | CxImage::Dilate (long Ksize=2) |
bool | CxImage::Edge (long Ksize=2) |
void | CxImage::HuePalette (float correction=1) |
void | CxImage::Mix (CxImage &imgsrc2, ImageOpType op, long lXOffset=0, long lYOffset=0, bool bMixAlpha=false) |
void | CxImage::MixFrom (CxImage &imagesrc2, long lXOffset, long lYOffset) |
bool | CxImage::UnsharpMask (float radius=5.0f, float amount=0.5f, int threshold=0) |
bool | CxImage::Lut (BYTE *pLut) |
bool | CxImage::Lut (BYTE *pLutR, BYTE *pLutG, BYTE *pLutB, BYTE *pLutA=0) |
bool | CxImage::GaussianBlur (float radius=1.0f, CxImage *iDst=0) |
bool | CxImage::TextBlur (BYTE threshold=100, BYTE decay=2, BYTE max_depth=5, bool bBlurHorizontal=true, bool bBlurVertical=true, CxImage *iDst=0) |
bool | CxImage::SelectiveBlur (float radius=1.0f, BYTE threshold=25, CxImage *iDst=0) |
bool | CxImage::Solarize (BYTE level=128, bool bLinkedChannels=true) |
bool | CxImage::FloodFill (const long xStart, const long yStart, const RGBQUAD cFillColor, const BYTE tolerance=0, BYTE nOpacity=255, const bool bSelectFilledArea=false, const BYTE nSelectionLevel=255) |
bool | CxImage::Saturate (const long saturation, const long colorspace=1) |
bool | CxImage::ConvertColorSpace (const long dstColorSpace, const long srcColorSpace) |
int | CxImage::OptimalThreshold (long method=0, RECT *pBox=0, CxImage *pContrastMask=0) |
bool | CxImage::AdaptiveThreshold (long method=0, long nBoxSize=64, CxImage *pContrastMask=0, long nBias=0, float fGlobalLocalBalance=0.5f) |
enum CxImage::ImageOpType [inherited] |
bool CxImage::AdaptiveThreshold | ( | long | method = 0 , |
|
long | nBoxSize = 64 , |
|||
CxImage * | pContrastMask = 0 , |
|||
long | nBias = 0 , |
|||
float | fGlobalLocalBalance = 0.5f | |||
) | [inherited] |
Converts the image to B&W, using an optimal threshold mask
method,: | 0 = average all methods (default); 1 = Otsu; 2 = Kittler & Illingworth; 3 = max entropy; 4 = potential difference; | |
nBoxSize,: | the image is divided into "nBoxSize x nBoxSize" blocks, from where the threshold is computed; min = 8; default = 64. | |
pContrastMask,: | limit the computation only in regions with contrasted (!=0) pixels; default = 0. | |
nBias,: | global offset added to the threshold mask; default = 0. | |
fGlobalLocalBalance,: | balance between local and global threshold. default = 0.5 fGlobalLocalBalance can be from 0.0 (use only local threshold) to 1.0 (use only global threshold) the pContrastMask image must be grayscale with same with and height of the current image, |
bool CxImage::Colorize | ( | BYTE | hue, | |
BYTE | sat, | |||
float | blend = 1.0f | |||
) | [inherited] |
Replaces the original hue and saturation values.
hue,: | hue | |
sat,: | saturation | |
blend,: | can be from 0 (no effect) to 1 (full effect) |
bool CxImage::Combine | ( | CxImage * | r, | |
CxImage * | g, | |||
CxImage * | b, | |||
CxImage * | a, | |||
long | colorspace = 0 | |||
) | [inherited] |
Combines different color components into a single image
r,g,b,: | color channels | |
a,: | alpha layer, can be NULL | |
colorspace,: | 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ |
bool CxImage::Contour | ( | ) | [inherited] |
bool CxImage::ConvertColorSpace | ( | const long | dstColorSpace, | |
const long | srcColorSpace | |||
) | [inherited] |
Converts the RGB triplets to and from different colorspace
dstColorSpace,: | destination colorspace; 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ | |
srcColorSpace,: | source colorspace; 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ |
bool CxImage::Dilate | ( | long | Ksize = 2 |
) | [inherited] |
Enhance the light areas of the image
Ksize,: | size of the kernel. |
bool CxImage::Edge | ( | long | Ksize = 2 |
) | [inherited] |
bool CxImage::Erode | ( | long | Ksize = 2 |
) | [inherited] |
Enhance the dark areas of the image
Ksize,: | size of the kernel. |
bool CxImage::FFT2 | ( | CxImage * | srcReal, | |
CxImage * | srcImag, | |||
CxImage * | dstReal, | |||
CxImage * | dstImag, | |||
long | direction = 1 , |
|||
bool | bForceFFT = true , |
|||
bool | bMagnitude = true | |||
) | [inherited] |
Computes the bidimensional FFT or DFT of the image.
srcReal,srcImag,: | source images: One can be NULL, but not both | |
dstReal,dstImag,: | destination images. Can be NULL. | |
direction,: | 1 = forward, -1 = inverse. | |
bForceFFT,: | if true, the images are resampled to make the dimensions a power of 2. | |
bMagnitude,: | if true, the real part returns the magnitude, the imaginary part returns the phase |
bool CxImage::Filter | ( | long * | kernel, | |
long | Ksize, | |||
long | Kfactor, | |||
long | Koffset | |||
) | [inherited] |
2D linear filter
kernel,: | convolving matrix, in row format. | |
Ksize,: | size of the kernel. | |
Kfactor,: | normalization constant. | |
Koffset,: | bias. Example: the "soften" filter uses this kernel: 1 1 1 1 8 1 1 1 1 the function needs: kernel={1,1,1,1,8,1,1,1,1}; Ksize=3; Kfactor=16; Koffset=0; |
bool CxImage::FloodFill | ( | const long | xStart, | |
const long | yStart, | |||
const RGBQUAD | cFillColor, | |||
const BYTE | nTolerance = 0 , |
|||
BYTE | nOpacity = 255 , |
|||
const bool | bSelectFilledArea = false , |
|||
const BYTE | nSelectionLevel = 255 | |||
) | [inherited] |
Flood Fill
xStart,yStart,: | starting point | |
cFillColor,: | filling color | |
nTolerance,: | deviation from the starting point color | |
nOpacity,: | can be from 0 (transparent) to 255 (opaque, default) | |
bSelectFilledArea,: | if true, the pixels in the region are also set in the selection layer; default = false | |
nSelectionLevel,: | if bSelectFilledArea is true, the selected pixels are set to nSelectionLevel; default = 255 Note: nOpacity=0 && bSelectFilledArea=true act as a "magic wand" |
bool CxImage::Gamma | ( | float | gamma | ) | [inherited] |
Adjusts the color balance of the image
gamma | can be from 0.1 to 5. |
bool CxImage::GammaRGB | ( | float | gammaR, | |
float | gammaG, | |||
float | gammaB | |||
) | [inherited] |
Adjusts the color balance indipendent for each color channel
gammaR,gammaG,gammaB | can be from 0.1 to 5. |
bool CxImage::GaussianBlur | ( | float | radius = 1.0f , |
|
CxImage * | iDst = 0 | |||
) | [inherited] |
long CxImage::Histogram | ( | long * | red, | |
long * | green = 0 , |
|||
long * | blue = 0 , |
|||
long * | gray = 0 , |
|||
long | colorspace = 0 | |||
) | [inherited] |
bool CxImage::HistogramEqualize | ( | ) | [inherited] |
bool CxImage::HistogramLog | ( | ) | [inherited] |
bool CxImage::HistogramNormalize | ( | ) | [inherited] |
bool CxImage::HistogramRoot | ( | ) | [inherited] |
bool CxImage::HistogramStretch | ( | long | method = 0 , |
|
double | threshold = 0 | |||
) | [inherited] |
HistogramStretch
method,: | 0 = luminance (default), 1 = linked channels , 2 = independent channels. | |
threshold,: | minimum percentage level in the histogram to recognize it as meaningful. Range: 0.0 to 1.0; default = 0; typical = 0.005 (0.5%); |
void CxImage::HuePalette | ( | float | correction = 1 |
) | [inherited] |
Generates a "rainbow" palette with saturated colors
correction,: | 1 generates a single hue spectrum. 0.75 is nice for scientific applications. |
bool CxImage::Jitter | ( | long | radius = 2 |
) | [inherited] |
Adds a random offset to each pixel in the image
radius,: | maximum pixel displacement |
bool CxImage::Light | ( | long | brightness, | |
long | contrast = 0 | |||
) | [inherited] |
Changes the brightness and the contrast of the image.
brightness,: | can be from -255 to 255, if brightness is negative, the image becomes dark. | |
contrast,: | can be from -100 to 100, the neutral value is 0. |
bool CxImage::Lut | ( | BYTE * | pLutR, | |
BYTE * | pLutG, | |||
BYTE * | pLutB, | |||
BYTE * | pLutA = 0 | |||
) | [inherited] |
Apply an indipendent look up table for each channel
pLutR,pLutG,pLutB,pLutA,: | BYTE[256] look up tables |
bool CxImage::Lut | ( | BYTE * | pLut | ) | [inherited] |
Apply a look up table to the image.
pLut,: | BYTE[256] look up table |
float CxImage::Mean | ( | ) | [inherited] |
bool CxImage::Median | ( | long | Ksize = 3 |
) | [inherited] |
Adjusts the intensity of each pixel to the median intensity of its surrounding pixels.
Ksize,: | size of the kernel. |
void CxImage::Mix | ( | CxImage & | imgsrc2, | |
ImageOpType | op, | |||
long | lXOffset = 0 , |
|||
long | lYOffset = 0 , |
|||
bool | bMixAlpha = false | |||
) | [inherited] |
Blends two images
imgsrc2,: | image to be mixed with this | |
op,: | blending method; see ImageOpType | |
lXOffset,lYOffset,: | image displacement | |
bMixAlpha,: | if true and imgsrc2 has a valid alpha layer, it will be mixed in the destination image. |
void CxImage::MixFrom | ( | CxImage & | imagesrc2, | |
long | lXOffset, | |||
long | lYOffset | |||
) | [inherited] |
bool CxImage::Noise | ( | long | level | ) | [inherited] |
Adds an uniform noise to the image
level,: | can be from 0 (no noise) to 255 (lot of noise). |
int CxImage::OptimalThreshold | ( | long | method = 0 , |
|
RECT * | pBox = 0 , |
|||
CxImage * | pContrastMask = 0 | |||
) | [inherited] |
Finds the optimal (global or local) treshold for image binarization
method,: | 0 = average all methods (default); 1 = Otsu; 2 = Kittler & Illingworth; 3 = max entropy; 4 = potential difference; | |
pBox,: | region from where the threshold is computed; 0 = full image (default). | |
pContrastMask,: | limit the computation only in regions with contrasted (!=0) pixels; default = 0. the pContrastMask image must be grayscale with same with and height of the current image, can be obtained from the current image with a filter: CxImage iContrastMask(*image,true,false,false); iContrastMask.GrayScale(); long edge[]={-1,-1,-1,-1,8,-1,-1,-1,-1}; iContrastMask.Filter(edge,3,1,0); long blur[]={1,1,1,1,1,1,1,1,1}; iContrastMask.Filter(blur,3,9,0); |
bool CxImage::Repair | ( | float | radius = 0.25f , |
|
long | niterations = 1 , |
|||
long | colorspace = 0 | |||
) | [inherited] |
Smart blurring to remove small defects, dithering or artifacts.
radius,: | normally between 0.01 and 0.5 | |
niterations,: | should be trimmed with radius, to avoid blurring should be (radius*niterations)<1 | |
colorspace,: | 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ |
bool CxImage::Saturate | ( | const long | saturation, | |
const long | colorspace = 1 | |||
) | [inherited] |
Changes the saturation of the image.
saturation,: | can be from -100 to 100, positive values increase the saturation. | |
colorspace,: | can be 1 (HSL) or 2 (YUV). |
bool CxImage::SelectiveBlur | ( | float | radius = 1.0f , |
|
BYTE | threshold = 25 , |
|||
CxImage * | iDst = 0 | |||
) | [inherited] |
bool CxImage::ShiftRGB | ( | long | r, | |
long | g, | |||
long | b | |||
) | [inherited] |
Adjusts separately the red, green, and blue values in the image.
r,g,b,: | can be from -255 to +255. |
bool CxImage::Solarize | ( | BYTE | level = 128 , |
|
bool | bLinkedChannels = true | |||
) | [inherited] |
Solarize: convert all colors above a given lightness level into their negative
level | : lightness threshold. Range = 0 to 255; default = 128. | |
bLinkedChannels,: | true = compare with luminance, preserve colors (default) false = compare with independent R,G,B levels |
bool CxImage::TextBlur | ( | BYTE | threshold = 100 , |
|
BYTE | decay = 2 , |
|||
BYTE | max_depth = 5 , |
|||
bool | bBlurHorizontal = true , |
|||
bool | bBlurVertical = true , |
|||
CxImage * | iDst = 0 | |||
) | [inherited] |
bool CxImage::Threshold | ( | CxImage * | pThresholdMask | ) | [inherited] |
Converts the image to B&W, using a threshold mask
pThresholdMask,: | the lightness threshold mask. the pThresholdMask image must be grayscale with same with and height of the current image |
bool CxImage::Threshold | ( | BYTE | level | ) | [inherited] |
Converts the image to B&W. The OptimalThreshold() function can be used for calculating the optimal threshold.
level,: | the lightness threshold. |
bool CxImage::Threshold2 | ( | BYTE | level, | |
bool | bDirection, | |||
RGBQUAD | nBkgndColor, | |||
bool | bSetAlpha = false | |||
) | [inherited] |
Filters only the pixels with a lightness less (or more) than the threshold level, and preserves the colors for the unfiltered pixels.
level | = the lightness threshold. | |
bDirection | = false: filter dark pixels, true: filter light pixels | |
nBkgndColor | = filtered pixels are set to nBkgndColor color | |
bSetAlpha | = if true, sets also the alpha component for the filtered pixels, with nBkgndColor.rgbReserved |
bool CxImage::UnsharpMask | ( | float | radius = 5.0f , |
|
float | amount = 0.5f , |
|||
int | threshold = 0 | |||
) | [inherited] |
sharpen the image by subtracting a blurred copy from the original image.
radius,: | width in pixels of the blurring effect. Range: >0; default = 5. | |
amount,: | strength of the filter. Range: 0.0 (none) to 1.0 (max); default = 0.5 | |
threshold,: | difference, between blurred and original pixel, to trigger the filter Range: 0 (always triggered) to 255 (never triggered); default = 0. |