#[non_exhaustive]pub struct Header {
pub width: u32,
pub height: u32,
pub components: Vec<ComponentInfo>,
pub max_reduction: u8,
pub quality_layers: u16,
pub image_area: Window,
pub tiles: TileGrid,
pub jp2: Option<Jp2Metadata>,
}Expand description
An image’s header: what decode would return, without
the samples.
The fields describe two things. width,
height, components and
jp2 describe the image a decode under the same options
returns, so under read_header_with they
follow the options: the reduction, window, tile, component subset,
raw_channels and
color.
image_area, tiles,
max_reduction and
quality_layers describe the file’s main header,
and are the same whatever the options.
The struct is #[non_exhaustive], so more of the header can be added
without a breaking change.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.width: u32The image area’s width, as Image::width: on
the reduced grid under a resolution reduction.
height: u32The image area’s height, as Image::height:
on the reduced grid under a resolution reduction.
components: Vec<ComponentInfo>One entry per Image::components entry,
in the same order: for a palettized JP2 file, the palette’s channels.
max_reduction: u8The largest
resolution_reduction
the main header allows: the fewest decomposition levels any component
has in the main header’s COD and COC markers. A larger reduction is
Error::InvalidOptions. A tile-part
COD or COC with fewer levels can still refuse a reduction up to
this one, but only the decode finds that.
quality_layers: u16The number of quality layers the main header’s COD marker declares
(SGcod, at least 1). A
max_quality_layers cap
(set with
with_max_quality_layers)
at or past it decodes every layer of a tile that keeps this COD. A
tile-part COD can declare another count for its tile, and only the
decode reads that.
image_area: WindowThe image area on the reference grid, as the SIZ marker declares
it: XOsiz..Xsiz by YOsiz..Ysiz, at full resolution. A
Region::Window is in the same coordinates,
so a window of the image’s top-left 64 x 64 samples starts at
(image_area.x0, image_area.y0), not at (0, 0).
tiles: TileGridThe tile grid the SIZ marker declares. Its
count is how many tiles
Region::Tile can name: 0 to count() - 1.
jp2: Option<Jp2Metadata>What decode would put on
Image::jp2: None for a raw codestream.