#include "hal_gfx_sys_defs.h"
Go to the source code of this file.
Macros | |
#define | HAL_GFX_RGBX8888 (0x00U) |
#define | HAL_GFX_RGBA8888 (0x01U) |
#define | HAL_GFX_XRGB8888 (0x02U) |
#define | HAL_GFX_ARGB8888 (0x03U) |
#define | HAL_GFX_RGB565 (0x04U) |
#define | HAL_GFX_RGBA5650 (0x04U) |
#define | HAL_GFX_RGBA5551 (0x05U) |
#define | HAL_GFX_RGBA4444 (0x06U) |
#define | HAL_GFX_RGBA0800 (0x07U) |
#define | HAL_GFX_A8 (0x08U) |
#define | HAL_GFX_RGBA0008 (0x08U) |
#define | HAL_GFX_L8 (0x09U) |
#define | HAL_GFX_RGBA3320 (0x38U) |
#define | HAL_GFX_RGB332 (0x38U) |
#define | HAL_GFX_BW1 (0x0CU) |
#define | HAL_GFX_A1 (0x0CU) |
#define | HAL_GFX_L1 (0x0BU) |
#define | HAL_GFX_UYVY (0x0DU) |
#define | HAL_GFX_ABGR8888 (0x0EU) |
#define | HAL_GFX_BGRA8888 (0x10U) |
#define | HAL_GFX_BGRX8888 (0x11U) |
#define | HAL_GFX_TSC4 (0x12U) |
#define | HAL_GFX_TSC6 (0x16U) |
#define | HAL_GFX_TSC6A (0x17U) |
#define | HAL_GFX_RV (0x18U) |
#define | HAL_GFX_GU (0x19U) |
#define | HAL_GFX_BY (0x1AU) |
#define | HAL_GFX_YUV (0x1BU) |
#define | HAL_GFX_Z24_8 (0x1cU) |
#define | HAL_GFX_Z16 (0x1dU) |
#define | HAL_GFX_UV (0x1eU) |
#define | HAL_GFX_A1LE (0x27U) |
#define | HAL_GFX_A2LE (0x28U) |
#define | HAL_GFX_A4LE (0x29U) |
#define | HAL_GFX_L1LE (0x2AU) |
#define | HAL_GFX_L2LE (0x2BU) |
#define | HAL_GFX_L4LE (0x2CU) |
#define | HAL_GFX_A2 (0x30U) |
#define | HAL_GFX_A4 (0x34U) |
#define | HAL_GFX_L2 (0x31U) |
#define | HAL_GFX_L4 (0x35U) |
#define | HAL_GFX_BGR24 (0x39U) |
#define | HAL_GFX_RGB24 (0x3CU) |
#define | HAL_GFX_RV10 (0x3DU) |
#define | HAL_GFX_GU10 (0x3EU) |
#define | HAL_GFX_BY10 (0x3FU) |
#define | HAL_GFX_DITHER (0x80U) |
#define | HAL_GFX_FORMAT_MASK (0x7FU) |
#define | HAL_GFX_FILTER_PS (0x00U) |
#define | HAL_GFX_FILTER_BL (0x01U) |
#define | HAL_GFX_TEX_CLAMP (0x00U<<2) |
#define | HAL_GFX_TEX_REPEAT (0x01U<<2) |
#define | HAL_GFX_TEX_BORDER (0x02U<<2) |
#define | HAL_GFX_TEX_MIRROR (0x03U<<2) |
#define | HAL_GFX_TEX_MORTON_ORDER (0x10U) |
#define | HAL_GFX_TEX_RANGE_0_1 (0x1U<<5) |
#define | HAL_GFX_TEX_LEFT_HANDED (0x1U<<6) |
#define | HAL_GFX_ROT_000_CCW (0x0U) |
#define | HAL_GFX_ROT_090_CCW (0x1U) |
#define | HAL_GFX_ROT_180_CCW (0x2U) |
#define | HAL_GFX_ROT_270_CCW (0x3U) |
#define | HAL_GFX_ROT_000_CW (0x0U) |
#define | HAL_GFX_ROT_270_CW (0x1U) |
#define | HAL_GFX_ROT_180_CW (0x2U) |
#define | HAL_GFX_ROT_090_CW (0x3U) |
#define | HAL_GFX_MIR_VERT (0x4U) |
#define | HAL_GFX_MIR_HOR (0x8U) |
Typedefs | |
typedef uint8_t | hal_gfx_tex_mode_t |
typedef uint32_t | hal_gfx_tex_format_t |
Enumerations | |
enum | hal_gfx_tex_t { HAL_GFX_NOTEX = -1, HAL_GFX_TEX0 = 0, HAL_GFX_TEX1 = 1, HAL_GFX_TEX2 = 2, HAL_GFX_TEX3 = 3 } |
Graphics Texture. More... | |
enum | hal_gfx_tri_cull_t { HAL_GFX_CULL_NONE = 0, HAL_GFX_CULL_CW = (1U<<28), HAL_GFX_CULL_CCW = (1U<<29), HAL_GFX_CULL_ALL = HAL_GFX_CULL_CW | HAL_GFX_CULL_CCW } |
Graphics Triangle Culling methond. More... | |
Functions | |
int | hal_gfx_checkGPUPresence (void) |
Check if a known GPU is present. More... | |
void | hal_gfx_bind_tex (hal_gfx_tex_t texid, uintptr_t addr_gpu, uint32_t width, uint32_t height, hal_gfx_tex_format_t format, int32_t stride, hal_gfx_tex_mode_t wrap_mode) |
Program a Texture Unit. More... | |
void | hal_gfx_set_tex_color (uint32_t color) |
Set Texture Mapping default color. More... | |
void | hal_gfx_set_const_reg (int reg, uint32_t value) |
Write a value to a Constant Register of the GPU. More... | |
void | hal_gfx_set_clip (int32_t x, int32_t y, uint32_t w, uint32_t h) |
Sets the drawing area's Clipping Rectangle. More... | |
void | hal_gfx_get_clip (int32_t *x, int32_t *y, uint32_t *w, uint32_t *h) |
Gets the drawing area's Clipping Rectangle. More... | |
void | hal_gfx_enable_gradient (int enable) |
Enable color gradient. More... | |
void | hal_gfx_enable_depth (int enable) |
Enable depth. More... | |
uint32_t | hal_gfx_enable_aa (uint8_t e0, uint8_t e1, uint8_t e2, uint8_t e3) |
Enables MSAA per edge. More... | |
void | hal_gfx_get_dirty_region (int *minx, int *miny, int *maxx, int *maxy) |
Returns the bounding rectangle of all the pixels that have been modified since its previous call. More... | |
void | hal_gfx_clear_dirty_region (void) |
Clear dirty region information - runs via the bound command-list, hal_gfx_get_dirty_region(), hal_gfx_clear_dirty_region() More... | |
void | hal_gfx_clear_dirty_region_imm (void) |
Clear dirty region information immediately, no command-list involved, hal_gfx_get_dirty_region(), hal_gfx_clear_dirty_region_imm() More... | |
void | hal_gfx_tri_cull (hal_gfx_tri_cull_t cull) |
Set triangle/quadrilateral culling mode. More... | |
int | hal_gfx_format_size (hal_gfx_tex_format_t format) |
Return pixel size in bytes. More... | |
int | hal_gfx_stride_size (hal_gfx_tex_format_t format, hal_gfx_tex_mode_t wrap_mode, int width) |
Return stride in bytes. More... | |
int | hal_gfx_texture_size (hal_gfx_tex_format_t format, hal_gfx_tex_mode_t wrap_mode, int width, int height) |
Return texture size in bytes. More... | |
uint32_t | hal_gfx_rgba (unsigned char R, unsigned char G, unsigned char B, unsigned char A) |
Return Nema internal RGBA color. More... | |
uint32_t | hal_gfx_premultiply_rgba (uint32_t rgba) |
Premultiply RGB channels with Alpha channel. More... | |
int | hal_gfx_init (void) |
Initialize hal_gfx library. More... | |
void | hal_gfx_bind_src_tex (uintptr_t baseaddr_phys, uint32_t width, uint32_t height, hal_gfx_tex_format_t format, int32_t stride, hal_gfx_tex_mode_t mode) |
Program Texture Unit with a foreground (source) texture (HAL_GFX_TEX1) More... | |
void | hal_gfx_bind_src2_tex (uintptr_t baseaddr_phys, uint32_t width, uint32_t height, hal_gfx_tex_format_t format, int32_t stride, hal_gfx_tex_mode_t mode) |
Program Texture Unit with a background texture (HAL_GFX_TEX2) More... | |
void | hal_gfx_bind_dst_tex (uintptr_t baseaddr_phys, uint32_t width, uint32_t height, hal_gfx_tex_format_t format, int32_t stride) |
Program Texture Unit with a destination texture (HAL_GFX_TEX0) More... | |
void | hal_gfx_bind_depth_buffer (uintptr_t baseaddr_phys, uint32_t width, uint32_t height) |
Bind Depth Buffer. More... | |
void | hal_gfx_clear (uint32_t rgba8888) |
Clear destination texture with color. More... | |
void | hal_gfx_clear_depth (uint32_t val) |
Clear depth buffer with specified value. More... | |
void | hal_gfx_draw_line (int x0, int y0, int x1, int y1, uint32_t rgba8888) |
Draw a colored line, hal_gfx_rgba() More... | |
void | hal_gfx_draw_line_aa (float x0, float y0, float x1, float y1, float w, uint32_t rgba8888) |
Draw a line with width. Apply AA if available, hal_gfx_rgba(), hal_gfx_draw_line() More... | |
void | hal_gfx_draw_circle (int x, int y, int r, uint32_t rgba8888) |
Draw a colored circle with 1 pixel width, hal_gfx_rgba() More... | |
void | hal_gfx_draw_circle_aa (float x, float y, float r, float w, uint32_t rgba8888) |
Draw a colored circle with Anti-Aliasing (if available) and specified width, hal_gfx_rgba() More... | |
void | hal_gfx_draw_rounded_rect (int x0, int y0, int w, int h, int r, uint32_t rgba8888) |
Draw a colored rectangle with rounded edges, hal_gfx_rgba() More... | |
void | hal_gfx_draw_rect (int x, int y, int w, int h, uint32_t rgba8888) |
Draw a colored rectangle, hal_gfx_rgba() More... | |
void | hal_gfx_fill_circle (int x, int y, int r, uint32_t rgba8888) |
Fill a circle with color, hal_gfx_rgba() More... | |
void | hal_gfx_fill_circle_aa (float x, float y, float r, uint32_t rgba8888) |
Fill a circle with color, use Anti-Aliasing if available, hal_gfx_rgba() More... | |
void | hal_gfx_fill_triangle (int x0, int y0, int x1, int y1, int x2, int y2, uint32_t rgba8888) |
Fill a triangle with color. More... | |
void | hal_gfx_fill_rounded_rect (int x0, int y0, int w, int h, int r, uint32_t rgba8888) |
Fill a rectangle with rounded edges with color. More... | |
void | hal_gfx_fill_rect (int x, int y, int w, int h, uint32_t rgba8888) |
Fill a rectangle with color. More... | |
void | hal_gfx_fill_quad (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, uint32_t rgba8888) |
Fill a quadrilateral with color. More... | |
void | hal_gfx_fill_rect_f (float x, float y, float w, float h, uint32_t rgba8888) |
Fill a rectangle with color (float coordinates) More... | |
void | hal_gfx_fill_quad_f (float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3, uint32_t rgba8888) |
Fill a quadrilateral with color (float coordinates) More... | |
void | hal_gfx_fill_triangle_f (float x0, float y0, float x1, float y1, float x2, float y2, uint32_t rgba8888) |
Fill a triangle with color (float coordinates) More... | |
void | hal_gfx_blit (int x, int y) |
Blit source texture to destination texture. More... | |
void | hal_gfx_blit_rounded (int x, int y, int r) |
Blit source texture to destination texture with rounded corners. More... | |
void | hal_gfx_blit_rect (int x, int y, int w, int h) |
Blit source texture to destination's specified rectangle (crop or wrap when needed) More... | |
void | hal_gfx_blit_subrect (int dst_x, int dst_y, int w, int h, int src_x, int src_y) |
Blit part of a source texture to destination's specified rectangle (crop or wrap when needed) More... | |
void | hal_gfx_blit_rect_fit (int x, int y, int w, int h) |
Blit source texture to destination. Fit (scale) texture to specified rectangle. More... | |
void | hal_gfx_blit_subrect_fit (int dst_x, int dst_y, int dst_w, int dst_h, int src_x, int src_y, int src_w, int src_h) |
Blit part of source texture to destination. Fit (scale) texture to specified rectangle. More... | |
void | hal_gfx_blit_rotate_pivot (float cx, float cy, float px, float py, float degrees_cw) |
Rotate around pivot point and Blit source texture. More... | |
void | hal_gfx_blit_rotate_pivot_scale (float cx, float cy, float px, float py, float degrees_cw, float scale) |
Rotate around pivot point and Blit source texture. More... | |
void | hal_gfx_blit_rotate (int x, int y, uint32_t rotation) |
Rotate and Blit source texture to destination. More... | |
void | hal_gfx_blit_rotate_partial (int sx, int sy, int sw, int sh, int x, int y, uint32_t rotation) |
Rotate and Blit partial source texture to destination. More... | |
void | hal_gfx_blit_tri_fit (float dx0, float dy0, int v0, float dx1, float dy1, int v1, float dx2, float dy2, int v2) |
Blit source texture to destination. Fit texture to specified triangle. More... | |
void | hal_gfx_blit_tri_uv (float dx0, float dy0, float dw0, float dx1, float dy1, float dw1, float dx2, float dy2, float dw2, float sx0, float sy0, float sx1, float sy1, float sx2, float sy2) |
Blit a triangular part of the source tecture to a triangular destination area. More... | |
void | hal_gfx_blit_quad_fit (float dx0, float dy0, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3) |
Blit source texture to destination. Fit texture to specified quadrilateral. More... | |
void | hal_gfx_blit_subrect_quad_fit (float dx0, float dy0, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3, int sx, int sy, int sw, int sh) |
Blit source texture to destination. Fit rectangulare area of texture to specified quadrilateral. More... | |
void | hal_gfx_set_depth (float start, float dx, float dy) |
private function More... | |
void | hal_gfx_set_gradient (float r_init, float g_init, float b_init, float a_init, float r_dx, float r_dy, float g_dx, float g_dy, float b_dx, float b_dy, float a_dx, float a_dy) |
private function More... | |
void | hal_gfx_brk_enable (void) |
Enable breakpoints. More... | |
void | hal_gfx_brk_disable (void) |
Disable breakpoints. More... | |
int | hal_gfx_brk_add (void) |
Add a breakpoint to the current Command List. More... | |
int | hal_gfx_brk_wait (int brk_id) |
Add a breakpoint to the current Command List. More... | |
void | hal_gfx_brk_continue (void) |
Instruct the GPU to resume execution. More... | |
void | hal_gfx_ext_hold_enable (uint32_t hold_id) |
Enable external hold signals. More... | |
void | hal_gfx_ext_hold_disable (uint32_t hold_id) |
Disable external hold signals. More... | |
void | hal_gfx_ext_hold_irq_enable (uint32_t hold_id) |
Enable Interrupt Request when GPU reaches hold point. More... | |
void | hal_gfx_ext_hold_irq_disable (uint32_t hold_id) |
Disable external hold signals. More... | |
void | hal_gfx_ext_hold_assert (uint32_t hold_id, int stop) |
Assert hold signals internally via a Command List. More... | |
void | hal_gfx_ext_hold_deassert (uint32_t hold_id) |
Dessert hold signals internally via a Command List. More... | |
void | hal_gfx_ext_hold_assert_imm (uint32_t hold_id) |
Assert hold signals from the CPU (no Command List) More... | |
void | hal_gfx_ext_hold_deassert_imm (uint32_t hold_id) |
Dessert hold signals from the CPU (no Command List) More... | |