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: i32Big-endian 4-byte prefix identifying this format.
width: i32Frame width in pixels.
height: i32Frame height in pixels.
encoding: EncodingPixel encoding.
frame_byte_length: i32Number of bytes in one complete frame (not counting padding).
swaps_dimensions: boolIf true, width and height are swapped after decode.
little_endian: boolIf false (default), pixel data is little-endian.
is_padded: boolIf true, frame occupies a fixed-size slot with padding.
is_interlaced: boolIf true, even/odd scanlines are stored as separate fields.
clcl_chroma: boolIf true, chroma uses CLCL shared-nibble layout.
swap_chroma_planes: boolIf true, swap Cb/Cr plane order in YCbCr 4:2:0.
cl_chroma: boolIf true, chroma uses CL per-pixel nibble layout.
swap_rgb_channels: boolIf true, swap R and B channels (BGR15 iPhone compatibility).
rotation: i32Post-decode clockwise rotation in degrees (0, 90, 180, 270).
crop_x: i32Visible-region X offset (applied after rotation).
crop_y: i32Visible-region Y offset (applied after rotation).
crop_width: i32Visible-region width (0 = full width).
crop_height: i32Visible-region height (0 = full height).
slot_size: i32Slot size in bytes for padded profiles.
use_mhni_dimensions: boolIf 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
impl Profile
Sourcepub fn frame_size(&self) -> i32
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.
Sourcepub fn display_width(&self) -> i32
pub fn display_width(&self) -> i32
The number of pixel columns in the frame.
Sourcepub fn display_height(&self) -> i32
pub fn display_height(&self) -> i32
The number of pixel rows in the frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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