mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 04:22:38 +01: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
11 lines
400 B
Rust
11 lines
400 B
Rust
//! DICOM compatibility facade; implementation and detection live in craft-image-codecs.
|
|
use crate::{CodecError, Image, Limits, bridge};
|
|
use craft_image_codecs::Format;
|
|
|
|
pub fn is_dicom(bytes: &[u8]) -> bool {
|
|
craft_image_codecs::detect(bytes) == Some(Format::Dicom)
|
|
}
|
|
pub fn decode(bytes: &[u8], limits: &Limits) -> Result<Image, CodecError> {
|
|
bridge::format(Format::Dicom, bytes, limits)
|
|
}
|