TLIB documentation
 

tlFormatConversion.h File Reference


Detailed Description

Internal format conversion operators.

#include "tlVision.h"

Include dependency graph for tlFormatConversion.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int tl_rgb2hsi (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_rgb2hsi (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_rgb2yuv (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_rgb2yuv (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_rgb2nrg (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_rgb2nrg (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_rgb2gray (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_rgb2gray (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_rgb2bin (tlPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_rgb2bin (tlPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hsi2rgb (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_hsi2rgb (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hsi2yuv (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_hsi2yuv (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hsi2nrg (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_hsi2nrg (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hsi2gray (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_hsi2gray (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hsi2bin (tlPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_hsi2bin (tlPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_yuv2rgb (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_yuv2rgb (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_yuv2hsi (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_yuv2hsi (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_yuv2nrg (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_yuv2nrg (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_yuv2gray (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_yuv2gray (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_yuv2bin (tlPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_yuv2bin (tlPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_nrg2gray (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_nrg2gray (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_nrg2bin (tlPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_nrg2bin (tlPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_gray2rgb (tlPixel *src, int width, int height, tlRect *rect, tlPixel *dest)
int tl_gray2rgb (tlPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_gray2bin (tlPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_gray2bin (tlPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_hrgray2gray (tlHRPixel *src, int width, int height, tlRect *rect, tlPixel *dest, unsigned char shift=0)
int tl_hrgray2gray (tlHRPixel *src, int width, int height, tlPixel *mask, tlRect *rect, tlPixel *dest, unsigned char shift=0)
int tl_hrgray2bin (tlHRPixel *src, int width, int height, int min, int max, tlRect *rect, tlPixel *dest)
int tl_hrgray2bin (tlHRPixel *src, int width, int height, int min, int max, tlPixel *mask, tlRect *rect, tlPixel *dest)
int tl_to_channel (tlPixel *src, int width, int height, int pixel_width, int channel, tlPixel *mask, tlRect *rect, tlPixel *dest)


Function Documentation

int tl_gray2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

GRAY to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_gray2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

GRAY to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_gray2rgb ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

GRAY to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_gray2rgb ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

GRAY to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hrgray2bin ( tlHRPixel *  src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HRGRAY to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hrgray2bin ( tlHRPixel *  src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

GRAY to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hrgray2gray ( tlHRPixel *  src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest,
unsigned char  shift 
)

HRGRAY to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
shift [default=0] amount of right shift (read "divisions by 2") to perform on each pixel to cast high-res image into single-byte image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hrgray2gray ( tlHRPixel *  src,
int  width,
int  height,
tlRect rect,
tlPixel dest,
unsigned char  shift 
)

HRGRAY to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
shift [default=0] amount of right shift (read "divisions by 2") to perform on each pixel to cast high-res image into single-byte image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

HSI to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2gray ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2gray ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

HSI to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2nrg ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2nrg ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

HSI to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2rgb ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_hsi2rgb ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

HSI to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
Gonzalez and Woods. 1992. Digital Image Processing. Addison-Wesley.

int tl_hsi2yuv ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to YUV format conversion

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas

int tl_hsi2yuv ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

HSI to YUV format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_nrg2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

NRG to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_nrg2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

NRG to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_nrg2gray ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

NRG to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_nrg2gray ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

NRG to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

RGB to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

RGB to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2gray ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

RGB to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2gray ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

RGB to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2hsi ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

RGB to HSI format conversion

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
Gonzalez and Woods. 1992. Digital Image Processing. Addison-Wesley.

int tl_rgb2hsi ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

RGB to HSI format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2nrg ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

RGB to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask binary conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2nrg ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

RGB to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_rgb2yuv ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

RGB to YUV format conversion

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas For a fast integer implementation, see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddraw/html/_dxce_converting_between_yuv_and_rgb.asp

int tl_rgb2yuv ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

RGB to YUV format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_to_channel ( tlPixel src,
int  width,
int  height,
int  pixel_width,
int  channel,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

Extract a channel from an image. The result is placed in a pixel array.

Parameters:
src pixel array containing source image
width image width
height image height
pixel_width bytes per pixel
channel channel to extract
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_yuv2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

YUV to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas

int tl_yuv2bin ( tlPixel src,
int  width,
int  height,
int  min,
int  max,
tlRect rect,
tlPixel dest 
)

YUV to BIN format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
min lower binary threshold [0..255]
max upper binary threshold [0..255]
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_yuv2gray ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

YUV to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas

int tl_yuv2gray ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

YUV to GRAY format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_yuv2hsi ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

YUV to HSI format conversion

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas

int tl_yuv2hsi ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

YUV to HSI format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_yuv2nrg ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

YUV to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas

int tl_yuv2nrg ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

YUV to NRG format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.

int tl_yuv2rgb ( tlPixel src,
int  width,
int  height,
tlPixel mask,
tlRect rect,
tlPixel dest 
)

HSI to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
mask conversion mask (only converts active pixels)
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.
Note:
For transform details, see:
http://www.answers.com/topic/yuv-rgb-conversion-formulas For a fast integer implementation, see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddraw/html/_dxce_converting_between_yuv_and_rgb.asp

int tl_yuv2rgb ( tlPixel src,
int  width,
int  height,
tlRect rect,
tlPixel dest 
)

YUV to RGB format conversion.

Parameters:
src pixel array containing image to convert
width image width
height image height
rect portion of the image to process
dest [out] pixel array containing the converted image
Returns:
0 on success, -1 otherwise.
See error management for details.



TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.