feat: Add gif support (#1183)

* feat: Add gif support

* fix: compiling errors

* fix remove bg image
This commit is contained in:
Xiaoxia
2025-09-11 03:53:12 +08:00
committed by GitHub
parent 4048647ef8
commit 57c2c64047
34 changed files with 1690 additions and 327 deletions

View File

@@ -17,6 +17,11 @@ LvglRawImage::LvglRawImage(void* data, size_t size) {
image_dsc_.data = static_cast<uint8_t*>(data);
}
bool LvglRawImage::IsGif() const {
auto ptr = (const uint8_t*)image_dsc_.data;
return ptr[0] == 'G' && ptr[1] == 'I' && ptr[2] == 'F';
}
LvglCBinImage::LvglCBinImage(void* data) {
image_dsc_ = cbin_img_dsc_create(static_cast<uint8_t*>(data));
}
@@ -25,4 +30,4 @@ LvglCBinImage::~LvglCBinImage() {
if (image_dsc_ != nullptr) {
cbin_img_dsc_delete(image_dsc_);
}
}
}