Macros | Typedefs | Enumerations | Functions
hal_gfx_graphics.h File Reference

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

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

Go to the source code of this file.

## Macros
#define | HAL_GFX_RGBX8888 (0x00U)
| RGBX8888. More...
#define | HAL_GFX_RGBA8888 (0x01U)
| RGBA8888. More...
#define | HAL_GFX_XRGB8888 (0x02U)
| XRGB8888. More...
#define | HAL_GFX_ARGB8888 (0x03U)
| ARGB8888. More...
#define | HAL_GFX_RGB565 (0x04U)
| RGBA5650. More...
#define | HAL_GFX_RGBA5650 (0x04U)
| RGBA5650. More...
#define | HAL_GFX_RGBA5551 (0x05U)
| RGBA5551. More...
#define | HAL_GFX_RGBA4444 (0x06U)
| RGBA4444. More...
#define | HAL_GFX_RGBA0800 (0x07U)
| RGBA0800. More...
#define | HAL_GFX_A8 (0x08U)
| RGBA0008. More...
#define | HAL_GFX_RGBA0008 (0x08U)
| RGBA0008. More...
#define | HAL_GFX_L8 (0x09U)
| L8 More...
#define | HAL_GFX_RGBA3320 (0x38U)
| RGBA3320 (source only) More...
#define | HAL_GFX_RGB332 (0x38U)
| RGBA3320 (source only) More...
#define | HAL_GFX_BW1 (0x0CU)
| A1 (source only) More...
#define | HAL_GFX_A1 (0x0CU)
| A1 (source only) More...
#define | HAL_GFX_L1 (0x0BU)
| L1 (source only) More...
#define | HAL_GFX_UYVY (0x0DU)
| UYVY More...
#define | HAL_GFX_ABGR8888 (0x0EU)
| ABGR8888. More...
#define | HAL_GFX_BGRA8888 (0x10U)
| BGRA More...
#define | HAL_GFX_BGRX8888 (0x11U)
| BGRX More...
#define | HAL_GFX_TSC4 (0x12U)
| TSC4 More...
#define | HAL_GFX_TSC6 (0x16U)
| TSC6 More...
#define | HAL_GFX_TSC6A (0x17U)
| TSC6A More...
#define | HAL_GFX_RV (0x18U)
| RV More...
#define | HAL_GFX_GU (0x19U)
| GU More...
#define | HAL_GFX_BY (0x1AU)
| BY More...
#define | HAL_GFX_YUV (0x1BU)
| YUV More...
#define | HAL_GFX_Z24_8 (0x1cU)
| Z24_8 More...
#define | HAL_GFX_Z16 (0x1dU)
| Z16 More...
#define | HAL_GFX_UV (0x1eU)
| UV More...
#define | HAL_GFX_A1LE (0x27U)
| A1LE More...
#define | HAL_GFX_A2LE (0x28U)
| A2LE More...
#define | HAL_GFX_A4LE (0x29U)
| A4LE More...
#define | HAL_GFX_L1LE (0x2AU)
| L1LE More...
#define | HAL_GFX_L2LE (0x2BU)
| L2LE More...
#define | HAL_GFX_L4LE (0x2CU)
| L4LE More...
#define | HAL_GFX_A2 (0x30U)
| A2 More...
#define | HAL_GFX_A4 (0x34U)
| A4 More...
#define | HAL_GFX_L2 (0x31U)
| L2 More...
#define | HAL_GFX_L4 (0x35U)
| L4 More...
#define | HAL_GFX_BGR24 (0x39U)
| BGR24 More...
#define | HAL_GFX_RGB24 (0x3CU)
| RGB24 More...
#define | HAL_GFX_RV10 (0x3DU)
| RV-10bit. More...
#define | HAL_GFX_GU10 (0x3EU)
| GU-10bit. More...
#define | HAL_GFX_BY10 (0x3FU)
| BY-10bit. More...
#define | HAL_GFX_DITHER (0x80U)
| GPU Dithering. More...
#define | HAL_GFX_FORMAT_MASK (0x7FU)
| Format Mask. More...
#define | HAL_GFX_FILTER_PS (0x00U)
| Point Sampling. More...
#define | HAL_GFX_FILTER_BL (0x01U)
| Bilinear filtering. More...
#define | HAL_GFX_TEX_CLAMP (0x00U<<2)
| Clamp. More...
#define | HAL_GFX_TEX_REPEAT (0x01U<<2)
| Repeat. More...
#define | HAL_GFX_TEX_BORDER (0x02U<<2)
| Border. More...
#define | HAL_GFX_TEX_MIRROR (0x03U<<2)
| Mirror. More...
#define | HAL_GFX_TEX_MORTON_ORDER (0x10U)
| Order. More...
#define | HAL_GFX_TEX_RANGE_0_1 (0x1U<<5)
| Interpolated Coordinates range: 0-1. More...
#define | HAL_GFX_TEX_LEFT_HANDED (0x1U<<6)
| (0,0) is bottom left corner More...
#define | HAL_GFX_ROT_000_CCW (0x0U)
| No rotation. More...
#define | HAL_GFX_ROT_090_CCW (0x1U)
| Rotate 90 degrees counter-clockwise. More...
#define | HAL_GFX_ROT_180_CCW (0x2U)
| Rotate 180 degrees counter-clockwise. More...
#define | HAL_GFX_ROT_270_CCW (0x3U)
| Rotate 270 degrees counter-clockwise. More...
#define | HAL_GFX_ROT_000_CW (0x0U)
| No rotation. More...
#define | HAL_GFX_ROT_270_CW (0x1U)
| Rotate 270 degrees clockwise. More...
#define | HAL_GFX_ROT_180_CW (0x2U)
| Rotate 180 degrees clockwise. More...
#define | HAL_GFX_ROT_090_CW (0x3U)
| Rotate 90 degrees clockwise. More...
#define | HAL_GFX_MIR_VERT (0x4U)
| Mirror Vertically. More...
#define | HAL_GFX_MIR_HOR (0x8U)
| Mirror Horizontally. More...

## Typedefs
typedef uint8_t | hal_gfx_tex_mode_t
| The tex mode type. More...
typedef uint32_t | hal_gfx_tex_format_t
| The tex format type. More...

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

## 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_graphics.h.