hal_gfx_blender.h File Reference

Header file containing functions prototypes of Graphics library. More...

#include "hal_gfx_sys_defs.h"
#include "hal_gfx_graphics.h"
+ Include dependency graph for hal_gfx_blender.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HAL_GFX_BF_ZERO   (0x0U)
 0 More...
 
#define HAL_GFX_BF_ONE   (0x1U)
 1 More...
 
#define HAL_GFX_BF_SRCCOLOR   (0x2U)
 Sc. More...
 
#define HAL_GFX_BF_INVSRCCOLOR   (0x3U)
 (1-Sc) More...
 
#define HAL_GFX_BF_SRCALPHA   (0x4U)
 Sa. More...
 
#define HAL_GFX_BF_INVSRCALPHA   (0x5U)
 (1-Sa) More...
 
#define HAL_GFX_BF_DESTALPHA   (0x6U)
 Da. More...
 
#define HAL_GFX_BF_INVDESTALPHA   (0x7U)
 (1-Da) More...
 
#define HAL_GFX_BF_DESTCOLOR   (0x8U)
 Dc. More...
 
#define HAL_GFX_BF_INVDESTCOLOR   (0x9U)
 (1-Dc) More...
 
#define HAL_GFX_BF_CONSTCOLOR   (0xaU)
 Cc. More...
 
#define HAL_GFX_BF_CONSTALPHA   (0xbU)
 Ca. More...
 
#define HAL_GFX_BL_SIMPLE   ( (uint32_t)HAL_GFX_BF_SRCALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 Sa * Sa + Da * (1 - Sa) More...
 
#define HAL_GFX_BL_CLEAR   ( (uint32_t)HAL_GFX_BF_ZERO /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 0 More...
 
#define HAL_GFX_BL_SRC   ( (uint32_t)HAL_GFX_BF_ONE /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 Sa. More...
 
#define HAL_GFX_BL_SRC_OVER   ( (uint32_t)HAL_GFX_BF_ONE | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 Sa + Da * (1 - Sa) More...
 
#define HAL_GFX_BL_DST_OVER   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_ONE <<8) )
 Sa * (1 - Da) + Da. More...
 
#define HAL_GFX_BL_SRC_IN   ( (uint32_t)HAL_GFX_BF_DESTALPHA /*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/)
 Sa * Da. More...
 
#define HAL_GFX_BL_DST_IN   (/*(uint32_t)HAL_GFX_BF_ZERO |*/ ((uint32_t)HAL_GFX_BF_SRCALPHA <<8) )
 Da * Sa. More...
 
#define HAL_GFX_BL_SRC_OUT   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA/*| ((uint32_t)HAL_GFX_BF_ZERO <<8)*/ )
 Sa * (1 - Da) More...
 
#define HAL_GFX_BL_DST_OUT   (/*(uint32_t)HAL_GFX_BF_ZERO |*/ ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 Da * (1 - Sa) More...
 
#define HAL_GFX_BL_SRC_ATOP   ( (uint32_t)HAL_GFX_BF_DESTALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 Sa * Da + Da * (1 - Sa) More...
 
#define HAL_GFX_BL_DST_ATOP   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_SRCALPHA <<8) )
 Sa * (1 - Da) + Da * Sa. More...
 
#define HAL_GFX_BL_ADD   ( (uint32_t)HAL_GFX_BF_ONE | ((uint32_t)HAL_GFX_BF_ONE <<8) )
 Sa + Da. More...
 
#define HAL_GFX_BL_XOR   ( (uint32_t)HAL_GFX_BF_INVDESTALPHA | ((uint32_t)HAL_GFX_BF_INVSRCALPHA <<8) )
 Sa * (1 - Da) + Da * (1 - Sa) More...
 
#define HAL_GFX_BLOP_NONE   (0U)
 No extra blending operation. More...
 
#define HAL_GFX_BLOP_STENCIL_TXTY   (0x00800000U)
 Use TEX3 as mask. More...
 
#define HAL_GFX_BLOP_STENCIL_XY   (0x00400000U)
 Use TEX3 as mask. More...
 
#define HAL_GFX_BLOP_NO_USE_ROPBL   (0x01000000U)
 Don't use Rop Blender even if present. More...
 
#define HAL_GFX_BLOP_DST_CKEY_NEG   (0x02000000U)
 Apply Inverse Destination Color Keying - draw only when dst color doesn't match colorkey. More...
 
#define HAL_GFX_BLOP_SRC_PREMULT   (0x04000000U)
 Premultiply Source Color with Source Alpha (cannot be used with HAL_GFX_BLOP_MODULATE_RGB) More...
 
#define HAL_GFX_BLOP_MODULATE_A   (0x08000000U)
 Modulate by Constant Alpha value. More...
 
#define HAL_GFX_BLOP_FORCE_A   (0x10000000U)
 Force Constant Alpha value. More...
 
#define HAL_GFX_BLOP_MODULATE_RGB   (0x20000000U)
 Modulate by Constant Color (RGB) values. More...
 
#define HAL_GFX_BLOP_SRC_CKEY   (0x40000000U)
 Apply Source Color Keying - draw only when src color doesn't match colorkey. More...
 
#define HAL_GFX_BLOP_DST_CKEY   (0x80000000U)
 Apply Destination Color Keying - draw only when dst color matches colorkey. More...
 
#define HAL_GFX_BLOP_MASK   (0xffc00000U)
 blending operation mask More...
 

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. More...
 

Detailed Description

Header file containing functions prototypes of Graphics library.

Author
BLE Driver Team
Attention
Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hal_gfx_blender.h.