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:
Olivier Goffart 2021-11-12 17:00:57 +01:00 committed by Olivier Goffart
parent d539d4be79
commit d1cae710df
21 changed files with 452 additions and 65 deletions

View file

@ -257,9 +257,9 @@ fn to_js_value<'cx>(
&ImageInner::AbsoluteFilePath(ref path) => {
JsString::new(cx, path.as_str()).as_value(cx)
}
&ImageInner::EmbeddedData { .. } | &ImageInner::EmbeddedImage { .. } => {
JsNull::new().as_value(cx)
} // TODO: maybe pass around node buffers?
&ImageInner::EmbeddedData { .. }
| &ImageInner::EmbeddedImage { .. }
| &ImageInner::StaticTextures { .. } => JsNull::new().as_value(cx), // TODO: maybe pass around node buffers?
},
Value::Array(a) => {
let js_array = JsArray::new(cx, a.len() as _);