libgpac  0.5.0
Classes | Macros | Typedefs | Functions
color
utils

Color tools. More...

Classes

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...
 

Macros

#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

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)
 not done yet
 

Detailed Description

*This section documents color tools for image processing and color conversion

Macro Definition 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 (   c)

gets alpha component of a color

#define GF_COL_R (   c)

gets red component of a color

#define GF_COL_G (   c)

gets green component of a color

#define GF_COL_B (   c)

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 (   c)

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

Note
alpha component is lost
#define GF_COL_TO_555 (   c)

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

Note
alpha component is lost
#define GF_COL_TO_AG (   c)

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 (   c)

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

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
_thiscolor matrix to initialize
coefslist 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
_thiscolor matrix to initialize
mrrred-to-red multiplication factor
mrgred-to-green multiplication factor
mrbred-to-blue multiplication factor
mrared-to-alpha multiplication factor
trred translation factor
mgrgreen-to-red multiplication factor
mgggreen-to-green multiplication factor
mgbgreen-to-blue multiplication factor
mgagreen-to-alpha multiplication factor
tggreen translation factor
mbrblue-to-red multiplication factor
mbgblue-to-green multiplication factor
mbbblue-to-blue multiplication factor
mbablue-to-alpha multiplication factor
tbblue translation factor
maralpha-to-red multiplication factor
magalpha-to-green multiplication factor
mabalpha-to-blue multiplication factor
maaalpha-to-alpha multiplication factor
taalpha translation factor
void gf_cmx_copy ( GF_ColorMatrix _this,
GF_ColorMatrix from 
)

Inits a matrix from another matrix

Parameters
_thiscolor matrix to initialize
fromcolor 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
_thiscolor matrix to transform. Once the function called, _this will contain the resulting color matrix
withcolor matrix to add
GF_Color gf_cmx_apply ( GF_ColorMatrix _this,
GF_Color  col 
)

*Transforms a color with a given color matrix

Parameters
_thiscolor matrix to use.
colcolor 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
_thiscolor matrix to use.
apointer to alpha component. Once the function is called, a contains the transformed alpha component
rpointer to red component. Once the function is called, r contains the transformed red component
gpointer to green component. Once the function is called, g contains the transformed green component
bpointer 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 
)