Skip to main content

TileInfo

Struct TileInfo 

Source
pub struct TileInfo {
Show 16 fields pub tile_cols: u32, pub tile_rows: u32, pub tile_col_starts: Vec<u32>, pub tile_row_starts: Vec<u32>, pub context_update_tile_id: u32, pub tile_size_bytes: u8, pub uniform_tile_spacing: bool, pub tile_cols_log2: u8, pub tile_rows_log2: u8, pub min_tile_cols_log2: u8, pub max_tile_cols_log2: u8, pub min_tile_rows_log2: u8, pub max_tile_rows_log2: u8, pub sb_cols: u32, pub sb_rows: u32, pub sb_size: u32,
}
Expand description

Tile information from frame header.

Fields§

§tile_cols: u32

Number of tile columns.

§tile_rows: u32

Number of tile rows.

§tile_col_starts: Vec<u32>

Tile column start positions (in superblocks).

§tile_row_starts: Vec<u32>

Tile row start positions (in superblocks).

§context_update_tile_id: u32

Context update tile ID.

§tile_size_bytes: u8

Number of bytes to read for tile size.

§uniform_tile_spacing: bool

Uniform tile spacing flag.

§tile_cols_log2: u8

Tile columns log2.

§tile_rows_log2: u8

Tile rows log2.

§min_tile_cols_log2: u8

Minimum tile columns log2.

§max_tile_cols_log2: u8

Maximum tile columns log2.

§min_tile_rows_log2: u8

Minimum tile rows log2.

§max_tile_rows_log2: u8

Maximum tile rows log2.

§sb_cols: u32

Superblock columns.

§sb_rows: u32

Superblock rows.

§sb_size: u32

Superblock size (64 or 128).

Implementations§

Source§

impl TileInfo

Source

pub fn new() -> Self

Create a new tile info with default values.

Source

pub fn parse( reader: &mut BitReader<'_>, _seq: &SequenceHeader, frame_size: &FrameSize, ) -> CodecResult<Self>

Parse tile info from the bitstream.

§Errors

Returns error if the bitstream is malformed.

Source

pub const fn tile_count(&self) -> u32

Get total number of tiles.

Source

pub fn tile_size_sb(&self, tile_col: u32, tile_row: u32) -> (u32, u32)

Get tile dimensions in superblocks for a specific tile.

Source

pub fn tile_size_pixels(&self, tile_col: u32, tile_row: u32) -> (u32, u32)

Get tile dimensions in pixels for a specific tile.

Source

pub const fn tile_index(&self, tile_col: u32, tile_row: u32) -> u32

Get the tile index for a given (col, row) position.

Source

pub const fn tile_position(&self, tile_idx: u32) -> (u32, u32)

Get the (col, row) position for a tile index.

Source

pub fn tile_col_start_sb(&self, tile_col: u32) -> u32

Get the starting superblock column for a tile column.

Source

pub fn tile_row_start_sb(&self, tile_row: u32) -> u32

Get the starting superblock row for a tile row.

Source

pub fn tile_start_pixels(&self, tile_col: u32, tile_row: u32) -> (u32, u32)

Get the pixel position for the start of a tile.

Source

pub const fn is_single_tile(&self) -> bool

Check if this is a single-tile frame.

Source

pub const fn is_left_edge(&self, tile_col: u32) -> bool

Check if a tile is at the left edge.

Source

pub fn is_right_edge(&self, tile_col: u32) -> bool

Check if a tile is at the right edge.

Source

pub const fn is_top_edge(&self, tile_row: u32) -> bool

Check if a tile is at the top edge.

Source

pub fn is_bottom_edge(&self, tile_row: u32) -> bool

Check if a tile is at the bottom edge.

Trait Implementations§

Source§

impl Clone for TileInfo

Source§

fn clone(&self) -> TileInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TileInfo

Source§

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

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

impl Default for TileInfo

Source§

fn default() -> TileInfo

Returns the “default value” for a type. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = Infallible

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.