Color tools.
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, |
|
|
|
b |
|
) |
| |
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
gets alpha component of a color
gets red component of a color
gets green component of a color
gets blue component of a color
#define GF_COL_565 |
( |
|
r, |
|
|
|
g, |
|
|
|
b |
|
) |
| |
16-bits color formating macro from red, green and blue components
#define GF_COL_555 |
( |
|
r, |
|
|
|
g, |
|
|
|
b |
|
) |
| |
15-bits color formating macro from red, green and blue components
#define GF_COL_444 |
( |
|
r, |
|
|
|
g, |
|
|
|
b |
|
) |
| |
15-bits color formating macro from red, green and blue components
#define GF_COL_AG |
( |
|
a, |
|
|
|
g |
|
) |
| |
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
*The color type used in the GPAC framework represents colors in the form 0xAARRGGBB, with each component ranging from 0 to 255
Function Documentation
Inits a color matrix to identity
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 |
Inits a matrix from another matrix
- Parameters:
-
_this | color matrix to initialize |
from | color matrix to copy from |
*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 |
*Transforms a color with a given color matrix
- Parameters:
-
_this | color matrix to use. |
col | color to transform |
- Returns:
- transformed color
*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 |