Add API to Rust sixtyfps::Image to enable creation from user supplied image buffers

This adds an ImageBuffer and PixelBuffer type for SharedVector
backed images. The documentation explains how to use this
with low-level rendering functions and the popular image crate.

Fixes #387
This commit is contained in:
Simon Hausmann 2021-08-05 14:16:25 +02:00 committed by Simon Hausmann
parent 76de53cead
commit 8a3a68a4fa
11 changed files with 349 additions and 56 deletions

View file

@ -255,7 +255,7 @@ fn to_js_value<'cx>(
&ImageInner::AbsoluteFilePath(ref path) => {
JsString::new(cx, path.as_str()).as_value(cx)
}
&ImageInner::EmbeddedData { .. } | &ImageInner::EmbeddedRgbaImage { .. } => {
&ImageInner::EmbeddedData { .. } | &ImageInner::EmbeddedImage { .. } => {
JsNull::new().as_value(cx)
} // TODO: maybe pass around node buffers?
},