mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 07:44:40 +00:00
* Share small raster format implementations (cherry picked from commit7aedc1de73) * Preserve raster facade encode contracts (cherry picked from commit2db7c82705) * Allow alpha in IFF compatibility encoder (cherry picked from commit80b55dee5a) * Test shared raster facade contracts and refresh lockfile
14 lines
509 B
Rust
14 lines
509 B
Rust
//! PCX compatibility facade; implementation and header probing live in craft-image-codecs.
|
|
use crate::{CodecError, Image, Limits, bridge};
|
|
use craft_image_codecs::Format;
|
|
|
|
pub fn looks_like_pcx(bytes: &[u8]) -> bool {
|
|
craft_image_codecs::detect(bytes) == Some(Format::Pcx)
|
|
}
|
|
pub fn dimensions(bytes: &[u8]) -> Option<(u32, u32)> {
|
|
craft_image_codecs::pcx_dimensions(bytes)
|
|
}
|
|
pub fn decode(bytes: &[u8], limits: &Limits) -> Result<Image, CodecError> {
|
|
bridge::format(Format::Pcx, bytes, limits)
|
|
}
|