Skip to main content

RawDecoder

Trait RawDecoder 

Source
pub trait RawDecoder: Send + Sync {
    // Required methods
    fn format(&self) -> RawFormat;
    fn metadata(&self) -> &RawMetadata;
    fn frame_info(&self) -> &FrameInfo;
    fn decode(&self, ctx: &DecodeContext<'_>) -> Result<RawImage>;

    // Provided methods
    fn random_access(&self) -> RandomAccess { ... }
    fn units(&self) -> Vec<DecodeUnit> { ... }
    fn decode_region(
        &self,
        ctx: &DecodeContext<'_>,
        region: Rect,
    ) -> Result<RawImage> { ... }
    fn packed_payload(&self) -> Option<PackedPayload<'_>> { ... }
}
Expand description

A parsed RAW file ready for decoding.

Required Methods§

Source

fn format(&self) -> RawFormat

Container format.

Source

fn metadata(&self) -> &RawMetadata

Normalised metadata.

Source

fn frame_info(&self) -> &FrameInfo

Geometry and calibration of the sensor buffer.

Source

fn decode(&self, ctx: &DecodeContext<'_>) -> Result<RawImage>

Decode the full sensor buffer.

Provided Methods§

Source

fn random_access(&self) -> RandomAccess

How the payload can be randomly accessed.

Source

fn units(&self) -> Vec<DecodeUnit>

Independently decodable units (tiles/strips), if any.

Source

fn decode_region( &self, ctx: &DecodeContext<'_>, region: Rect, ) -> Result<RawImage>

Decode only region (buffer coordinates). Formats with random access override this to avoid decoding unrelated data; the default decodes everything and crops.

Source

fn packed_payload(&self) -> Option<PackedPayload<'_>>

The payload as a uniformly packed bit stream, when the format stores it that way.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§