35 #ifndef _GDI_INCLUDE_H_ 36 #define _GDI_INCLUDE_H_ 298 #define GDI_COLOR_FORMAT_1 0 299 #define GDI_COLOR_FORMAT_8 1 300 #define GDI_COLOR_FORMAT_16 2 301 #define GDI_COLOR_FORMAT_24 3 302 #define GDI_COLOR_FORMAT_32 4 304 #define GDI_SUCCEED (0) 305 #define GDI_FAILED (-1) 316 typedef uint32_t gdi_color_t; 317 typedef uint8_t gdi_color_format_t; 318 typedef int32_t gdi_result_t; int32_t gdi_result_t
Define the GDI result type returned from the APIs.
Definition: gdi.h:318
void gdi_init(uint32_t width, uint32_t height, gdi_color_format_t color_format, uint8_t *buffer)
This function initializes the GDI.
void gdi_draw_circle(int32_t x, int32_t y, int32_t radius, gdi_color_t color)
This function draws a circle on the screen.
gdi_result_t gdi_image_draw_resized_by_id(int32_t x, int32_t y, uint32_t width, uint32_t height, uint16_t image_id)
This function draws an image from a resource with specified dimensions.
void gdi_draw_filled_polygon(gdi_point_t point[], uint32_t point_num, gdi_color_t color)
This function draws a solid polygon on current screen.
gdi_result_t gdi_image_get_dimension_by_id(uint16_t image_id, uint32_t *width, uint32_t *height)
This function gets the image dimension by the image resource ID.
void gdi_draw_rectangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, gdi_color_t color)
This function draws a rectangle on the screen.
void gdi_get_argb_from_color(uint8_t *alpha, uint8_t *red, uint8_t *green, uint8_t *blue, gdi_color_t color)
This function extracts alpha, red, green, blue from the given color, the value range of the component...
int16_t y
The y position of the point.
Definition: gdi.h:325
uint32_t gdi_color_t
Define the GDI color type.
Definition: gdi.h:316
int16_t x
The x position of the point.
Definition: gdi.h:324
gdi_result_t gdi_lcd_update_screen(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)
This function updates the LCD screen.
void gdi_draw_filled_rectangle(int32_t x1, int32_t y1, int32_t x2, int32_t y2, gdi_color_t color)
This function draws a solid rectangle on the screen.
void gdi_draw_filled_circle(int32_t x, int32_t y, int32_t radius, gdi_color_t color)
This function draws a solid circle on the screen.
uint8_t gdi_color_format_t
Define the GDI color format type.
Definition: gdi.h:317
Point type.
Definition: gdi.h:323
gdi_result_t gdi_image_draw_by_id(int32_t x, int32_t y, uint16_t image_id)
This function draws an image from a resource with original image dimension.
void gdi_draw_polygon(gdi_point_t point[], uint32_t point_num, gdi_color_t color)
This function draws a polygon on current screen.
void gdi_draw_line(int32_t x1, int32_t y1, int32_t x2, int32_t y2, gdi_color_t color)
This function draws a line on the screen.
void gdi_draw_point(int32_t x, int32_t y, gdi_color_t color)
This function draws a point on the screen.
gdi_color_t gdi_get_color_from_argb(uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue)
This function generates a color from given alpha, red, green, blue.