libgpac
Documentation of the core library of GPAC
|
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... | |
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_COLW_A(c) |
#define | GF_COLW_R(c) |
#define | GF_COLW_G(c) |
#define | GF_COLW_B(c) |
Typedefs | |
typedef u32 | GF_Color |
ARGB color object. More... | |
Functions | |
GF_Color | gf_color_parse (const char *name) |
const char * | gf_color_get_name (GF_Color col) |
Bool | gf_color_enum (u32 *idx, GF_Color *color, const char **color_name) |
void | gf_cmx_init (GF_ColorMatrix *_this) |
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 More... | |
GF_Color | gf_cmx_apply (GF_ColorMatrix *_this, GF_Color col) |
color matrix transform More... | |
void | gf_cmx_apply_argb (GF_ColorMatrix *_this, u8 *a, u8 *r, u8 *g, u8 *b) |
color matrix transform More... | |
u64 | gf_cmx_apply_wide (GF_ColorMatrix *_this, u64 col) |
color matrix transform on wide pixel (16 bit per component) More... | |
void | gf_cmx_apply_fixed (GF_ColorMatrix *_this, Fixed *a, Fixed *r, Fixed *g, Fixed *b) |
color components matrix transform More... | |
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 More... | |
This section documents color tools for image processing and color conversion
struct GF_VideoSurface |
The video framebuffer object represents uncompressed color data like images in a variety of formats. Data in the video framebuffer MUST be continuous.
Data Fields | ||
---|---|---|
u32 | width |
Width of the video framebuffer |
u32 | height |
Height of the video framebuffer |
s32 | pitch_x |
Horizontal pitch of the video framebuffer (number of bytes to skip to go to next (right) pixel in the buffer). May be negative for some framebuffers (embedded devices). 0 means linear frame buffer (pitch_x==bytes per pixel) |
s32 | pitch_y |
Vertical pitch of the video framebuffer (number of bytes to skip to go down one line in the buffer). May be negative for some framebuffers (embedded devices) |
u32 | pixel_format |
Pixel format of the video framebuffer |
u8 * | video_buffer |
pointer to the beginning of the video memory (top-left corner) |
Bool | is_hardware_memory |
indicates that the video data reside on systems memory or video card one |
u8 * | u_ptr |
indicates U and V (and optional alpha) buffers in case of planar video with separated component. If not set, all components are in the video_buffer pointer |
u8 * | v_ptr | |
u8 * | a_ptr | |
u8 | global_alpha |
alpha value for this surface |
struct GF_Window |
struct GF_ColorMatrix |
The Color transformation matrix object allows complete color space transformation (shift, rotate, skew, add).
The matrix coefs are in rgba order, hence the color RGBA is transformed to:
Coeficients are in intensity scale, ranging from 0 to FIX_ONE.
Data Fields | ||
---|---|---|
Fixed | m[20] |
color matrix coefficient |
u32 | identity |
internal flag to speed up things when matrix is identity. This is a read only flag, do not modify it |
struct GF_ColorKey |
#define GF_COL_ARGB | ( | a, | |
r, | |||
g, | |||
b | |||
) |
color formatting 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 formatting 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, | |||
b | |||
) |
16-bits color formatting macro from red, green and blue components
#define GF_COL_555 | ( | r, | |
g, | |||
b | |||
) |
15-bits color formatting macro from red, green and blue components
#define GF_COLW_A | ( | c | ) |
gets alpha component of a wide color
#define GF_COLW_R | ( | c | ) |
gets red component of a wide color
#define GF_COLW_G | ( | c | ) |
gets green component of a wide color
#define GF_COLW_B | ( | c | ) |
gets blue component of a wide color
The color type used in the GPAC framework represents colors in the form 0xAARRGGBB, with each component ranging from 0 to 255
GF_Color gf_color_parse | ( | const char * | name | ) |
Parses color from HTML name or hexa representation
name | name of the color to parse |
const char* gf_color_get_name | ( | GF_Color | col | ) |
Gets color from HTML name or hexa representation
col | color to identify |
Enumerates built-in colors
idx | index of color to query, incremented by one on success |
color | set to color value, can be NULL |
color_name | set to color name, can be NULL |
void gf_cmx_init | ( | GF_ColorMatrix * | _this | ) |
Inits a color matrix to identity
_this | the target color matrix to initialize |
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
_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
_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
_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
_this | color matrix to use. |
col | color to transform |
void gf_cmx_apply_argb | ( | GF_ColorMatrix * | _this, |
u8 * | a, | ||
u8 * | r, | ||
u8 * | g, | ||
u8 * | b | ||
) |
Transforms a color with a given color matrix
_this | color matrix to use. |
a | alpha to transform (in/out) |
r | red to transform (in/out) |
g | green to transform (in/out) |
b | blue to transform (in/out) |
u64 gf_cmx_apply_wide | ( | GF_ColorMatrix * | _this, |
u64 | col | ||
) |
Transforms a color with a given color matrix
_this | color matrix to use. |
col | color to transform |
void gf_cmx_apply_fixed | ( | GF_ColorMatrix * | _this, |
Fixed * | a, | ||
Fixed * | r, | ||
Fixed * | g, | ||
Fixed * | b | ||
) |
Transforms color components with a given color matrix
_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 onto destination surface.
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 |