color
[utils]

Color tools. More...

Collaboration diagram for color:

Data Structures

struct  GF_VideoSurface
 Video framebuffer object. More...
struct  GF_Window
 Video Window object. More...
struct  GF_ColorMatrix
 color matrix object More...
struct  GF_ColorKey
 Color Key descriptor. More...

Defines

#define GF_COL_ARGB(a, r, g, b)
#define GF_COL_ARGB_FIXED(_a, _r, _g, _b)
#define GF_COL_A(c)
#define GF_COL_R(c)
#define GF_COL_G(c)
#define GF_COL_B(c)
#define GF_COL_565(r, g, b)
#define GF_COL_555(r, g, b)
#define GF_COL_444(r, g, b)
#define GF_COL_AG(a, g)
#define GF_COL_TO_565(c)
#define GF_COL_TO_555(c)
#define GF_COL_TO_AG(c)
#define GF_COL_TO_444(c)

Typedefs

typedef u32 GF_Color
 ARGB color object.

Functions

GF_Color gf_color_parse (const char *name)
const char * gf_color_get_name (GF_Color col)
void gf_cmx_init (GF_ColorMatrix *_this)
void gf_cmx_set_all (GF_ColorMatrix *_this, Fixed *coefs)
void gf_cmx_set (GF_ColorMatrix *_this, Fixed mrr, Fixed mrg, Fixed mrb, Fixed mra, Fixed tr, Fixed mgr, Fixed mgg, Fixed mgb, Fixed mga, Fixed tg, Fixed mbr, Fixed mbg, Fixed mbb, Fixed mba, Fixed tb, Fixed mar, Fixed mag, Fixed mab, Fixed maa, Fixed ta)
void gf_cmx_copy (GF_ColorMatrix *_this, GF_ColorMatrix *from)
void gf_cmx_multiply (GF_ColorMatrix *_this, GF_ColorMatrix *with)
 color matrix multiplication
GF_Color gf_cmx_apply (GF_ColorMatrix *_this, GF_Color col)
 color matrix transform
void gf_cmx_apply_fixed (GF_ColorMatrix *_this, Fixed *a, Fixed *r, Fixed *g, Fixed *b)
 color components matrix transform
GF_Err gf_stretch_bits (GF_VideoSurface *dst, GF_VideoSurface *src, GF_Window *dst_wnd, GF_Window *src_wnd, u8 alpha, Bool flip, GF_ColorKey *colorKey, GF_ColorMatrix *cmat)
 stretches two video surfaces
GF_Err gf_color_write_yv12_10_to_yuv (GF_VideoSurface *vs_dst, unsigned char *pY, unsigned char *pU, unsigned char *pV, u32 src_stride, u32 src_width, u32 src_height, const GF_Window *src_wnd, Bool swap_uv)
 copies YUV 420 10 bits to YUV destination (only YUV420 8 bits supported)

Detailed Description

This section documents color tools for image processing and color conversion


Define Documentation

#define GF_COL_ARGB ( a,
r,
g,
 ) 

color formating macro from alpha, red, green and blue components expressed as integers ranging from 0 to 255

#define GF_COL_ARGB_FIXED ( _a,
_r,
_g,
_b   ) 

color formating macro from alpha, red, green and blue components expressed as fixed numbers ranging from 0 to FIX_ONE

#define GF_COL_A (  ) 

gets alpha component of a color

#define GF_COL_R (  ) 

gets red component of a color

#define GF_COL_G (  ) 

gets green component of a color

#define GF_COL_B (  ) 

gets blue component of a color

#define GF_COL_565 ( r,
g,
 ) 

16-bits color formating macro from red, green and blue components

#define GF_COL_555 ( r,
g,
 ) 

15-bits color formating macro from red, green and blue components

#define GF_COL_444 ( r,
g,
 ) 

15-bits color formating macro from red, green and blue components

#define GF_COL_AG ( a,
 ) 

16-bits alphagrey color formating macro alpha and grey components

#define GF_COL_TO_565 (  ) 

transfoms a 32-bits color into a 16-bits one.

Note:
alpha component is lost
#define GF_COL_TO_555 (  ) 

transfoms a 32-bits color into a 15-bits one.

Note:
alpha component is lost
#define GF_COL_TO_AG (  ) 

transfoms a 32-bits color into a 16-bits alphagrey one.

Note:
red component is used for grey, green and blue components are lost.
#define GF_COL_TO_444 (  ) 

transfoms a 32-bits color into a 15-bits one.

Note:
alpha component is lost

Typedef Documentation

typedef u32 GF_Color

The color type used in the GPAC framework represents colors in the form 0xAARRGGBB, with each component ranging from 0 to 255


Function Documentation

GF_Color gf_color_parse ( const char *  name  ) 

Parses color from HTML name or hexa representation

Parameters:
name name of the color to parse
Returns:
value with alpha set to 0xFF if successfull, 0 otherwise
const char* gf_color_get_name ( GF_Color  col  ) 

Gets color from HTML name or hexa representation

Parameters:
col color to identify
Returns:
name of the color if successfull, NULL otherwise
void gf_cmx_init ( GF_ColorMatrix _this  ) 

Inits a color matrix to identity

void gf_cmx_set_all ( GF_ColorMatrix _this,
Fixed coefs 
)

Inits all coefficients of a color matrix

Parameters:
_this color matrix to initialize
coefs list of the 20 fixed numbers to copy
void gf_cmx_set ( GF_ColorMatrix _this,
Fixed  mrr,
Fixed  mrg,
Fixed  mrb,
Fixed  mra,
Fixed  tr,
Fixed  mgr,
Fixed  mgg,
Fixed  mgb,
Fixed  mga,
Fixed  tg,
Fixed  mbr,
Fixed  mbg,
Fixed  mbb,
Fixed  mba,
Fixed  tb,
Fixed  mar,
Fixed  mag,
Fixed  mab,
Fixed  maa,
Fixed  ta 
)

Inits all coefficients of a color matrix

Parameters:
_this color matrix to initialize
mrr red-to-red multiplication factor
mrg red-to-green multiplication factor
mrb red-to-blue multiplication factor
mra red-to-alpha multiplication factor
tr red translation factor
mgr green-to-red multiplication factor
mgg green-to-green multiplication factor
mgb green-to-blue multiplication factor
mga green-to-alpha multiplication factor
tg green translation factor
mbr blue-to-red multiplication factor
mbg blue-to-green multiplication factor
mbb blue-to-blue multiplication factor
mba blue-to-alpha multiplication factor
tb blue translation factor
mar alpha-to-red multiplication factor
mag alpha-to-green multiplication factor
mab alpha-to-blue multiplication factor
maa alpha-to-alpha multiplication factor
ta alpha translation factor
void gf_cmx_copy ( GF_ColorMatrix _this,
GF_ColorMatrix from 
)

Inits a matrix from another matrix

Parameters:
_this color matrix to initialize
from color matrix to copy from
void gf_cmx_multiply ( GF_ColorMatrix _this,
GF_ColorMatrix with 
)

Multiplies a color matrix by another one. Result is _this*with

Parameters:
_this color matrix to transform. Once the function called, _this will contain the resulting color matrix
with color matrix to add
GF_Color gf_cmx_apply ( GF_ColorMatrix _this,
GF_Color  col 
)

Transforms a color with a given color matrix

Parameters:
_this color matrix to use.
col color to transform
Returns:
transformed color
void gf_cmx_apply_fixed ( GF_ColorMatrix _this,
Fixed a,
Fixed r,
Fixed g,
Fixed b 
)

Transforms color components with a given color matrix

Parameters:
_this color matrix to use.
a pointer to alpha component. Once the function is called, a contains the transformed alpha component
r pointer to red component. Once the function is called, r contains the transformed red component
g pointer to green component. Once the function is called, g contains the transformed green component
b pointer to blue component. Once the function is called, b contains the transformed blue component
GF_Err gf_stretch_bits ( GF_VideoSurface dst,
GF_VideoSurface src,
GF_Window dst_wnd,
GF_Window src_wnd,
u8  alpha,
Bool  flip,
GF_ColorKey colorKey,
GF_ColorMatrix cmat 
)

Software stretch of source surface ont destination surface.

Parameters:
dst destination surface
src source surface
dst_wnd destination rectangle. If null the entire destination surface is used
src_wnd source rectangle. If null the entire source surface is used
alpha blend factor of source over alpha
flip flips the source
colorKey makes source pixel matching the color key transparent
cmat applies color matrix to the source
Returns:
error code if any
GF_Err gf_color_write_yv12_10_to_yuv ( GF_VideoSurface vs_dst,
unsigned char *  pY,
unsigned char *  pU,
unsigned char *  pV,
u32  src_stride,
u32  src_width,
u32  src_height,
const GF_Window src_wnd,
Bool  swap_uv 
)

Software stretch of source surface ont destination surface.

Parameters:
vs_dst destination surface
pY source Y plane
pU source U plane. if NULL, the U plane is located after the Y plane
pV source V plane. if NULL, the V plane is located after the U plane
src_stride source stride in bytes
src_width source width in pixels
src_height source height in pixels
src_wnd source rectangle. If null the entire source surface is used
Returns:
error code if any

Generated on 4 May 2016 for libgpac by  doxygen 1.6.1