Skip to main content

Compressor

Trait Compressor 

Source
pub trait Compressor: Send + Sync {
    // Required methods
    fn compress(
        &self,
        input: &CompressInput<'_>,
    ) -> Result<CompressOutput, CompressError>;
    fn format_id(&self) -> &'static str;
    fn file_extension(&self) -> &'static str;
}
Expand description

Common interface for all image compression backends.

Required Methods§

Source

fn compress( &self, input: &CompressInput<'_>, ) -> Result<CompressOutput, CompressError>

Encode the atlas image and return the file bytes.

Source

fn format_id(&self) -> &'static str

Short identifier matching OutputConfig::texture_format (e.g. "png").

Source

fn file_extension(&self) -> &'static str

File extension for the texture output, without leading dot (e.g. "png").

Implementors§