libgpac
Documentation of the core library of GPAC
evg.h File Reference

2D vector graphics rasterizer More...

#include <gpac/path2d.h>
#include <gpac/module.h>
#include <gpac/color.h>
+ Include dependency graph for evg.h:

Data Structures

struct  GF_EVGFragmentParam
 
struct  GF_EVGVertexParam
 

Typedefs

typedef struct _gf_evg_base_stencil GF_EVGStencil
 
typedef struct _gf_evg_surface GF_EVGSurface
 
typedef void(* gf_evg_texture_callback) (void *cbk, u32 x, u32 y, Float *r, Float *g, Float *b, Float *a)
 
typedef u8(* gf_evg_get_alpha) (void *udta, u8 src_alpha, s32 x, s32 y)
 
typedef Bool(* gf_evg_fragment_shader) (void *udta, GF_EVGFragmentParam *fragp)
 
typedef Bool(* gf_evg_fragment_shader_init) (void *udta, GF_EVGFragmentParam *fragp, u32 th_id, Bool is_cleanup)
 
typedef Bool(* gf_evg_vertex_shader) (void *udta, GF_EVGVertexParam *vertp)
 

Enumerations

enum  GF_StencilType {
  GF_STENCIL_SOLID = 0 , GF_STENCIL_LINEAR_GRADIENT , GF_STENCIL_RADIAL_GRADIENT , GF_STENCIL_VERTEX_GRADIENT ,
  GF_STENCIL_TEXTURE
}
 
enum  GF_GradientMode { GF_GRADIENT_MODE_PAD , GF_GRADIENT_MODE_SPREAD , GF_GRADIENT_MODE_REPEAT }
 
enum  GF_TextureMapFlags { GF_TEXTURE_REPEAT_S = (1<<1) , GF_TEXTURE_REPEAT_T = (1<<2) , GF_TEXTURE_FLIP_X = (1<<3) , GF_TEXTURE_FLIP_Y = (1<<4) }
 
enum  GF_TextureFilter { GF_TEXTURE_FILTER_HIGH_SPEED , GF_TEXTURE_FILTER_MID , GF_TEXTURE_FILTER_HIGH_QUALITY }
 
enum  GF_RasterQuality { GF_RASTER_HIGH_SPEED , GF_RASTER_MID , GF_RASTER_HIGH_QUALITY }
 
enum  GF_EVGMultiTextureMode {
  GF_EVG_OPERAND_NONE = 0 , GF_EVG_OPERAND_MIX , GF_EVG_OPERAND_MIX_ALPHA , GF_EVG_OPERAND_REPLACE_ALPHA ,
  GF_EVG_OPERAND_REPLACE_ONE_MINUS_ALPHA , GF_EVG_OPERAND_MIX_DYN , GF_EVG_OPERAND_MIX_DYN_ALPHA , GF_EVG_OPERAND_ODD_FILL
}
 
enum  GF_EVGCompositeMode {
  GF_EVG_SRC_OVER = 0 , GF_EVG_SRC_ATOP , GF_EVG_SRC_IN , GF_EVG_SRC_OUT ,
  GF_EVG_DST_ATOP , GF_EVG_DST_IN , GF_EVG_DST_OUT , GF_EVG_DST_OVER ,
  GF_EVG_LIGHTER , GF_EVG_COPY , GF_EVG_XOR
}
 
enum  GF_EVGPrimitiveType {
  GF_EVG_POINTS =1 , GF_EVG_POLYGON , GF_EVG_LINES , GF_EVG_TRIANGLES ,
  GF_EVG_QUADS , GF_EVG_LINE_STRIP , GF_EVG_TRIANGLE_STRIP , GF_EVG_TRIANGLE_FAN ,
  GF_EVG_QUAD_STRIP
}
 
enum  GF_EVGDepthTest {
  GF_EVGDEPTH_DISABLE , GF_EVGDEPTH_NEVER , GF_EVGDEPTH_ALWAYS , GF_EVGDEPTH_EQUAL ,
  GF_EVGDEPTH_NEQUAL , GF_EVGDEPTH_LESS , GF_EVGDEPTH_LESS_EQUAL , GF_EVGDEPTH_GREATER ,
  GF_EVGDEPTH_GREATER_EQUAL
}
 
enum  GF_EVGFragmentType {
  GF_EVG_FRAG_INVALID = 0 , GF_EVG_FRAG_RGB , GF_EVG_FRAG_RGB_PACK , GF_EVG_FRAG_YUV ,
  GF_EVG_FRAG_YUV_PACK
}
 
enum  GF_EVGMaskMode {
  GF_EVGMASK_NONE = 0 , GF_EVGMASK_DRAW , GF_EVGMASK_DRAW_NO_CLEAR , GF_EVGMASK_USE ,
  GF_EVGMASK_USE_INV , GF_EVGMASK_RECORD
}
 

Functions

GF_EVGStencilgf_evg_stencil_new (GF_StencilType type)
 
void gf_evg_stencil_delete (GF_EVGStencil *stencil)
 
GF_Err gf_evg_stencil_set_matrix (GF_EVGStencil *stencil, GF_Matrix2D *mat)
 
Bool gf_evg_stencil_get_matrix (GF_EVGStencil *stencil, GF_Matrix2D *mat)
 
GF_Err gf_evg_stencil_set_auto_matrix (GF_EVGStencil *stencil, Bool auto_on)
 
Bool gf_evg_stencil_get_auto_matrix (GF_EVGStencil *stencil)
 
GF_StencilType gf_evg_stencil_type (GF_EVGStencil *stencil)
 
GF_Err gf_evg_stencil_set_brush_color (GF_EVGStencil *stencil, GF_Color color)
 
GF_Color gf_evg_stencil_get_brush_color (GF_EVGStencil *stencil)
 
GF_Err gf_evg_stencil_set_gradient_mode (GF_EVGStencil *stencil, GF_GradientMode mode)
 
GF_Err gf_evg_stencil_set_linear_gradient (GF_EVGStencil *stencil, Fixed start_x, Fixed start_y, Fixed end_x, Fixed end_y)
 
GF_Err gf_evg_stencil_set_radial_gradient (GF_EVGStencil *stencil, Fixed cx, Fixed cy, Fixed fx, Fixed fy, Fixed x_radius, Fixed y_radius)
 
GF_Err gf_evg_stencil_set_gradient_interpolation (GF_EVGStencil *stencil, Fixed *pos, GF_Color *col, u32 count)
 
GF_Err gf_evg_stencil_push_gradient_interpolation (GF_EVGStencil *stencil, Fixed pos, GF_Color col)
 
GF_Err gf_evg_stencil_set_alpha (GF_EVGStencil *stencil, u8 alpha)
 
u8 gf_evg_stencil_get_alpha (GF_EVGStencil *stencil)
 
Bool gf_evg_texture_format_ok (GF_PixelFormat pixelFormat)
 
GF_Err gf_evg_stencil_set_texture (GF_EVGStencil *stencil, u8 *pixels, u32 width, u32 height, u32 stride, GF_PixelFormat pixelFormat)
 
GF_Err gf_evg_stencil_set_texture_planes (GF_EVGStencil *stencil, u32 width, u32 height, GF_PixelFormat pixelFormat, const u8 *y_or_rgb, u32 stride, const u8 *u_plane, const u8 *v_plane, u32 uv_stride, const u8 *alpha_plane, u32 alpha_stride)
 
GF_Err gf_evg_stencil_set_palette (GF_EVGStencil *stencil, const u8 *palette, u32 pix_fmt, u32 nb_cols)
 
GF_Err gf_evg_stencil_set_texture_parametric (GF_EVGStencil *stencil, u32 width, u32 height, GF_PixelFormat pixelFormat, gf_evg_texture_callback callback, void *cbk_udta, Bool use_screen_coords)
 
GF_Err gf_evg_stencil_set_mapping (GF_EVGStencil *stencil, GF_TextureMapFlags map_mode)
 
GF_Err gf_evg_stencil_set_pad_color (GF_EVGStencil *stencil, GF_Color pad_color)
 
u32 gf_evg_stencil_get_pad_color (GF_EVGStencil *stencil)
 
GF_Err gf_evg_stencil_set_filter (GF_EVGStencil *stencil, GF_TextureFilter filter_mode)
 
GF_Err gf_evg_stencil_set_color_matrix (GF_EVGStencil *stencil, GF_ColorMatrix *cmat)
 
GF_Err gf_evg_stencil_get_color_matrix (GF_EVGStencil *stencil, GF_ColorMatrix *cmat)
 
u32 gf_evg_stencil_get_pixel (GF_EVGStencil *stencil, s32 x, s32 y)
 
u32 gf_evg_stencil_get_pixel_yuv (GF_EVGStencil *stencil, s32 x, s32 y)
 
u64 gf_evg_stencil_get_pixel_wide (GF_EVGStencil *stencil, s32 x, s32 y)
 
u64 gf_evg_stencil_get_pixel_yuv_wide (GF_EVGStencil *stencil, s32 x, s32 y)
 
GF_Vec4 gf_evg_stencil_get_pixel_f (GF_EVGStencil *stencil, Float x, Float y)
 
GF_Vec4 gf_evg_stencil_get_pixel_yuv_f (GF_EVGStencil *stencil, Float x, Float y)
 
GF_EVGSurfacegf_evg_surface_new (Bool center_coords)
 
void gf_evg_surface_delete (GF_EVGSurface *surf)
 
GF_Err gf_evg_enable_threading (GF_EVGSurface *surf, s32 nb_threads)
 
GF_Err gf_evg_surface_attach_to_texture (GF_EVGSurface *surf, GF_EVGStencil *sten)
 
Bool gf_evg_surface_format_ok (GF_PixelFormat pixelFormat)
 
GF_Err gf_evg_surface_attach_to_buffer (GF_EVGSurface *surf, u8 *pixels, u32 width, u32 height, s32 pitch_x, s32 pitch_y, GF_PixelFormat pixelFormat)
 
GF_Err gf_evg_surface_set_raster_level (GF_EVGSurface *surf, GF_RasterQuality level)
 
GF_RasterQuality gf_evg_surface_get_raster_level (GF_EVGSurface *surf)
 
GF_Err gf_evg_surface_force_aa (GF_EVGSurface *surf)
 
GF_Err gf_evg_surface_set_matrix (GF_EVGSurface *surf, GF_Matrix2D *mat)
 
GF_Err gf_evg_surface_set_matrix_3d (GF_EVGSurface *surf, GF_Matrix *mat)
 
GF_Err gf_evg_surface_set_clipper (GF_EVGSurface *surf, GF_IRect *rc)
 
Bool gf_evg_surface_use_clipper (GF_EVGSurface *surf)
 
GF_Err gf_evg_surface_set_path (GF_EVGSurface *surf, GF_Path *path)
 
GF_Err gf_evg_surface_fill (GF_EVGSurface *surf, GF_EVGStencil *stencil)
 
GF_Err gf_evg_surface_multi_fill (GF_EVGSurface *surf, GF_EVGMultiTextureMode operand, GF_EVGStencil *sten1, GF_EVGStencil *sten2, GF_EVGStencil *sten3, Float params[4])
 
GF_Err gf_evg_surface_clear (GF_EVGSurface *surf, GF_IRect *rc, GF_Color col)
 
void gf_evg_surface_set_center_coords (GF_EVGSurface *surf, Bool center_coords)
 
void gf_evg_surface_set_composite_mode (GF_EVGSurface *surf, GF_EVGCompositeMode comp_mode)
 
void gf_evg_surface_set_alpha_callback (GF_EVGSurface *surf, gf_evg_get_alpha get_alpha, void *cbk)
 
GF_Err gf_evg_surface_enable_3d (GF_EVGSurface *surf)
 
GF_Err gf_evg_surface_set_projection (GF_EVGSurface *surf, GF_Matrix *mx)
 
GF_Err gf_evg_surface_set_modelview (GF_EVGSurface *surf, GF_Matrix *mx)
 
GF_Err gf_evg_surface_draw_array (GF_EVGSurface *surf, u32 *indices, u32 nb_indices, Float *vertices, u32 nb_vertices, u32 nb_comp, GF_EVGPrimitiveType prim_type)
 
GF_Err gf_evg_surface_clear_depth (GF_EVGSurface *surf, Float depth)
 
GF_Err gf_evg_surface_viewport (GF_EVGSurface *surf, u32 x, u32 y, u32 w, u32 h)
 
GF_Err gf_evg_surface_draw_path (GF_EVGSurface *surf, GF_Path *path, Float z)
 
GF_Err gf_evg_set_depth_test (GF_EVGSurface *surf, GF_EVGDepthTest mode)
 
GF_Err gf_evg_surface_set_fragment_shader (GF_EVGSurface *surf, gf_evg_fragment_shader shader, gf_evg_fragment_shader_init shader_init, void *shader_udta)
 
GF_Err gf_evg_surface_set_vertex_shader (GF_EVGSurface *surf, gf_evg_vertex_shader shader, void *shader_udta)
 
GF_Err gf_evg_surface_set_ccw (GF_EVGSurface *surf, Bool is_ccw)
 
GF_Err gf_evg_surface_set_backcull (GF_EVGSurface *surf, Bool backcull)
 
GF_Err gf_evg_surface_set_antialias (GF_EVGSurface *surf, Bool antialias)
 
GF_Err gf_evg_surface_set_min_depth (GF_EVGSurface *surf, Float min_depth)
 
GF_Err gf_evg_surface_set_max_depth (GF_EVGSurface *surf, Float max_depth)
 
GF_Err gf_evg_surface_set_clip_zero (GF_EVGSurface *surf, Bool clip_zero)
 
GF_Err gf_evg_surface_set_point_size (GF_EVGSurface *surf, Float size)
 
GF_Err gf_evg_surface_set_line_size (GF_EVGSurface *surf, Float size)
 
GF_Err gf_evg_surface_set_point_smooth (GF_EVGSurface *surf, Bool smooth)
 
GF_Err gf_evg_surface_disable_early_depth (GF_EVGSurface *surf, Bool disable)
 
GF_Err gf_evg_surface_write_depth (GF_EVGSurface *surf, Bool do_write)
 
GF_Err gf_evg_surface_set_depth_buffer (GF_EVGSurface *surf, Float *depth)
 
GF_Err gf_gf_evg_rgb_to_yuv_f (GF_EVGSurface *surf, Float r, Float g, Float b, Float *y, Float *cb, Float *cr)
 
GF_Err gf_evg_yuv_to_rgb_f (GF_EVGSurface *surf, Float y, Float cb, Float cr, Float *r, Float *g, Float *b)
 
void gf_evg_rgb_to_yuv (GF_EVGSurface *surf, GF_Color col, u8 *y, u8 *cb, u8 *cr)
 
GF_Color gf_evg_argb_to_ayuv (GF_EVGSurface *surf, GF_Color col)
 
GF_Color gf_evg_ayuv_to_argb (GF_EVGSurface *surf, GF_Color col)
 
u64 gf_evg_argb_to_ayuv_wide (GF_EVGSurface *surf, u64 col)
 
u64 gf_evg_ayuv_to_argb_wide (GF_EVGSurface *surf, u64 col)
 
GF_Err gf_evg_surface_set_mask_mode (GF_EVGSurface *surf, GF_EVGMaskMode mask_mode)
 
GF_EVGMaskMode gf_evg_surface_get_mask_mode (GF_EVGSurface *surf)
 

Detailed Description

This file contains all defined functions for 2D vector graphics of the GPAC framework.