//! Optional Skia imaging adapter corresponding to `LibreMetaverse.Imaging.Skia`.
//!
//! The default `rust-skia` backend provides bounded pure-Rust `BMP`, `GIF`,
//! `ICO`, `JPEG`, `PNG`, `WBMP`, and `WebP` decoding. Enable the optional
//! `skia` feature when native Google Skia is specifically required. See the
//! crate README for native cache, source-build, licensing, and deployment details.

extern crate self as libremetaverse_imaging_skia;

pub mod backend;

mod generated;
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(
        &self,
        stream: Box<dyn libremetaverse_types::compat::ReadWrite + Send>,
    ) -> Result<libremetaverse_imaging::ManagedImage, Error> {
        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)
    }
}
