feat(lcd): support draw bitmap hook function

Closes https://github.com/espressif/esp-idf/issues/16201
This commit is contained in:
Chen Jichang
2025-10-16 18:39:26 +08:00
parent c231e0e777
commit 20bb7a2977
20 changed files with 678 additions and 80 deletions

View File

@@ -58,6 +58,31 @@ esp_err_t esp_lcd_panel_del(esp_lcd_panel_handle_t panel);
*/
esp_err_t esp_lcd_panel_draw_bitmap(esp_lcd_panel_handle_t panel, int x_start, int y_start, int x_end, int y_end, const void *color_data);
/**
* @brief Draw partial source bitmap on LCD panel
*
* This function allows drawing a portion of a source bitmap to a specific area on the LCD panel.
*
* @param[in] panel LCD panel handle, which is created by other factory API like `esp_lcd_new_panel_st7789()`
* @param[in] x_start Start pixel index in the target frame buffer, on x-axis (x_start is included)
* @param[in] y_start Start pixel index in the target frame buffer, on y-axis (y_start is included)
* @param[in] x_end End pixel index in the target frame buffer, on x-axis (x_end is not included)
* @param[in] y_end End pixel index in the target frame buffer, on y-axis (y_end is not included)
* @param[in] color_data Source bitmap data
* @param[in] src_x_size Size of the source bitmap in the x-axis
* @param[in] src_y_size Size of the source bitmap in the y-axis
* @param[in] src_x_start Start pixel index in the source bitmap, on x-axis (src_x_start is included)
* @param[in] src_y_start Start pixel index in the source bitmap, on y-axis (src_y_start is included)
* @param[in] src_x_end End pixel index in the source bitmap, on x-axis (src_x_end is not included)
* @param[in] src_y_end End pixel index in the source bitmap, on y-axis (src_y_end is not included)
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if parameters are invalid
* - ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
*/
esp_err_t esp_lcd_panel_draw_bitmap_2d(esp_lcd_panel_handle_t panel, int x_start, int y_start, int x_end, int y_end, const void *color_data,
size_t src_x_size, size_t src_y_size, int src_x_start, int src_y_start, int src_x_end, int src_y_end);
/**
* @brief Mirror the LCD panel on specific axis
*