Skip to main content

DecodedImage

Struct DecodedImage 

Source
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: u32

Image-region width: Xsiz - XOsiz after the canvas crop (T.800 B-1).

§height: u32

Image-region height: Ysiz - YOsiz.

§components: u8

Channel 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: ColorKind

Colour 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

Source§

fn clone(&self) -> DecodedImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DecodedImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.