pub struct DecodedImage {
pub width: u32,
pub height: u32,
pub components: u8,
pub samples: Vec<u8>,
pub component_depths: Vec<u8>,
pub color: ColorKind,
pub icc_profile: Option<Vec<u8>>,
pub alpha_index: Option<u8>,
pub warnings: Vec<JpxWarning>,
}Expand description
A fully decoded image.
Fields§
§width: u32Image-region width: Xsiz - XOsiz after the canvas crop (T.800 B-1).
height: u32Image-region height: Ysiz - YOsiz.
components: u8Channel count after palette and component transforms, including any alpha channel.
samples: Vec<u8>Interleaved samples, 8-bit normalized, row-major,
width * height * components bytes.
component_depths: Vec<u8>Per output channel (parallel to the samples interleaving, alpha
included): the bit depth of the channel’s source BEFORE the 8-bit
normalization — the component’s Ssiz depth (T.800 Table A.11) for
direct channels, the palette column’s depth (Table I.13) for
palette-mapped ones. The machine-readable contract for reversing
the normalization, e.g. recovering palette indices for a PDF
Indexed colorspace (ISO 32000 7.4.9). Length equals components.
color: ColorKindColour interpretation of the colour channels.
icc_profile: Option<Vec<u8>>The embedded ICC profile, byte for byte, when the colr box carried
one (T.800 I.5.3.3 METH 2, always paired with
ColorKind::IccGuess). This crate ships the bytes without
interpreting them; a consumer applying the profile supersedes the
component-count guess.
alpha_index: Option<u8>Channel index of the opacity channel, when the JP2 cdef box defines one (T.800 I.5.3.6, association 0 with type 1 or 2).
warnings: Vec<JpxWarning>Soft failures encountered after headers parsed (leniency
doctrine); each one is classified by JpxWarning::data_loss.
Trait Implementations§
Source§impl Clone for DecodedImage
impl Clone for DecodedImage
Source§fn clone(&self) -> DecodedImage
fn clone(&self) -> DecodedImage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more