GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
color.c File Reference
#include <gpac/tools.h>
#include <gpac/constants.h>
#include <gpac/color.h>
+ Include dependency graph for color.c:

Macros

#define col_clip(a)   MAX(0, MIN(255, a))
 
#define SCALEBITS_OUT   13
 
#define FIX_OUT(x)   ((unsigned short) ((x) * (1L<<SCALEBITS_OUT) + 0.5))
 
#define CLIP_COMP(val)   { if (val<0) { val=0; } else if (val>FIX_ONE) { val=FIX_ONE;} }
 

Typedefs

typedef void(* copy_row_proto )(u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
typedef void(* load_line_proto )(u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 src_width, u32 src_height, u8 *dst_bits)
 

Functions

static void yuv2rgb_init (void)
 
static void gf_yuv_load_lines_planar (unsigned char *dst, s32 dststride, unsigned char *y_src, unsigned char *u_src, unsigned char *v_src, s32 y_stride, s32 uv_stride, s32 width)
 
static void gf_yuv_load_lines_packed (unsigned char *dst, s32 dststride, unsigned char *y_src, unsigned char *u_src, unsigned char *v_src, s32 width)
 
static void gf_yuva_load_lines (unsigned char *dst, s32 dststride, unsigned char *y_src, unsigned char *u_src, unsigned char *v_src, unsigned char *a_src, s32 y_stride, s32 uv_stride, s32 width)
 
static s32 mul255 (s32 a, s32 b)
 
static void copy_row_rgb_555 (u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_rgb_565 (u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_rgb_24 (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_bgr_24 (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_bgrx (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_rgbx (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void copy_row_rgbd (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_rgb_555 (u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_rgb_565 (u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_rgb_24 (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_bgr_24 (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_bgrx (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_rgbx (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_bgra (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void merge_row_rgba (u8 *src, u32 src_w, u8 *dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
 
static void load_line_grey (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_alpha_grey (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static u8 colmask (s32 a, s32 n)
 
static void load_line_rgb_555 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_rgb_565 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_rgb_24 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_bgr_24 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_rgb_32 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_rgbd (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_rgbds (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_argb (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_bgr_32 (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_yv12 (char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits, u8 *pU, u8 *pV)
 
static void load_line_yuva (char *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits, u8 *pU, u8 *pV, u8 *pA)
 
static void load_line_yuyv (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void load_line_YUV420SP (u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 width, u32 height, u8 *dst_bits)
 
static void gf_cmx_apply_argb (GF_ColorMatrix *_this, u8 *a_, u8 *r_, u8 *g_, u8 *b_)
 
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 *key, GF_ColorMatrix *cmat)
 not done yet More...
 
void gf_cmx_init (GF_ColorMatrix *_this)
 
static void gf_cmx_identity (GF_ColorMatrix *_this)
 
void gf_cmx_set_all (GF_ColorMatrix *_this, Fixed *coefs)
 
void gf_cmx_set (GF_ColorMatrix *_this, Fixed c1, Fixed c2, Fixed c3, Fixed c4, Fixed c5, Fixed c6, Fixed c7, Fixed c8, Fixed c9, Fixed c10, Fixed c11, Fixed c12, Fixed c13, Fixed c14, Fixed c15, Fixed c16, Fixed c17, Fixed c18, Fixed c19, Fixed c20)
 
void gf_cmx_copy (GF_ColorMatrix *_this, GF_ColorMatrix *from)
 
void gf_cmx_multiply (GF_ColorMatrix *_this, GF_ColorMatrix *w)
 color matrix multiplication More...
 
GF_Color gf_cmx_apply (GF_ColorMatrix *_this, GF_Color col)
 color matrix transform More...
 
void gf_cmx_apply_fixed (GF_ColorMatrix *_this, Fixed *a, Fixed *r, Fixed *g, Fixed *b)
 color components matrix transform More...
 

Variables

static s32 RGB_Y [256]
 
static s32 B_U [256]
 
static s32 G_U [256]
 
static s32 G_V [256]
 
static s32 R_V [256]
 
static s32 yuv2rgb_is_init = 0
 

Macro Definition Documentation

#define col_clip (   a)    MAX(0, MIN(255, a))
#define SCALEBITS_OUT   13
#define FIX_OUT (   x)    ((unsigned short) ((x) * (1L<<SCALEBITS_OUT) + 0.5))
#define CLIP_COMP (   val)    { if (val<0) { val=0; } else if (val>FIX_ONE) { val=FIX_ONE;} }

Typedef Documentation

typedef void(* copy_row_proto)(u8 *src, u32 src_w, u8 *_dst, u32 dst_w, s32 h_inc, s32 x_pitch, u8 alpha)
typedef void(* load_line_proto)(u8 *src_bits, u32 x_offset, u32 y_offset, u32 y_pitch, u32 src_width, u32 src_height, u8 *dst_bits)

Function Documentation

static void yuv2rgb_init ( void  )
static

+ Here is the caller graph for this function:

static void gf_yuv_load_lines_planar ( unsigned char *  dst,
s32  dststride,
unsigned char *  y_src,
unsigned char *  u_src,
unsigned char *  v_src,
s32  y_stride,
s32  uv_stride,
s32  width 
)
static

+ Here is the caller graph for this function:

static void gf_yuv_load_lines_packed ( unsigned char *  dst,
s32  dststride,
unsigned char *  y_src,
unsigned char *  u_src,
unsigned char *  v_src,
s32  width 
)
static

+ Here is the caller graph for this function:

static void gf_yuva_load_lines ( unsigned char *  dst,
s32  dststride,
unsigned char *  y_src,
unsigned char *  u_src,
unsigned char *  v_src,
unsigned char *  a_src,
s32  y_stride,
s32  uv_stride,
s32  width 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static s32 mul255 ( s32  a,
s32  b 
)
static

+ Here is the caller graph for this function:

static void copy_row_rgb_555 ( u8 src,
u32  src_w,
u8 _dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_rgb_565 ( u8 src,
u32  src_w,
u8 _dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_rgb_24 ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_bgr_24 ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_bgrx ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_rgbx ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void copy_row_rgbd ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the caller graph for this function:

static void merge_row_rgb_555 ( u8 src,
u32  src_w,
u8 _dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_rgb_565 ( u8 src,
u32  src_w,
u8 _dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_rgb_24 ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_bgr_24 ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_bgrx ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_rgbx ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_bgra ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void merge_row_rgba ( u8 src,
u32  src_w,
u8 dst,
u32  dst_w,
s32  h_inc,
s32  x_pitch,
u8  alpha 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_grey ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_alpha_grey ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static u8 colmask ( s32  a,
s32  n 
)
static

+ Here is the caller graph for this function:

static void load_line_rgb_555 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_rgb_565 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_rgb_24 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_bgr_24 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_rgb_32 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_rgbd ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_rgbds ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_argb ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_bgr_32 ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void load_line_yv12 ( char *  src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits,
u8 pU,
u8 pV 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_yuva ( char *  src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits,
u8 pU,
u8 pV,
u8 pA 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_yuyv ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void load_line_YUV420SP ( u8 src_bits,
u32  x_offset,
u32  y_offset,
u32  y_pitch,
u32  width,
u32  height,
u8 dst_bits 
)
static

+ Here is the caller graph for this function:

static void gf_cmx_apply_argb ( GF_ColorMatrix _this,
u8 a_,
u8 r_,
u8 g_,
u8 b_ 
)
static

+ Here is the caller graph for this function:

static void gf_cmx_identity ( GF_ColorMatrix _this)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

s32 RGB_Y[256]
static
s32 B_U[256]
static
s32 G_U[256]
static
s32 G_V[256]
static
s32 R_V[256]
static
s32 yuv2rgb_is_init = 0
static