Skip to main content

TileDecoder

Trait TileDecoder 

Source
pub trait TileDecoder: Send + Sync {
    // Required method
    fn decode(&self, bytes: &[u8]) -> Result<DecodedImage, TileError>;
}
Expand description

Decodes raw HTTP response bytes into a DecodedImage.

Implementations bridge the engine to an image decoding library (e.g. the image crate, stb_image, browser canvas, etc.) without adding a hard dependency to rustial-engine.

Required Methods§

Source

fn decode(&self, bytes: &[u8]) -> Result<DecodedImage, TileError>

Decode raw bytes (PNG, JPEG, WebP, etc.) into RGBA8 pixel data.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§