Skip to main content

Crate spatialrust_image_io

Crate spatialrust_image_io 

Source
Expand description

Bounded, feature-gated image decoding and encoding for SpatialRust.

All input is staged in CPU memory with an explicit compressed-input limit. This crate never uploads to or reads from a device. Codec dependencies are selected independently from the storage-only spatialrust-image crate.

use spatialrust_image_io::{decode_path, DecodeOptions, DecodedPixels};

let decoded = decode_path("frame.png", DecodeOptions::default())?;
match decoded.pixels() {
    DecodedPixels::Rgb8(image) => assert!(image.width() > 0),
    other => println!("decoded {other:?}"),
}

Structs§

DecodeLimits
Strict application-level resource limits for one decode operation.
DecodeOptions
Options controlling one decode operation.
DecodedImage
One decoded image with owned typed pixels and source metadata.
DecodedMetadata
Metadata describing encoded pixels and orientation handling.
EncodeOptions
Options controlling encoded output.

Enums§

DecodedPixels
Owned typed pixels produced by a decoder or accepted by an encoder.
ImageFileFormat
File formats recognized by the stable SpatialRust image-IO boundary.
ImageIoError
Errors produced by bounded image IO.
Orientation
Exif image orientation in encoded-pixel coordinates.
SourceColorType
Encoded sample/channel type before conversion into SpatialRust storage.

Functions§

decode_bytes
Decodes an image from an encoded byte slice.
decode_path
Opens and decodes one image path using content-based format detection.
decode_reader
Reads a bounded encoded stream and decodes it.
encode_bytes
Encodes typed pixels into an owned byte vector.
encode_path
Creates or truncates a path and encodes typed pixels into it.
encode_writer
Encodes typed pixels to a seekable writer.