Main Page | Modules | Class List | File List | Class Members | File Members

# DSP

## Enumerations
enum | CxImage::ImageOpType { CxImage::OpAdd, CxImage::OpAnd, CxImage::OpXor, CxImage::OpOr, CxImage::OpMask, CxImage::OpSrcCopy, CxImage::OpDstCopy, CxImage::OpSub, CxImage::OpSrcBlend, CxImage::OpScreen }
## Functions
bool | CxImage::Colorize (BYTE hue, BYTE sat, float blend=1.0f)
bool | CxImage::Combine (CxImage *r, CxImage *g, CxImage *b, CxImage *a, long colorspace=0)
bool | CxImage::Contour ()
bool | CxImage::Dilate (long Ksize=2)
bool | CxImage::Edge (long Ksize=2)
bool | CxImage::Erode (long Ksize=2)
bool | CxImage::FFT2 (CxImage *srcReal, CxImage *srcImag, CxImage *dstReal, CxImage *dstImag, long direction=1, bool bForceFFT=true, bool bMagnitude=true)
bool | CxImage::Filter (long *kernel, long Ksize, long Kfactor, long Koffset)
bool | CxImage::Gamma (float gamma)
long | CxImage::Histogram (long *red, long *green=0, long *blue=0, long *gray=0, long colorspace=0)
bool | CxImage::HistogramEqualize ()
bool | CxImage::HistogramLog ()
bool | CxImage::HistogramNormalize ()
bool | CxImage::HistogramRoot ()
bool | CxImage::HistogramStretch (long method=0)
void | CxImage::HuePalette (float correction=1)
bool | CxImage::Jitter (long radius=2)
bool | CxImage::Light (long brightness, long contrast=0)
bool | CxImage::Lut (BYTE *pLutR, BYTE *pLutG, BYTE *pLutB, BYTE *pLutA=0)
bool | CxImage::Lut (BYTE *pLut)
float | CxImage::Mean ()
bool | CxImage::Median (long Ksize=3)
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::Noise (long level)
bool | CxImage::Repair (float radius=0.25f, long niterations=1, long colorspace=0)
bool | CxImage::ShiftRGB (long r, long g, long b)
bool | CxImage::Threshold (BYTE level)
bool | CxImage::UnsharpMask (float radius=5.0, float amount=0.5, int threshold=0)

## Enumeration Type Documentation

enum CxImage::ImageOpType`[inherited]`

  | Enumeration values:
  OpAdd |
  OpAnd |
  OpXor |
  OpOr |
  OpMask |
  OpSrcCopy |
  OpDstCopy |
  OpSub |
  OpSrcBlend |
  OpScreen |

## Function Documentation

bool CxImage::Colorize | ( | BYTE | hue,
|  | BYTE | sat,
|  | float | blend = `1.0f`
| ) | `[inherited]`

  | Replaces the original hue and saturation values. Parameters:
  | hue: | hue
  | sat: | saturation
  | blend: | can be from 0 (no effect) to 1 (full effect)
Returns: true if everything is ok

bool CxImage::Combine | ( | CxImage * | r,
|  | CxImage * | g,
|  | CxImage * | b,
|  | CxImage * | a,
|  | long | colorspace = `0`
| ) | `[inherited]`

  | Combines different color components into a single image Parameters:
  | r,g,b: | color channels
  | a: | alpha layer, can be NULL
  | colorspace: | 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ
Returns: true if everything is ok

bool CxImage::Contour | ( |  | ) | `[inherited]`

| Enhance the variations between adjacent pixels. Similar results can be achieved using Filter(), but the algorithms are different both in Edge() and in Contour(). Returns: true if everything is ok

bool CxImage::Dilate | ( | long | Ksize = `2` | ) | `[inherited]`

  | Enhance the light areas of the image Parameters:
  | Ksize: | size of the kernel.
Returns: true if everything is ok

bool CxImage::Edge | ( | long | Ksize = `2` | ) | `[inherited]`

  | Enhance the variations between adjacent pixels. Similar results can be achieved using Filter(), but the algorithms are different both in Edge() and in Contour(). Parameters:
  | Ksize: | size of the kernel.
Returns: true if everything is ok

bool CxImage::Erode | ( | long | Ksize = `2` | ) | `[inherited]`

  | Enhance the dark areas of the image Parameters:
  | Ksize: | size of the kernel.
Returns: true if everything is ok

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. The images are processed as grayscale If the dimensions of the image are a power of, 2 the FFT is performed automatically. If dstReal and/or dstImag are NULL, the resulting images replaces the original(s). Note: with 8 bits there is a HUGE loss in the dynamics. The function tries to keep an acceptable SNR, but 8bit = 48dB... Parameters:
  | 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
Returns: true if everything is ok

bool CxImage::Filter | ( | long * | kernel,
|  | long | Ksize,
|  | long | Kfactor,
|  | long | Koffset
| ) | `[inherited]`

  | 2D linear filter Parameters:
  | 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;
Returns: true if everything is ok

bool CxImage::Gamma | ( | float | gamma | ) | `[inherited]`

  | Adjusts the color balance of the image Parameters:
  | gamma | can be from 0.1 to 5.
Returns: true if everything is ok

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` | ) | `[inherited]`

  | HistogramStretch Parameters:
  | method: | 0 = luminance (default), 1 = linked channels , 2 = independent channels.
Returns: true if everything is ok Author: [dave] and [nipper]

void CxImage::HuePalette | ( | float | correction = `1` | ) | `[inherited]`

  | Generates a "rainbow" palette with saturated colors Parameters:
  | 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 Parameters:
  | radius: | maximum pixel displacement
Returns: true if everything is ok

bool CxImage::Light | ( | long | brightness,
|  | long | contrast = `0`
| ) | `[inherited]`

  | Changes the brightness and the contrast of the image. Parameters:
  | 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.
Returns: true if everything is ok

bool CxImage::Lut | ( | BYTE * | pLutR,
|  | BYTE * | pLutG,
|  | BYTE * | pLutB,
|  | BYTE * | pLutA = `0`
| ) | `[inherited]`

  | Apply an indipendent look up table for each channel Parameters:
  | pLutR,pLutG,pLutB,pLutA: | BYTE[256] look up tables
Returns: true if everything is ok

bool CxImage::Lut | ( | BYTE * | pLut | ) | `[inherited]`

  | Apply a look up table to the image. Parameters:
  | pLut: | BYTE[256] look up table
Returns: true if everything is ok

float CxImage::Mean | ( |  | ) | `[inherited]`

| Returns: mean lightness of the image. Useful with Threshold() and Light()

bool CxImage::Median | ( | long | Ksize = `3` | ) | `[inherited]`

  | Adjusts the intensity of each pixel to the median intensity of its surrounding pixels. Parameters:
  | Ksize: | size of the kernel.
Returns: true if everything is ok

void CxImage::Mix | ( | CxImage & | imgsrc2,
|  | ImageOpType | op,
|  | long | lXOffset = `0`,
|  | long | lYOffset = `0`,
|  | bool | bMixAlpha = `false`
| ) | `[inherited]`

  | Blends two images Parameters:
  | 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.
Returns: true if everything is ok thanks to Mwolski

void CxImage::MixFrom | ( | CxImage & | imagesrc2,
|  | long | lXOffset,
|  | long | lYOffset
| ) | `[inherited]`

bool CxImage::Noise | ( | long | level | ) | `[inherited]`

  | Adds an uniform noise to the image Parameters:
  | level: | can be from 0 (no noise) to 255 (lot of noise).
Returns: true if everything is ok

bool CxImage::Repair | ( | float | radius = `0.25f`,
|  | long | niterations = `1`,
|  | long | colorspace = `0`
| ) | `[inherited]`

  | Smart blurring to remove small defects, dithering or artifacts. Parameters:
  | 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
Returns: true if everything is ok

bool CxImage::ShiftRGB | ( | long | r,
|  | long | g,
|  | long | b
| ) | `[inherited]`

  | Adjusts separately the red, green, and blue values in the image. Parameters:
  | r,g,b: | can be from -255 to +255.
Returns: true if everything is ok

bool CxImage::Threshold | ( | BYTE | level | ) | `[inherited]`

  | Converts the image to B&W. The Mean() function can be used for calculating the optimal threshold. Parameters:
  | level: | the lightness threshold.
Returns: true if everything is ok

bool CxImage::UnsharpMask | ( | float | radius = `5.0`,
|  | float | amount = `0.5`,
|  | int | threshold = `0`
| ) | `[inherited]`

| Author: [nipper]