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§
Sourcefn metadata(&self) -> &RawMetadata
fn metadata(&self) -> &RawMetadata
Normalised metadata.
Sourcefn frame_info(&self) -> &FrameInfo
fn frame_info(&self) -> &FrameInfo
Geometry and calibration of the sensor buffer.
Sourcefn decode(&self, ctx: &DecodeContext<'_>) -> Result<RawImage>
fn decode(&self, ctx: &DecodeContext<'_>) -> Result<RawImage>
Decode the full sensor buffer.
Provided Methods§
Sourcefn random_access(&self) -> RandomAccess
fn random_access(&self) -> RandomAccess
How the payload can be randomly accessed.
Sourcefn units(&self) -> Vec<DecodeUnit>
fn units(&self) -> Vec<DecodeUnit>
Independently decodable units (tiles/strips), if any.
Sourcefn decode_region(
&self,
ctx: &DecodeContext<'_>,
region: Rect,
) -> Result<RawImage>
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.
Sourcefn packed_payload(&self) -> Option<PackedPayload<'_>>
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".