Fulguro Logo Support This Project

Color Space Transform and Channel Extraction
[Image manipulation]


Detailed Description

Functions to convert color space and to extract color channel


Functions

FLGR_Ret flgr1d_color_convert_RGB_YUV (FLGR_Data1D *datdest, FLGR_Data1D *datsrc)
FLGR_Ret flgr1d_color_convert_YUV_RGB (FLGR_Data1D *datdest, FLGR_Data1D *datsrc)
FLGR_Ret flgr2d_color_convert_RGB_YUV (FLGR_Data2D *datdest, FLGR_Data2D *datsrc)
FLGR_Ret flgr2d_color_convert_YUV_RGB (FLGR_Data2D *datdest, FLGR_Data2D *datsrc)


Function Documentation

FLGR_Ret flgr1d_color_convert_RGB_YUV ( FLGR_Data1D datdest,
FLGR_Data1D datsrc 
)

Convert YUV channels to RGB channels

RGB sample must be stored in memory : R0 G0 B0 R1 G2 B2 R3 G3 ... YUV sample will be stored in memory : Y0 U0 V0 Y1 U2 V2 Y3 U3 ...

Conversion matrix used for unsigned 8 bits :

\[R = ( 298 \cdot (Y-16) + 409 \cdot (V-128) + 128) / 256\]

\[G = ( 298 \cdot (Y-16) - 100 \cdot (U-128) - 208 \cdot (V-128) + 128) / 256 \]

\[B = ( 298 \cdot (Y-16) + 516 \cdot (U-128) + 128) / 256\]

Conversion matrix used for all others types :

\[R = 1 \cdot Y - 0.00004 \cdot U + 1.1400 \cdot V\]

\[G = 1 \cdot Y - 0.39500 \cdot U - 0.5810 \cdot V\]

\[B = 1 \cdot Y + 2.03200 \cdot U - 0.0005 \cdot V\]

  • FLGR_UINT8 :
    • No internal float conversion performed
    • R,G,B,Y in [0 ; 2^8-1]
    • U in [0 ; 2^8-1]
    • V in [0 ; 2^8-1]

  • FLGR_UINT16 :
    • internal float conversion performed
    • R,G,B,Y in [0 ; 2^16-1]
    • U in [0 ; 2^16-1]
    • V in [0 ; 2^16-1]

  • FLGR_UINT32 :
    • internal float conversion performed
    • R,G,B,Y in [0 ; 2^32-1]
    • U in [0 ; 2^32-1]
    • V in [0 ; 2^32-1]

  • FLGR_INT8 :
    • internal float conversion performed
    • R,G,B,Y in [-2^7 ; 2^7-1]
    • U in [-2^7 ; 2^7-1]
    • V in [-2^7 ; 2^7-1]

  • FLGR_INT16 :
    • internal float conversion performed
    • R,G,B,Y in [-2^15 ; 2^15-1]
    • U in [-2^15 ; 2^15-1]
    • V in [-2^15 ; 2^15-1]

  • FLGR_INT32 :
    • internal float conversion performed

R,G,B,Y in [-2^31 ; 2^31-1]

  • U in [-2^31 ; 2^31-1]
  • V in [-2^31 ; 2^31-1]

  • FLGR_FLOAT32 and FLGR_FLOAT64 :
    • R,G,B,Y in [0 ; 1]
    • U in [-0.436 ; 0.436]
    • V in [-0.615 ; 0.615]

Parameters:
datdest : pointer to a FLGR_Data1D
datsrc : pointer to a FLGR_Data1D
Returns:
FLGR_RET_OK, ...

Definition at line 500 of file flgrImageColorSpace.c.

FLGR_Ret flgr1d_color_convert_YUV_RGB ( FLGR_Data1D datdest,
FLGR_Data1D datsrc 
)

Convert RGB channels to YUV channels

RGB sample must be stored in memory : R0 G0 B0 R1 G2 B2 R3 G3 ... YUV sample will be stored in memory : Y0 U0 V0 Y1 U2 V2 Y3 U3 ...

Conversion matrix used for unsigned 8 bits :

\[Y = (( 66 \cdot R + 129 \cdot G + 25 \cdot B + 128) / 256) + 16\]

\[U = ((-38 \cdot R - 74 \cdot G + 112 \cdot B + 128) / 256) + 128\]

\[V = ((112 \cdot R - 94 \cdot G - 18 \cdot B + 128) / 256) + 128\]

Conversion matrix used for all others types :

\[Y = 0.2990 \cdot R + 0.587 \cdot G + 0.114 \cdot B\]

\[U = -0.147 \cdot R - 0.289 \cdot G + 0.436 \cdot B\]

\[V = 0.6150 \cdot R - 0.515 \cdot G - 0.100 \cdot B\]

  • FLGR_UINT8 :
    • internal FGLR_UINT16 conversion performed
    • R,G,B,Y in [0 ; 2^8-1]
    • U in [0 ; 2^8-1]
    • V in [0 ; 2^8-1]

  • FLGR_UINT16 :
    • internal float conversion performed
    • R,G,B,Y in [0 ; 2^16-1]
    • U in [0 ; 2^16-1]
    • V in [0 ; 2^16-1]

  • FLGR_UINT32 :
    • internal float conversion performed
    • R,G,B,Y in [0 ; 2^32-1]
    • U in [0 ; 2^32-1]
    • V in [0 ; 2^32-1]

  • FLGR_INT8 :
    • internal float conversion performed
    • R,G,B,Y in [-2^7 ; 2^7-1]
    • U in [-2^7 ; 2^7-1]
    • V in [-2^7 ; 2^7-1]

  • FLGR_INT16 :
    • internal float conversion performed
    • R,G,B,Y in [-2^15 ; 2^15-1]
    • U in [-2^15 ; 2^15-1]
    • V in [-2^15 ; 2^15-1]

  • FLGR_INT32 :
    • internal float conversion performed
    • R,G,B,Y in [-2^31 ; 2^31-1]
    • U in [-2^31 ; 2^31-1]

V in [-2^31 ; 2^31-1]

  • FLGR_FLOAT32 and FLGR_FLOAT64 :
    • R,G,B,Y in [0 ; 1]
    • U in [-0.436 ; 0.436]
    • V in [-0.615 ; 0.615]

Parameters:
datdest : destination YUV image (spp=3)
datsrc : source RGB image (spp=3)

Definition at line 255 of file flgrImageColorSpace.c.

FLGR_Ret flgr2d_color_convert_RGB_YUV ( FLGR_Data2D datdest,
FLGR_Data2D datsrc 
)

Convert YUV channels to RGB channels

Parameters:
datdest 
datsrc 
See also:
flgr1d_color_convert_RGB_YUV

Definition at line 657 of file flgrImageColorSpace.c.

FLGR_Ret flgr2d_color_convert_YUV_RGB ( FLGR_Data2D datdest,
FLGR_Data2D datsrc 
)

Convert RGB channels to YUV channels

Parameters:
datdest 
datsrc 
See also:
flgr1d_color_convert_YUV_RGB

Definition at line 573 of file flgrImageColorSpace.c.


SourceForge.net Logo
Generated on Tue Nov 11 19:17:28 2008 for Fulguro by doxygen 1.5.6