hal_gfx_blender.h File Reference
#include "hal_gfx_sys_defs.h"
#include "hal_gfx_graphics.h"

Go to the source code of this file.

Macros

#define HAL_GFX_BF_ZERO   (0x0U)
 
#define HAL_GFX_BF_ONE   (0x1U)
 
#define HAL_GFX_BF_SRCCOLOR   (0x2U)
 
#define HAL_GFX_BF_INVSRCCOLOR   (0x3U)
 
#define HAL_GFX_BF_SRCALPHA   (0x4U)
 
#define HAL_GFX_BF_INVSRCALPHA   (0x5U)
 
#define HAL_GFX_BF_DESTALPHA   (0x6U)
 
#define HAL_GFX_BF_INVDESTALPHA   (0x7U)
 
#define HAL_GFX_BF_DESTCOLOR   (0x8U)
 
#define HAL_GFX_BF_INVDESTCOLOR   (0x9U)
 
#define HAL_GFX_BF_CONSTCOLOR   (0xaU)
 
#define HAL_GFX_BF_CONSTALPHA   (0xbU)
 
#define HAL_GFX_BL_SIMPLE   ( (uint32_t)HAL_GFX_BF_SRCALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 
#define HAL_GFX_BL_CLEAR   ( (uint32_t)HAL_GFX_BF_ZERO /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 
#define HAL_GFX_BL_SRC   ( (uint32_t)HAL_GFX_BF_ONE /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 
#define HAL_GFX_BL_SRC_OVER   ( (uint32_t)HAL_GFX_BF_ONE | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 
#define HAL_GFX_BL_DST_OVER   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_ONE <<8) )
 
#define HAL_GFX_BL_SRC_IN   ( (uint32_t)HAL_GFX_BF_DESTALPHA /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 
#define HAL_GFX_BL_DST_IN   (/*(uint32_t)HAL_GFX_BF_ZERO |*/ ((uint32_t)HAL_GFX_BF_SRCALPHA <<8) )
 
#define HAL_GFX_BL_SRC_OUT   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA/*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/ )
 
#define HAL_GFX_BL_DST_OUT   (/*(uint32_t)HAL_GFX_BF_ZERO |*/ ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 
#define HAL_GFX_BL_SRC_ATOP   ( (uint32_t)HAL_GFX_BF_DESTALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 
#define HAL_GFX_BL_DST_ATOP   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_SRCALPHA <<8) )
 
#define HAL_GFX_BL_ADD   ( (uint32_t)HAL_GFX_BF_ONE | ((uint32_t)HAL_GFX_BF_ONE <<8) )
 
#define HAL_GFX_BL_XOR   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 
#define HAL_GFX_BLOP_NONE   (0U)
 
#define HAL_GFX_BLOP_STENCIL_TXTY   (0x00800000U)
 
#define HAL_GFX_BLOP_STENCIL_XY   (0x00400000U)
 
#define HAL_GFX_BLOP_NO_USE_ROPBL   (0x01000000U)
 
#define HAL_GFX_BLOP_DST_CKEY_NEG   (0x02000000U)
 
#define HAL_GFX_BLOP_SRC_PREMULT   (0x04000000U)
 
#define HAL_GFX_BLOP_MODULATE_A   (0x08000000U)
 
#define HAL_GFX_BLOP_FORCE_A   (0x10000000U)
 
#define HAL_GFX_BLOP_MODULATE_RGB   (0x20000000U)
 
#define HAL_GFX_BLOP_SRC_CKEY   (0x40000000U)
 
#define HAL_GFX_BLOP_DST_CKEY   (0x80000000U)
 
#define HAL_GFX_BLOP_MASK   (0xffc00000U)
 

Functions

static uint32_t hal_gfx_blending_mode (uint32_t src_bf, uint32_t dst_bf, uint32_t blops)
 Return blending mode given source and destination blending factors and additional blending operations. More...
 
void hal_gfx_set_blend (uint32_t blending_mode, hal_gfx_tex_t dst_tex, hal_gfx_tex_t fg_tex, hal_gfx_tex_t bg_tex)
 Set blending mode. More...
 
static void hal_gfx_set_blend_fill (uint32_t blending_mode)
 Set blending mode for filling. More...
 
static void hal_gfx_set_blend_fill_compose (uint32_t blending_mode)
 Set blending mode for filling with composing. More...
 
static void hal_gfx_set_blend_blit (uint32_t blending_mode)
 Set blending mode for blitting. More...
 
static void hal_gfx_set_blend_blit_compose (uint32_t blending_mode)
 Set blending mode for blitting with composing. More...
 
void hal_gfx_set_const_color (uint32_t rgba)
 Set constant color. More...
 
void hal_gfx_set_src_color_key (uint32_t rgba)
 Set source color key. More...
 
void hal_gfx_set_dst_color_key (uint32_t rgba)
 Set destination color key. More...
 
void hal_gfx_debug_overdraws (uint32_t enable)
 Enable/disable ovedraw debugging. Disables gradient and texture, forces blending mode to HAL_GFX_BL_ADD. More...