pub struct JxlAnimation {
pub tps_numerator: u32,
pub tps_denominator: u32,
pub num_loops: u32,
pub have_timecodes: bool,
}Expand description
JPEG-XL animation header (per ISO 18181-1, Section 7.1.3).
Defines the timing base for all frames in an animated JPEG-XL image.
Frame durations are expressed as duration_ticks * tps_denominator / tps_numerator
seconds.
Fields§
§tps_numerator: u32Tick numerator for frame timing (tps_numerator).
Together with tps_denominator, defines the time unit for frame durations.
For example, tps_numerator = 1000 and tps_denominator = 1 gives
millisecond-resolution timing.
tps_denominator: u32Tick denominator for frame timing (tps_denominator).
num_loops: u32Number of loops (0 = infinite loop).
have_timecodes: boolWhether timecodes are present in frame headers.
Implementations§
Source§impl JxlAnimation
impl JxlAnimation
Sourcepub fn new(tps_numerator: u32, tps_denominator: u32) -> CodecResult<Self>
pub fn new(tps_numerator: u32, tps_denominator: u32) -> CodecResult<Self>
Create an animation header with the given tick rate.
§Errors
Returns error if tps_numerator or tps_denominator is zero.
Sourcepub fn millisecond() -> Self
pub fn millisecond() -> Self
Create an animation header for millisecond-resolution timing (tps_numerator = 1000, tps_denominator = 1).
Sourcepub fn with_num_loops(self, num_loops: u32) -> Self
pub fn with_num_loops(self, num_loops: u32) -> Self
Set the number of loops (0 = infinite).
Sourcepub fn with_timecodes(self, have_timecodes: bool) -> Self
pub fn with_timecodes(self, have_timecodes: bool) -> Self
Enable timecodes in frame headers.
Sourcepub fn duration_seconds(&self, ticks: u32) -> f64
pub fn duration_seconds(&self, ticks: u32) -> f64
Calculate the frame duration in seconds for a given number of ticks.
Trait Implementations§
Source§impl Clone for JxlAnimation
impl Clone for JxlAnimation
Source§fn clone(&self) -> JxlAnimation
fn clone(&self) -> JxlAnimation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JxlAnimation
impl Debug for JxlAnimation
Source§impl PartialEq for JxlAnimation
impl PartialEq for JxlAnimation
Source§fn eq(&self, other: &JxlAnimation) -> bool
fn eq(&self, other: &JxlAnimation) -> bool
self and other values to be equal, and is used by ==.impl Eq for JxlAnimation
impl StructuralPartialEq for JxlAnimation
Auto Trait Implementations§
impl Freeze for JxlAnimation
impl RefUnwindSafe for JxlAnimation
impl Send for JxlAnimation
impl Sync for JxlAnimation
impl Unpin for JxlAnimation
impl UnsafeUnpin for JxlAnimation
impl UnwindSafe for JxlAnimation
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