mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-30 23:27:22 +00:00
preprocess the images at compile time
For the MCU port, we need to proccess the image to save them in the binary in a convenient format. This patch start this work by trying to anaylyze what format should an image be using, and saving it as a texture in the binary. The current graphical backend and the C++ frontend are not yet supported
This commit is contained in:
parent
d539d4be79
commit
d1cae710df
21 changed files with 452 additions and 65 deletions
|
@ -70,7 +70,7 @@ impl sixtyfps_corelib::backend::Backend for TestingBackend {
|
|||
|
||||
fn image_size(&'static self, image: &Image) -> Size {
|
||||
let inner: &ImageInner = image.into();
|
||||
match &inner {
|
||||
match inner {
|
||||
ImageInner::None => Default::default(),
|
||||
ImageInner::EmbeddedImage(buffer) => {
|
||||
Size::new(buffer.width() as _, buffer.height() as _)
|
||||
|
@ -91,6 +91,7 @@ impl sixtyfps_corelib::backend::Backend for TestingBackend {
|
|||
Size::new(dim.0 as _, dim.1 as _)
|
||||
})
|
||||
.unwrap_or_default(),
|
||||
ImageInner::StaticTextures { size, .. } => size.cast(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue