Decoder

Trait Decoder 

Source
pub trait Decoder {
    // Required methods
    fn decode(&self, texture: &Texture2D) -> Result<RgbaImage>;
    fn can_decode(&self, format: TextureFormat) -> bool;
    fn supported_formats(&self) -> Vec<TextureFormat>;
}
Expand description

Common decoder trait

This trait defines the interface that all specialized decoders must implement.

Required Methods§

Source

fn decode(&self, texture: &Texture2D) -> Result<RgbaImage>

Decode texture data to RGBA image

Source

fn can_decode(&self, format: TextureFormat) -> bool

Check if this decoder can handle the given format

Source

fn supported_formats(&self) -> Vec<TextureFormat>

Get list of formats supported by this decoder

Implementors§