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§
Sourcefn compress(
&self,
input: &CompressInput<'_>,
) -> Result<CompressOutput, CompressError>
fn compress( &self, input: &CompressInput<'_>, ) -> Result<CompressOutput, CompressError>
Encode the atlas image and return the file bytes.
Sourcefn format_id(&self) -> &'static str
fn format_id(&self) -> &'static str
Short identifier matching OutputConfig::texture_format (e.g. "png").
Sourcefn file_extension(&self) -> &'static str
fn file_extension(&self) -> &'static str
File extension for the texture output, without leading dot (e.g. "png").
Implementors§
impl Compressor for Dxt1Compressor
impl Compressor for Dxt5Compressor
impl Compressor for JpegCompressor
impl Compressor for LossyPngCompressor
Available on crate feature
png only.