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_bind_depth_buffer | ( | uintptr_t | baseaddr_phys, |
uint32_t | width, | ||
uint32_t | height | ||
) |
Bind Depth Buffer.
[in] | baseaddr_phys | Address of the depth buffer, as seen by the GPU |
[in] | width | Buffer width |
[in] | height | Buffer hight |
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)
[in] | baseaddr_phys | Address of the destination texture, as seen by the GPU |
[in] | width | Texture width |
[in] | height | Texture hight |
[in] | format | Texture format |
[in] | stride | Texture stride. If negative, it's calculated internally |
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)
[in] | baseaddr_phys | Address of the source2 texture, as seen by the GPU |
[in] | width | Texture width |
[in] | height | Texture hight |
[in] | format | Texture format |
[in] | stride | Texture stride. If negative, it's calculated internally |
[in] | mode | Wrapping and Filtering mode |
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)
[in] | baseaddr_phys | Address of the source texture, as seen by the GPU |
[in] | width | Texture width |
[in] | height | Texture hight |
[in] | format | Texture format |
[in] | stride | Texture stride. If negative, it's calculated internally |
[in] | mode | Wrapping and Filtering mode |
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.
[in] | texid | Texture unit to be programmed |
[in] | addr_gpu | Texture's address as seen by the GPU |
[in] | width | Texture's width |
[in] | height | Texture's height |
[in] | format | Texture's format |
[in] | stride | Texture's stride. If stride < 0, it's left to be calculated |
[in] | wrap_mode | Wrap/Repeat mode to be used |
void hal_gfx_blit | ( | int | x, |
int | y | ||
) |
Blit source texture to destination texture.
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
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.
[in] | dx0 | x coordinate at the first vertex of the quadrilateral |
[in] | dy0 | y coordinate at the first vertex of the quadrilateral |
[in] | dx1 | x coordinate at the second vertex of the quadrilateral |
[in] | dy1 | y coordinate at the second vertex of the quadrilateral |
[in] | dx2 | x coordinate at the third vertex of the quadrilateral |
[in] | dy2 | y coordinate at the third vertex of the quadrilateral |
[in] | dx3 | x coordinate at the fourth vertex of the quadrilateral |
[in] | dy3 | y coordinate at the fourth vertex of the quadrilateral |
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)
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
[in] | w | destination width |
[in] | h | destination height |
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.
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
[in] | w | destination width |
[in] | h | destination height |
void hal_gfx_blit_rotate | ( | int | x, |
int | y, | ||
uint32_t | rotation | ||
) |
Rotate and Blit source texture to destination.
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
[in] | rotation | Rotation to be done |
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.
[in] | sx | source upper left x coordinate |
[in] | sy | source upper left y coordinate |
[in] | sw | source width of partial region |
[in] | sh | source height of partial region |
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
[in] | rotation | Rotation to be done |
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.
[in] | cx | destination rotation center x coordinate |
[in] | cy | destination rotation center y coordinate |
[in] | px | source pivot point x coordinate |
[in] | py | source pivot point y coordinate |
[in] | degrees_cw | degrees of clockwise rotation in range [0, 360] |
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.
[in] | cx | destination rotation center x coordinate |
[in] | cy | destination rotation center y coordinate |
[in] | px | source pivot point x coordinate |
[in] | py | source pivot point y coordinate |
[in] | degrees_cw | degrees of clockwise rotation in range [0, 360] |
[in] | scale | the ratio of zoom in / zoom out, > 1.0 zoom out, < 1.0 zoom in |
void hal_gfx_blit_rounded | ( | int | x, |
int | y, | ||
int | r | ||
) |
Blit source texture to destination texture with rounded corners.
[in] | x | destination x coordinate |
[in] | y | destination y coordinate |
[in] | r | destination corner radius |
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)
[in] | dst_x | destination x coordinate |
[in] | dst_y | destination y coordinate |
[in] | w | destination width |
[in] | h | destination height |
[in] | src_x | source x coordinate |
[in] | src_y | source y coordinate |
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.
[in] | dst_x | destination x coordinate |
[in] | dst_y | destination y coordinate |
[in] | dst_w | destination width |
[in] | dst_h | destination height |
[in] | src_x | source x coordinate |
[in] | src_y | source y coordinate |
[in] | src_w | source width |
[in] | src_h | source height |
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.
[in] | dx0 | x coordinate at the first vertex of the quadrilateral |
[in] | dy0 | y coordinate at the first vertex of the quadrilateral |
[in] | dx1 | x coordinate at the second vertex of the quadrilateral |
[in] | dy1 | y coordinate at the second vertex of the quadrilateral |
[in] | dx2 | x coordinate at the third vertex of the quadrilateral |
[in] | dy2 | y coordinate at the third vertex of the quadrilateral |
[in] | dx3 | x coordinate at the fourth vertex of the quadrilateral |
[in] | dy3 | y coordinate at the fourth vertex of the quadrilateral |
[in] | sx | x coordinate of the top left corner of the texture's rectangular area to be blitted |
[in] | sy | y coordinate of the top left corner of the texture's rectangular area to be blitted |
[in] | sw | width of the texture's rectangular area to be blitted |
[in] | sh | height of the texture's rectangular area to be blitted |
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.
[in] | dx0 | x coordinate at the first vertex of the triangle |
[in] | dy0 | y coordinate at the first vertex of the triangle |
[in] | v0 | in [0, 3] indicates the corner of the texture that fits to the first vertex of the triangle 0 _ _ 1 |_ _| 3 2 |
[in] | dx1 | x coordinate at the second vertex of the triangle |
[in] | dy1 | y coordinate at the second vertex of the triangle |
[in] | v1 | in [0, 3] indicates the corner of the texture that fits to the second vertex of the triangle |
[in] | dx2 | x coordinate at the third vertex of the triangle |
[in] | dy2 | y coordinate at the third vertex of the triangle |
[in] | v2 | in [0, 3] indicates the corner of the texture that fits to the third vertex of the triangle |
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.
[in] | dx0 | x coordinate at the first vertex of the destination triangle |
[in] | dy0 | y coordinate at the first vertex of the destination triangle |
[in] | dw0 | w coordinate at the first vertex of the destination triangle |
[in] | dx1 | x coordinate at the second vertex of the destination triangle |
[in] | dy1 | y coordinate at the second vertex of the destination triangle |
[in] | dw1 | w coordinate at the second vertex of the destination triangle |
[in] | dx2 | x coordinate at the third vertex of the destination triangle |
[in] | dy2 | y coordinate at the third vertex of the destination triangle |
[in] | dw2 | w coordinate at the third vertex of the destination triangle |
[in] | sx0 | x coordinate at the first vertex of the source triangle |
[in] | sy0 | y coordinate at the first vertex of the source triangle |
[in] | sx1 | x coordinate at the second vertex of the source triangle |
[in] | sy1 | y coordinate at the second vertex of the source triangle |
[in] | sx2 | x coordinate at the third vertex of the source triangle |
[in] | sy2 | y coordinate at the third vertex of the source triangle |
int hal_gfx_checkGPUPresence | ( | void | ) |
Check if a known GPU is present.
void hal_gfx_clear | ( | uint32_t | rgba8888 | ) |
Clear destination texture with color.
[in] | rgba8888 | 32-bit RGBA color |
void hal_gfx_clear_depth | ( | uint32_t | val | ) |
Clear depth buffer with specified value.
[in] | val | Clear value |
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()
None |
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()
None |
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()
[in] | x | x coordinate of the circle's center |
[in] | y | y coordinate of the circle's center |
[in] | r | circle's radius |
[in] | rgba8888 | Color to be used |
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()
[in] | x | x coordinate of the circle's center |
[in] | y | y coordinate of the circle's center |
[in] | r | circle's radius |
[in] | w | pencil width |
[in] | rgba8888 | Color to be used |
void hal_gfx_draw_line | ( | int | x0, |
int | y0, | ||
int | x1, | ||
int | y1, | ||
uint32_t | rgba8888 | ||
) |
Draw a colored line, hal_gfx_rgba()
[in] | x0 | x coordinate at the beginning of the line |
[in] | y0 | y coordinate at the beginning of the line |
[in] | x1 | x coordinate at the end of the line |
[in] | y1 | y coordinate at the end of the line |
[in] | rgba8888 | Color to be used |
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()
[in] | x0 | x coordinate at the beginning of the line |
[in] | y0 | y coordinate at the beginning of the line |
[in] | x1 | x coordinate at the end of the line |
[in] | y1 | y coordinate at the end of the line |
[in] | w | line width |
[in] | rgba8888 | Color to be used |
void hal_gfx_draw_rect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
uint32_t | rgba8888 | ||
) |
Draw a colored rectangle, hal_gfx_rgba()
[in] | x | x coordinate of the upper left vertex of the rectangle |
[in] | y | y coordinate at the upper left vertex of the rectangle |
[in] | w | width of the rectangle |
[in] | h | height of the rectangle |
[in] | rgba8888 | Color to be used |
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()
[in] | x0 | x coordinate of the upper left vertex of the rectangle |
[in] | y0 | y coordinate at the upper left vertex of the rectangle |
[in] | w | width of the rectangle |
[in] | h | height of the rectangle |
[in] | r | corner radius |
[in] | rgba8888 | Color to be used |
uint32_t hal_gfx_enable_aa | ( | uint8_t | e0, |
uint8_t | e1, | ||
uint8_t | e2, | ||
uint8_t | e3 | ||
) |
Enables MSAA per edge.
[in] | e0 | Enable MSAA for edge 0 (vertices 0-1) |
[in] | e1 | Enable MSAA for edge 1 (vertices 1-2) |
[in] | e2 | Enable MSAA for edge 2 (vertices 2-3) |
[in] | e3 | Enable MSAA for edge 3 (vertices 3-0) |
void hal_gfx_enable_depth | ( | int | enable | ) |
Enable depth.
[in] | enable | !0 enable, 0 disable |
void hal_gfx_enable_gradient | ( | int | enable | ) |
Enable color gradient.
[in] | enable | !0 enable, 0 disable |
void hal_gfx_fill_circle | ( | int | x, |
int | y, | ||
int | r, | ||
uint32_t | rgba8888 | ||
) |
Fill a circle with color, hal_gfx_rgba()
[in] | x | x coordinate of the circle's center |
[in] | y | y coordinate of the circle's center |
[in] | r | circle's radius |
[in] | rgba8888 | Color to be used |
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()
[in] | x | x coordinate of the circle's center |
[in] | y | y coordinate of the circle's center |
[in] | r | circle's radius |
[in] | rgba8888 | Color to be used |
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.
[in] | x0 | x coordinate at the first vertex of the quadrilateral |
[in] | y0 | y coordinate at the first vertex of the quadrilateral |
[in] | x1 | x coordinate at the second vertex of the quadrilateral |
[in] | y1 | y coordinate at the second vertex of the quadrilateral |
[in] | x2 | x coordinate at the third vertex of the quadrilateral |
[in] | y2 | y coordinate at the third vertex of the quadrilateral |
[in] | x3 | x coordinate at the fourth vertex of the quadrilateral |
[in] | y3 | y coordinate at the fourth vertex of the quadrilateral |
[in] | rgba8888 | Color to be used |
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)
[in] | x0 | x coordinate at the first vertex of the quadrilateral |
[in] | y0 | y coordinate at the first vertex of the quadrilateral |
[in] | x1 | x coordinate at the second vertex of the quadrilateral |
[in] | y1 | y coordinate at the second vertex of the quadrilateral |
[in] | x2 | x coordinate at the third vertex of the quadrilateral |
[in] | y2 | y coordinate at the third vertex of the quadrilateral |
[in] | x3 | x coordinate at the fourth vertex of the quadrilateral |
[in] | y3 | y coordinate at the fourth vertex of the quadrilateral |
[in] | rgba8888 | Color to be used |
void hal_gfx_fill_rect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h, | ||
uint32_t | rgba8888 | ||
) |
Fill a rectangle with color.
[in] | x | x coordinate of the upper left vertex of the rectangle |
[in] | y | y coordinate at the upper left vertex of the rectangle |
[in] | w | width of the rectangle |
[in] | h | height of the rectangle |
[in] | rgba8888 | Color to be used |
void hal_gfx_fill_rect_f | ( | float | x, |
float | y, | ||
float | w, | ||
float | h, | ||
uint32_t | rgba8888 | ||
) |
Fill a rectangle with color (float coordinates)
[in] | x | x coordinate of the upper left vertex of the rectangle |
[in] | y | y coordinate at the upper left vertex of the rectangle |
[in] | w | width of the rectangle |
[in] | h | height of the rectangle |
[in] | rgba8888 | Color to be used |
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.
[in] | x0 | x coordinate of the upper left vertex of the rectangle |
[in] | y0 | y coordinate at the upper left vertex of the rectangle |
[in] | w | width of the rectangle |
[in] | h | height of the rectangle |
[in] | r | corner radius |
[in] | rgba8888 | Color to be used |
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.
[in] | x0 | x coordinate at the first vertex of the triangle |
[in] | y0 | y coordinate at the first vertex of the triangle |
[in] | x1 | x coordinate at the second vertex of the triangle |
[in] | y1 | y coordinate at the second vertex of the triangle |
[in] | x2 | x coordinate at the third vertex of the triangle |
[in] | y2 | y coordinate at the third vertex of the triangle |
[in] | rgba8888 | Color to be used |
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)
[in] | x0 | x coordinate at the first vertex of the triangle |
[in] | y0 | y coordinate at the first vertex of the triangle |
[in] | x1 | x coordinate at the second vertex of the triangle |
[in] | y1 | y coordinate at the second vertex of the triangle |
[in] | x2 | x coordinate at the third vertex of the triangle |
[in] | y2 | y coordinate at the third vertex of the triangle |
[in] | rgba8888 | Color to be used |
int hal_gfx_format_size | ( | hal_gfx_tex_format_t | format | ) |
Return pixel size in bytes.
[in] | format | Color format |
void hal_gfx_get_clip | ( | int32_t * | x, |
int32_t * | y, | ||
uint32_t * | w, | ||
uint32_t * | h | ||
) |
Gets the drawing area's Clipping Rectangle.
[in] | x | pointer to Clip Window top-left x coordinate |
[in] | y | pointer to Clip Window minimum y |
[in] | w | pointer to Clip Window width |
[in] | h | pointer to Clip Window height |
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.
[out] | minx | x coordinate of the upper left corner of the dirty region |
[out] | miny | y coordinate of the upper left corner of the dirty region |
[out] | maxx | x coordinate of the lower right corner of the dirty region |
[out] | maxy | y coordinate of the lower right corner of the dirty region |
int hal_gfx_init | ( | void | ) |
Initialize hal_gfx library.
uint32_t hal_gfx_premultiply_rgba | ( | uint32_t | rgba | ) |
Premultiply RGB channels with Alpha channel.
[in] | rgba | RGBA color |
uint32_t hal_gfx_rgba | ( | unsigned char | R, |
unsigned char | G, | ||
unsigned char | B, | ||
unsigned char | A | ||
) |
Return Nema internal RGBA color.
[in] | R | Red component |
[in] | G | Green component |
[in] | B | Blue component |
[in] | A | Alpha component |
void hal_gfx_set_clip | ( | int32_t | x, |
int32_t | y, | ||
uint32_t | w, | ||
uint32_t | h | ||
) |
Sets the drawing area's Clipping Rectangle.
[in] | x | Clip Window top-left x coordinate |
[in] | y | Clip Window minimum y |
[in] | w | Clip Window width |
[in] | h | Clip Window height |
void hal_gfx_set_const_reg | ( | int | reg, |
uint32_t | value | ||
) |
Write a value to a Constant Register of the GPU.
[in] | reg | Constant Register to be written |
[in] | value | Value to be written |
void hal_gfx_set_tex_color | ( | uint32_t | color | ) |
Set Texture Mapping default color.
[in] | color | default color in 32-bit RGBA format, hal_gfx_rgba() |
int hal_gfx_stride_size | ( | hal_gfx_tex_format_t | format, |
hal_gfx_tex_mode_t | wrap_mode, | ||
int | width | ||
) |
Return stride in bytes.
[in] | format | Color format |
[in] | wrap_mode | Wrap/Repeat mode to be used |
[in] | width | Texture color format |
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.
[in] | format | Texture color format |
[in] | wrap_mode | Wrap/Repeat mode to be used |
[in] | width | Texture width |
[in] | height | Texture height |
void hal_gfx_tri_cull | ( | hal_gfx_tri_cull_t | cull | ) |
Set triangle/quadrilateral culling mode.
[in] | cull | Culling mode, hal_gfx_tri_cull_t |