Revert to LVGL 9.0.0 (#64)
* Revert "Update ESP LCD Touch dependencies (#63)" This reverts commitcbd0355cec. * Revert "Updated board configs for LVGL changes (#62)" This reverts commit52d769854f. * Revert "Various updates (#60)" This reverts commita8a664703b.
This commit is contained in:
committed by
GitHub
parent
cbd0355cec
commit
62d30e8b7b
@@ -3,39 +3,36 @@
|
||||
#include "save_bmp.h"
|
||||
#include "save_png.h"
|
||||
|
||||
static void data_pre_processing(lv_draw_buf_t* snapshot, uint16_t bpp, lv_100ask_screenshot_sv_t screenshot_sv);
|
||||
static void data_pre_processing(lv_image_dsc_t* snapshot, uint16_t bpp, lv_100ask_screenshot_sv_t screenshot_sv);
|
||||
|
||||
bool lv_screenshot_create(lv_obj_t* obj, lv_color_format_t cf, lv_100ask_screenshot_sv_t screenshot_sv, const char* filename) {
|
||||
lv_draw_buf_t* snapshot = lv_snapshot_take(obj, cf);
|
||||
int32_t width = lv_obj_get_width(obj);
|
||||
int32_t height = lv_obj_get_height(obj);
|
||||
lv_image_dsc_t* snapshot = lv_snapshot_take(obj, cf);
|
||||
|
||||
if (snapshot) {
|
||||
data_pre_processing(snapshot, LV_COLOR_DEPTH, screenshot_sv);
|
||||
|
||||
if (screenshot_sv == LV_100ASK_SCREENSHOT_SV_PNG) {
|
||||
if (LV_COLOR_DEPTH == 16) {
|
||||
lv_screenshot_save_png_file(snapshot->data, width, height, 24, filename);
|
||||
lv_screenshot_save_png_file(snapshot->data, snapshot->header.w, snapshot->header.h, 24, filename);
|
||||
} else if (LV_COLOR_DEPTH == 32) {
|
||||
lv_screenshot_save_png_file(snapshot->data, width, height, 32, filename);
|
||||
lv_screenshot_save_png_file(snapshot->data, snapshot->header.w, snapshot->header.h, 32, filename);
|
||||
}
|
||||
} else if (screenshot_sv == LV_100ASK_SCREENSHOT_SV_BMP) {
|
||||
if (LV_COLOR_DEPTH == 16) {
|
||||
lve_screenshot_save_bmp_file(snapshot->data, width, height, 24, filename);
|
||||
lve_screenshot_save_bmp_file(snapshot->data, snapshot->header.w, snapshot->header.h, 24, filename);
|
||||
} else if (LV_COLOR_DEPTH == 32) {
|
||||
lve_screenshot_save_bmp_file(snapshot->data, width, height, 32, filename);
|
||||
lve_screenshot_save_bmp_file(snapshot->data, snapshot->header.w, snapshot->header.h, 32, filename);
|
||||
}
|
||||
}
|
||||
|
||||
lv_snapshot_free(snapshot);
|
||||
return true;
|
||||
}
|
||||
|
||||
lv_draw_buf_destroy(snapshot);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void data_pre_processing(lv_draw_buf_t* snapshot, uint16_t bpp, lv_100ask_screenshot_sv_t screenshot_sv) {
|
||||
static void data_pre_processing(lv_image_dsc_t* snapshot, uint16_t bpp, lv_100ask_screenshot_sv_t screenshot_sv) {
|
||||
if (bpp == 16) {
|
||||
uint16_t rgb565_data = 0;
|
||||
uint32_t count = 0;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "lvgl.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "save_bmp.h"
|
||||
#include <string.h> // for memset()
|
||||
|
||||
typedef struct tagBITMAPFILEHEADER {
|
||||
uint16_t bfType;
|
||||
|
||||
Reference in New Issue
Block a user