Skip to main content

ReportEntry

Enum ReportEntry 

Source
#[non_exhaustive]
pub enum ReportEntry {
#[non_exhaustive]
MissingTiles { tiles: Range<u32>, },
#[non_exhaustive]
MissingPackets { tile: u32, complete_layers: u16, complete_reduction: Option<u8>, },
#[non_exhaustive]
TruncatedTilePart { tile: u32, tile_part: u8, declared: u64, present: u64, },
#[non_exhaustive]
TilePartCountMismatch { tile: u32, declared: u16, found: u16, },
#[non_exhaustive]
LeftoverBytes { tile: u32, tile_part: u8, bytes: u64, in_packed_headers: bool, },
#[non_exhaustive]
MissingEoc, }
Expand description

One thing a decode with strict off left out or skipped, on DecodeReport::entries.

The enum and each of its variants are #[non_exhaustive]: a later version can add variants and fields, so match with a _ arm and with { field, .. }, and MissingEoc as MissingEoc { .. }.

Tiles are numbered in raster order from 0, as the codestream’s Isot numbers them, and a tile’s tile-parts from 0, as its TPsot does.

The Display text is a diagnostic for a log, not a stable format: do not parse it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
MissingTiles

No tile-part of these tiles was found. Their samples are 0 in the output, after the DC level shift, as opj_decompress -allow-partial writes them: 0 for an unsigned component, not its mid-gray, and 0 for a signed one. A JP2 palette then maps them as any other index 0.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§tiles: Range<u32>

The tiles, a run of consecutive tile indices.

§

#[non_exhaustive]
MissingPackets

Packets of this tile that the decode keeps were never read: the data ended first, or the POC volumes leave them out. Under a region of a window or components, only the packets that hold a code-block the returned samples depend on count: those of the components reconstructed (with a color transform, all three of its components), and of the precincts that hold a code-block the window’s samples need. A missing packet adds nothing to its code-blocks, so they decode from the layers that were read, as a codestream truncated after those layers would.

A packet cut short keeps each code-block whose data is all there, and the rest of its code-blocks keep only their earlier layers. A packet whose header is cut adds nothing.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§tile: u32

The tile.

§complete_layers: u16

How many of the leading quality layers are whole, counted over the resolutions this decode keeps (under a window or components, over the packets the returned samples need), and no more than its max_quality_layers cap.

§complete_reduction: Option<u8>

The smallest reduction at which this tile has every packet, as DecodeReport::complete_reduction counts it, or None when even the coarsest resolution of this tile has a packet missing.

§

#[non_exhaustive]
TruncatedTilePart

The input ends inside this tile-part: its Psot declares more bytes than remain. The bytes that are there are read.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§tile: u32

The tile.

§tile_part: u8

The tile-part, as its TPsot numbers it.

§declared: u64

The tile-part’s length as its Psot declares it, from its SOT marker on.

§present: u64

The bytes of it the input holds.

§

#[non_exhaustive]
TilePartCountMismatch

The tile’s SOT markers declare a number of tile-parts (TNsot, after OpenJPEG’s TPsot == TNsot correction when that applies) other than the number found. The tile decodes from the parts found; any packets they lack are reported as MissingPackets.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§tile: u32

The tile.

§declared: u16

The count the markers declare.

§found: u16

The tile-parts found.

§

#[non_exhaustive]
LeftoverBytes

Bytes of this tile were not read: every packet the tile’s progression holds was read, and bytes were left after the last one.

The tile’s samples may be wrong: leftover bytes can mean the packets were misread. Two encoder bugs leave them in valid tiles. OpenJPEG’s encoder writes duplicate packets under overlapping progression changes, which decode right, and a phantom packet under -TP R or -TP C with empty resolutions, which does not. So the tile counts as incomplete at every reduction.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§tile: u32

The tile.

§tile_part: u8

The tile-part the leftover bytes start in.

§bytes: u64

How many bytes were left.

§in_packed_headers: bool

Whether the bytes are packet headers packed in PPT or PPM markers rather than tile data.

§

#[non_exhaustive]
MissingEoc

The codestream ends without its EOC marker. On its own this changes no sample.

Trait Implementations§

Source§

impl Clone for ReportEntry

Source§

fn clone(&self) -> Self

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 ReportEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for ReportEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ReportEntry

Source§

impl PartialEq for ReportEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReportEntry

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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, !>

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.