38 #include "hal_platform.h" 40 #ifdef HAL_G2D_MODULE_ENABLED 141 HAL_G2D_STATUS_HW_ERROR = -6,
142 HAL_G2D_STATUS_NOT_SUPPORTEDED_COLOR_FORMAT = -5,
143 HAL_G2D_STATUS_INVALID_PARAMETER = -4,
144 HAL_G2D_STATUS_NOT_SUPPORTED = -3,
145 HAL_G2D_STATUS_BUSY = 0,
146 HAL_G2D_STATUS_OK = 1
151 HAL_G2D_CODEC_TYPE_HW = 0
152 } hal_g2d_codec_type_t;
156 HAL_G2D_GET_HANDLE_MODE_BLOCKING = 0,
157 HAL_G2D_GET_HANDLE_MODE_NON_BLOCKING
158 } hal_g2d_get_handle_mode_t;
162 HAL_G2D_COLOR_FORMAT_RGB565 = 0,
163 HAL_G2D_COLOR_FORMAT_RGB888,
164 HAL_G2D_COLOR_FORMAT_BGR888,
165 HAL_G2D_COLOR_FORMAT_ARGB8565,
166 HAL_G2D_COLOR_FORMAT_ARGB6666,
167 HAL_G2D_COLOR_FORMAT_ARGB8888,
168 HAL_G2D_COLOR_FORMAT_PARGB8565,
169 HAL_G2D_COLOR_FORMAT_PARGB6666,
170 HAL_G2D_COLOR_FORMAT_PARGB8888,
171 HAL_G2D_COLOR_FORMAT_UYVY
172 } hal_g2d_color_format_t;
176 HAL_G2D_SUPPORTED_FUNCTION_BITBLT = 0,
177 HAL_G2D_SUPPORTED_FUNCTION_RECTFILL,
178 HAL_G2D_SUPPORTED_FUNCTION_FONT,
179 HAL_G2D_SUPPORTED_FUNCTION_OVERLAY,
180 HAL_G2D_SUPPORTED_FUNCTION_DITHERING
181 } hal_g2d_supported_function_t;
185 HAL_G2D_OVERLAY_LAYER0 = 0,
186 HAL_G2D_OVERLAY_LAYER1 = 1,
187 HAL_G2D_OVERLAY_LAYER2 = 2,
188 HAL_G2D_OVERLAY_LAYER3 = 3
189 } hal_g2d_overlay_layer_t;
193 HAL_G2D_OVERLAY_LAYER_FUNCTION_FONT = 0,
194 HAL_G2D_OVERLAY_LAYER_FUNCTION_RECTFILL,
195 HAL_G2D_OVERLAY_LAYER_FUNCTION_BUFFER
196 } hal_g2d_overlay_layer_function_t;
200 HAL_G2D_ROTATE_ANGLE_0 = 0,
201 HAL_G2D_ROTATE_ANGLE_90,
202 HAL_G2D_ROTATE_ANGLE_180,
203 HAL_G2D_ROTATE_ANGLE_270,
204 HAL_G2D_ROTATE_ANGLE_MIRROR_0,
205 HAL_G2D_ROTATE_ANGLE_MIRROR_90,
206 HAL_G2D_ROTATE_ANGLE_MIRROR_180,
207 HAL_G2D_ROTATE_ANGLE_MIRROR_270
208 } hal_g2d_rotate_angle_t;
212 HAL_G2D_FONT_FORMAT_1_BIT = 0,
213 HAL_G2D_FONT_FORMAT_2_BIT,
214 HAL_G2D_FONT_FORMAT_4_BIT,
215 HAL_G2D_FONT_FORMAT_8_BIT
216 } hal_g2d_font_format_t;
220 HAL_G2D_DITHERING_MODE_DISABLE = 0,
221 HAL_G2D_DITHERING_MODE_RANDOM,
222 HAL_G2D_DITHERING_MODE_FIXED_PATTERN
223 } hal_g2d_dithering_mode_t;
238 typedef struct hal_g2d_hanele_struct_t hal_g2d_handle_t;
257 typedef bool (*hal_g2d_callback_t)(
void *);
271 hal_g2d_status_t hal_g2d_init(
void);
281 hal_g2d_status_t hal_g2d_get_handle(hal_g2d_handle_t **handle_ptr, hal_g2d_codec_type_t codec_type, hal_g2d_get_handle_mode_t handle_mode);
289 hal_g2d_status_t hal_g2d_release_handle(hal_g2d_handle_t *handle);
300 hal_g2d_status_t hal_g2d_query_rgb_buffer_range(hal_g2d_handle_t *handle,
301 uint32_t *min_width, uint32_t *max_width, uint32_t *min_height, uint32_t *max_height);
309 hal_g2d_status_t hal_g2d_register_callback(hal_g2d_handle_t *handle, hal_g2d_callback_t callback);
321 hal_g2d_status_t hal_g2d_set_clipping_window(hal_g2d_handle_t *handle, int32_t x, int32_t y, int32_t width, int32_t height);
336 hal_g2d_status_t hal_g2d_replace_color(hal_g2d_handle_t *handle,
337 uint8_t alpha0, uint8_t red0, uint8_t green0, uint8_t blue0, uint8_t alpha1, uint8_t red1, uint8_t green1, uint8_t blue1);
349 hal_g2d_status_t hal_g2d_set_source_key(hal_g2d_handle_t *handle, uint8_t alpha, uint8_t red, uint8_t green, uint8_t blue);
363 hal_g2d_status_t hal_set_rgb_buffer(hal_g2d_handle_t *handle,
364 uint8_t *buffer, uint32_t size, uint32_t width, uint32_t height, hal_g2d_color_format_t color_format);
377 hal_g2d_status_t hal_g2d_set_rgb_buffer(hal_g2d_handle_t *handle,
378 uint8_t *buffer, uint32_t size, uint32_t width, uint32_t height, hal_g2d_color_format_t color_format);
386 hal_g2d_status_t hal_g2d_get_status(hal_g2d_handle_t *handle);
395 hal_g2d_status_t hal_g2d_query_support(hal_g2d_codec_type_t codec_type, hal_g2d_supported_function_t function_type);
404 hal_g2d_status_t hal_g2d_overlay_enable_layer(hal_g2d_handle_t *handle, hal_g2d_overlay_layer_t layer,
bool show_layer);
413 hal_g2d_status_t hal_g2d_overlay_set_layer_function(hal_g2d_handle_t *handle,
414 hal_g2d_overlay_layer_t layer, hal_g2d_overlay_layer_function_t
function);
423 hal_g2d_status_t hal_g2d_overlay_set_layer_rectfill_color(hal_g2d_handle_t *handle,
424 hal_g2d_overlay_layer_t layer, uint32_t rectfill_color);
435 hal_g2d_status_t hal_g2d_overlay_set_layer_buffer(hal_g2d_handle_t *handle,
436 hal_g2d_overlay_layer_t layer, uint8_t *buffer, uint32_t size);
450 hal_g2d_status_t hal_g2d_overlay_set_layer_rgb_buffer(hal_g2d_handle_t *handle,
451 hal_g2d_overlay_layer_t layer, uint8_t *buffer, uint32_t size,
452 uint32_t width, uint32_t height, hal_g2d_color_format_t color_format);
467 hal_g2d_status_t hal_g2d_overlay_set_layer_yuv_buffer(hal_g2d_handle_t *handle,
468 hal_g2d_overlay_layer_t layer, uint8_t *buffer[3], uint32_t size[3],
469 uint32_t width, uint32_t height, hal_g2d_color_format_t color_format);
482 hal_g2d_status_t hal_g2d_overlay_set_layer_window(hal_g2d_handle_t *handle,
483 hal_g2d_overlay_layer_t layer, int32_t x, int32_t y, uint32_t width, uint32_t height);
492 hal_g2d_status_t hal_g2d_overlay_set_layer_source_key(hal_g2d_handle_t *handle,
493 hal_g2d_overlay_layer_t layer, uint32_t src_key_value);
502 hal_g2d_status_t hal_g2d_overlay_set_layer_rotation(hal_g2d_handle_t *handle,
503 hal_g2d_overlay_layer_t layer, hal_g2d_rotate_angle_t rotation);
512 hal_g2d_status_t hal_g2d_overlay_set_layer_alpha(hal_g2d_handle_t *handle,
513 hal_g2d_overlay_layer_t layer, uint32_t alpha_value);
521 hal_g2d_status_t hal_g2d_overlay_set_background_color(hal_g2d_handle_t *handle, uint32_t bg_color);
529 hal_g2d_status_t hal_g2d_overlay_set_alpha(hal_g2d_handle_t *handle, uint32_t alpha_value);
538 hal_g2d_status_t hal_g2d_overlay_set_window(hal_g2d_handle_t *handle, int32_t x, int32_t y);
550 hal_g2d_status_t hal_g2d_overlay_set_roi_window(hal_g2d_handle_t *handle, int32_t x, int32_t y, uint32_t width, uint32_t height);
558 hal_g2d_status_t hal_g2d_overlay_start(hal_g2d_handle_t *handle);
570 hal_g2d_status_t hal_g2d_set_dithering(hal_g2d_handle_t *handle, hal_g2d_dithering_mode_t mode, uint8_t red_bit, uint8_t green_bit, uint8_t blue_bit);
580 hal_g2d_status_t hal_g2d_overlay_set_layer_font_format(hal_g2d_handle_t *handle, hal_g2d_overlay_layer_t layer, hal_g2d_font_format_t format);
590 hal_g2d_status_t hal_g2d_overlay_set_layer_font_color(hal_g2d_handle_t *handle, hal_g2d_overlay_layer_t layer, uint32_t color);
603 hal_g2d_status_t hal_g2d_rectfill_set_destination_window(hal_g2d_handle_t *handle, int32_t x, int32_t y, int32_t width, int32_t height);
612 hal_g2d_status_t hal_g2d_rectfill_set_color(hal_g2d_handle_t *handle, uint32_t color);
628 hal_g2d_status_t hal_g2d_rectangle_fill_query_window_range(hal_g2d_handle_t *handle,
629 int32_t *min_x, int32_t *max_x, int32_t *min_y, int32_t *max_y,
630 uint32_t *min_width, uint32_t *max_width, uint32_t *min_height, uint32_t *max_height);
639 hal_g2d_status_t hal_g2d_rectfill_start(hal_g2d_handle_t *handle);