forked from xiaozhi/xiaozhi-esp32
feat: Add gif support (#1183)
* feat: Add gif support * fix: compiling errors * fix remove bg image
This commit is contained in:
@@ -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_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user