Struct exr::meta::attribute::TimeCode [−][src]
pub struct TimeCode { pub hours: u8, pub minutes: u8, pub seconds: u8, pub frame: u8, pub drop_frame: bool, pub color_frame: bool, pub field_phase: bool, pub binary_group_flags: [bool; 3], pub binary_groups: [u8; 8], }
Expand description
Contains time information for this frame within a sequence.
Also defined methods to compile this information into a
TV60
, TV50
or Film24
bit sequence, packed into u32
.
Satisfies the SMPTE standard 12M-1999. For more in-depth information, see philrees.co.uk/timecode.
Fields
hours: u8
Hours 0 - 23 are valid.
minutes: u8
Minutes 0 - 59 are valid.
seconds: u8
Seconds 0 - 59 are valid.
frame: u8
Frame Indices 0 - 29 are valid.
drop_frame: bool
Whether this is a drop frame.
color_frame: bool
Whether this is a color frame.
field_phase: bool
Field Phase.
binary_group_flags: [bool; 3]
Flags for TimeCode.binary_groups
.
binary_groups: [u8; 8]
The user-defined control codes.
Every entry in this array can use at most 3 bits.
This results in a maximum value of 15, including 0, for each u8
.
Implementations
impl TimeCode
[src]
impl TimeCode
[src]pub fn validate(&self, strict: bool) -> UnitResult
[src]
pub fn validate(&self, strict: bool) -> UnitResult
[src]Returns an error if this time code is considered invalid.
pub fn pack_time_as_tv60_u32(&self) -> Result<u32>
[src]
pub fn pack_time_as_tv60_u32(&self) -> Result<u32>
[src]Pack the SMPTE time code into a u32 value, according to TV60 packing. This is the encoding which is used within a binary exr file.
pub fn from_tv60_time(tv60_time: u32, user_data: u32) -> Self
[src]
pub fn from_tv60_time(tv60_time: u32, user_data: u32) -> Self
[src]Unpack a time code from one TV60 encoded u32 value and the encoded user data. This is the encoding which is used within a binary exr file.
pub fn pack_time_as_tv50_u32(&self) -> Result<u32>
[src]
pub fn pack_time_as_tv50_u32(&self) -> Result<u32>
[src]Pack the SMPTE time code into a u32 value, according to TV50 packing.
This encoding does not support the drop_frame
flag, it will be lost.
pub fn from_tv50_time(tv50_time: u32, user_data: u32) -> Self
[src]
pub fn from_tv50_time(tv50_time: u32, user_data: u32) -> Self
[src]Unpack a time code from one TV50 encoded u32 value and the encoded user data.
This encoding does not support the drop_frame
flag, it will always be false.
pub fn pack_time_as_film24_u32(&self) -> Result<u32>
[src]
pub fn pack_time_as_film24_u32(&self) -> Result<u32>
[src]Pack the SMPTE time code into a u32 value, according to FILM24 packing.
This encoding does not support the drop_frame
and color_frame
flags, they will be lost.
pub fn from_film24_time(film24_time: u32, user_data: u32) -> Self
[src]
pub fn from_film24_time(film24_time: u32, user_data: u32) -> Self
[src]Unpack a time code from one TV60 encoded u32 value and the encoded user data.
This encoding does not support the drop_frame
and color_frame
flags, they will always be false
.
pub fn pack_user_data_as_u32(&self) -> u32
[src]
pub fn pack_user_data_as_u32(&self) -> u32
[src]Pack the user data u8
array into one u32.
User data values are clamped to the valid range (maximum value is 4).
pub fn write<W: Write>(&self, write: &mut W) -> UnitResult
[src]
pub fn write<W: Write>(&self, write: &mut W) -> UnitResult
[src]Write this time code to the byte stream, encoded as TV60 integers.
Returns an Error::Invalid
if the fields are out of the allowed range.
Trait Implementations
impl Copy for TimeCode
[src]
impl Eq for TimeCode
[src]
impl StructuralEq for TimeCode
[src]
impl StructuralPartialEq for TimeCode
[src]
Auto Trait Implementations
impl RefUnwindSafe for TimeCode
impl Send for TimeCode
impl Sync for TimeCode
impl Unpin for TimeCode
impl UnwindSafe for TimeCode
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more