feat(imaging): add pure-Rust Skia backend (#112)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//! Optional Skia imaging adapter corresponding to `LibreMetaverse.Imaging.Skia`.
|
||||
//!
|
||||
//! Enable `skia` for bounded `BMP`, `GIF`, `ICO`, `JPEG`, `PNG`, `WBMP`, and
|
||||
//! `WebP` decoding.
|
||||
//! Enable `skia` or the fully native-Rust `rust-skia` alternative for bounded
|
||||
//! `BMP`, `GIF`, `ICO`, `JPEG`, `PNG`, `WBMP`, and `WebP` decoding.
|
||||
//! The default build remains inert. See the crate README for native cache,
|
||||
//! source-build, licensing, and cross-platform prerequisite details.
|
||||
|
||||
@@ -15,6 +15,7 @@ mod skia_codec;
|
||||
pub use generated::*;
|
||||
pub use libremetaverse_imaging as imaging;
|
||||
pub use libremetaverse_types::Error;
|
||||
pub use skia_codec::RustSkiaTextureCodec;
|
||||
|
||||
impl libremetaverse_imaging::ITextureCodec for SkiaTextureCodec {
|
||||
fn decode(
|
||||
@@ -24,3 +25,12 @@ impl libremetaverse_imaging::ITextureCodec for SkiaTextureCodec {
|
||||
Self::decode(self, stream)
|
||||
}
|
||||
}
|
||||
|
||||
impl libremetaverse_imaging::ITextureCodec for RustSkiaTextureCodec {
|
||||
fn decode(
|
||||
&self,
|
||||
stream: Box<dyn libremetaverse_types::compat::ReadWrite + Send>,
|
||||
) -> Result<libremetaverse_imaging::ManagedImage, Error> {
|
||||
Self::decode(self, stream)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user