Skip to main content

Profile

Struct Profile 

Source
pub struct Profile {
Show 21 fields pub prefix: i32, pub width: i32, pub height: i32, pub encoding: Encoding, pub frame_byte_length: i32, pub swaps_dimensions: bool, pub little_endian: bool, pub is_padded: bool, pub is_interlaced: bool, pub clcl_chroma: bool, pub swap_chroma_planes: bool, pub cl_chroma: bool, pub swap_rgb_channels: bool, pub rotation: i32, pub crop_x: i32, pub crop_y: i32, pub crop_width: i32, pub crop_height: i32, pub slot_size: i32, pub use_mhni_dimensions: bool, pub fallback_encodings: Option<Vec<Encoding>>,
}
Expand description

Decoding profile for a raw .ithmb frame format.

Maps to IthmbVariantProfile in the C# implementation. Each field that defaults to false/0/None can be omitted — the decoder uses the standard behaviour unless overridden.

Fields§

§prefix: i32

Big-endian 4-byte prefix identifying this format.

§width: i32

Frame width in pixels.

§height: i32

Frame height in pixels.

§encoding: Encoding

Pixel encoding.

§frame_byte_length: i32

Number of bytes in one complete frame (not counting padding).

§swaps_dimensions: bool

If true, width and height are swapped after decode.

§little_endian: bool

If false (default), pixel data is little-endian.

§is_padded: bool

If true, frame occupies a fixed-size slot with padding.

§is_interlaced: bool

If true, even/odd scanlines are stored as separate fields.

§clcl_chroma: bool

If true, chroma uses CLCL shared-nibble layout.

§swap_chroma_planes: bool

If true, swap Cb/Cr plane order in YCbCr 4:2:0.

§cl_chroma: bool

If true, chroma uses CL per-pixel nibble layout.

§swap_rgb_channels: bool

If true, swap R and B channels (BGR15 iPhone compatibility).

§rotation: i32

Post-decode clockwise rotation in degrees (0, 90, 180, 270).

§crop_x: i32

Visible-region X offset (applied after rotation).

§crop_y: i32

Visible-region Y offset (applied after rotation).

§crop_width: i32

Visible-region width (0 = full width).

§crop_height: i32

Visible-region height (0 = full height).

§slot_size: i32

Slot size in bytes for padded profiles.

§use_mhni_dimensions: bool

If true, use actual Width/Height from MHNI chunk instead of fixed values.

§fallback_encodings: Option<Vec<Encoding>>

Ordered list of fallback encodings to try if primary decode fails.

Implementations§

Source§

impl Profile

Source

pub fn frame_size(&self) -> i32

The number of bytes per frame, accounting for slot padding.

For padded profiles the frame stride is slot_size; for unpadded it equals frame_byte_length.

Source

pub fn display_width(&self) -> i32

The number of pixel columns in the frame.

Source

pub fn display_height(&self) -> i32

The number of pixel rows in the frame.

Trait Implementations§

Source§

impl Clone for Profile

Source§

fn clone(&self) -> Profile

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 Profile

Source§

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

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

impl Default for Profile

Source§

fn default() -> Self

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.