[−][src]Struct spectrusty_core::clock::VFrameTs
A VideoTs timestamp wrapper with a constraint to the V:
VideoFrame,
implementing methods and traits for timestamp calculations.
Fields
ts: VideoTs
The current value of the timestamp.
Implementations
impl<V: VideoFrame> VFrameTs<V>
[src]
pub const EOF: VFrameTs<V>
[src]
The end-of-frame timestamp, equal to the total number of T-states per frame.
pub fn new(vc: Ts, hc: Ts) -> Self
[src]
Constructs a new VFrameTs
from the given vertical and horizontal counter values.
Note: The returned VFrameTs
is not normalized.
pub fn is_normalized(self) -> bool
[src]
Returns true
if a video timestamp is normalized. Otherwise returns false
.
pub fn normalized(self) -> Self
[src]
Normalizes self with a horizontal counter within the allowed range and a scan line counter adjusted accordingly.
Panics
Panics when an attempt to normalize leads to an overflow of the capacity of VideoTs.
pub fn saturating_normalized(self) -> Self
[src]
Returns a video timestamp with a horizontal counter within the allowed range and a scan line counter adjusted accordingly. Saturates at VFrameTs::min_value or VFrameTs::max_value.
pub fn max_value() -> Self
[src]
Returns the largest value that can be represented by a normalized timestamp.
pub fn min_value() -> Self
[src]
Returns the smallest value that can be represented by a normalized timestamp.
pub fn is_eof(self) -> bool
[src]
Returns true
if the counter value is past or near the end of a frame. Otherwise returns false
.
Specifically, the condition is met if the vertical counter is equal to or greater than VideoFrame::VSL_COUNT.
pub fn wrap_frame(&mut self)
[src]
Ensures the vertical counter is in the range: (-VSL_COUNT, VSL_COUNT)
by calculating
a remainder of the division of the vertical counter by VideoFrame::VSL_COUNT.
pub fn saturating_sub_frame(self) -> Self
[src]
Returns a video timestamp after subtracting the total number of frame video scanlines from the scan line counter.
pub fn from_tstates(ts: FTs) -> Self
[src]
Returns a normalized timestamp from the given number of T-states.
Panics
Panics when the given ts
overflows the capacity of the timestamp.
pub fn try_from_tstates(ts: FTs) -> Option<Self>
[src]
On success returns a normalized timestamp from the given number of T-states.
Returns None
when the given ts
overflows the capacity of the timestamp.
pub fn into_tstates(self) -> FTs
[src]
Converts the timestamp to FTs.
pub fn into_frame_tstates(self, frames: u64) -> (u64, FTs)
[src]
Returns a tuple with an adjusted frame counter and with the frame-normalized timestamp as the number of T-states measured from the start of the frame.
The frame starts when the horizontal and vertical counter are both 0.
The returned timestamp value is in the range [0, VideoFrame::FRAME_TSTATES_COUNT).
Methods from Deref<Target = VideoTs>
Trait Implementations
impl<V: VideoFrame> Add<i32> for VFrameTs<V>
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, delta: FTs) -> Self
[src]
impl<V: VideoFrame> Add<u32> for VFrameTs<V>
[src]
type Output = Self
The resulting type after applying the +
operator.
pub fn add(self, delta: u32) -> Self
[src]
impl<V: VideoFrame> AddAssign<i32> for VFrameTs<V>
[src]
pub fn add_assign(&mut self, delta: FTs)
[src]
impl<V: VideoFrame> AddAssign<u32> for VFrameTs<V>
[src]
pub fn add_assign(&mut self, delta: u32)
[src]
impl<V> Clone for VFrameTs<V>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<V: Copy> Copy for VFrameTs<V>
[src]
impl<V: Debug> Debug for VFrameTs<V>
[src]
impl<V> Default for VFrameTs<V>
[src]
impl<V> Deref for VFrameTs<V>
[src]
type Target = VideoTs
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl<V> DerefMut for VFrameTs<V>
[src]
impl<'de, V> Deserialize<'de> for VFrameTs<V> where
V: VideoFrame,
[src]
V: VideoFrame,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<V> Eq for VFrameTs<V>
[src]
impl<V: VideoFrame> From<&'_ VideoTsData1> for VFrameTs<V>
[src]
pub fn from(vtsd: &VideoTsData1) -> Self
[src]
impl<V: VideoFrame> From<&'_ VideoTsData2> for VFrameTs<V>
[src]
pub fn from(vtsd: &VideoTsData2) -> Self
[src]
impl<V: VideoFrame> From<&'_ VideoTsData3> for VFrameTs<V>
[src]
pub fn from(vtsd: &VideoTsData3) -> Self
[src]
impl<V: VideoFrame> From<&'_ VideoTsData6> for VFrameTs<V>
[src]
pub fn from(vtsd: &VideoTsData6) -> Self
[src]
impl<V: VideoFrame> From<VFrameTs<V>> for FTs
[src]
impl<V> From<VFrameTs<V>> for VideoTs
[src]
impl<V, C> From<VFrameTsCounter<V, C>> for VFrameTs<V>
[src]
pub fn from(vftsc: VFrameTsCounter<V, C>) -> VFrameTs<V>
[src]
impl<V> From<VideoTs> for VFrameTs<V>
[src]
impl<V: VideoFrame> From<VideoTsData1> for VFrameTs<V>
[src]
pub fn from(vtsd: VideoTsData1) -> Self
[src]
impl<V: VideoFrame> From<VideoTsData2> for VFrameTs<V>
[src]
pub fn from(vtsd: VideoTsData2) -> Self
[src]
impl<V: VideoFrame> From<VideoTsData3> for VFrameTs<V>
[src]
pub fn from(vtsd: VideoTsData3) -> Self
[src]
impl<V: VideoFrame> From<VideoTsData6> for VFrameTs<V>
[src]
pub fn from(vtsd: VideoTsData6) -> Self
[src]
impl<V> Hash for VFrameTs<V>
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<V> Ord for VFrameTs<V>
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<V> PartialEq<VFrameTs<V>> for VFrameTs<V>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<V> PartialOrd<VFrameTs<V>> for VFrameTs<V>
[src]
pub fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<V> Serialize for VFrameTs<V> where
V: VideoFrame,
[src]
V: VideoFrame,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<V: VideoFrame> Sub<i32> for VFrameTs<V>
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn sub(self, delta: FTs) -> Self
[src]
impl<V: VideoFrame> Sub<u32> for VFrameTs<V>
[src]
type Output = Self
The resulting type after applying the -
operator.
pub fn sub(self, delta: u32) -> Self
[src]
impl<V: VideoFrame> SubAssign<i32> for VFrameTs<V>
[src]
pub fn sub_assign(&mut self, delta: FTs)
[src]
impl<V: VideoFrame> SubAssign<u32> for VFrameTs<V>
[src]
pub fn sub_assign(&mut self, delta: u32)
[src]
impl<V: VideoFrame> TimestampOps for VFrameTs<V>
[src]
pub fn from_tstates(ts: FTs) -> Self
[src]
pub fn into_tstates(self) -> FTs
[src]
pub fn max_value() -> Self
[src]
pub fn min_value() -> Self
[src]
pub fn diff_from(self, vts_from: Self) -> FTs
[src]
pub fn saturating_add(self, other: Self) -> Self
[src]
Panics
May panic if self
or other
hasn't been normalized.
pub fn saturating_sub(self, other: Self) -> Self
[src]
Panics
May panic if self
or other
hasn't been normalized.
impl<V: VideoFrame> TryFrom<i32> for VFrameTs<V>
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for VFrameTs<V> where
V: RefUnwindSafe,
[src]
V: RefUnwindSafe,
impl<V> Send for VFrameTs<V> where
V: Send,
[src]
V: Send,
impl<V> Sync for VFrameTs<V> where
V: Sync,
[src]
V: Sync,
impl<V> Unpin for VFrameTs<V> where
V: Unpin,
[src]
V: Unpin,
impl<V> UnwindSafe for VFrameTs<V> where
V: UnwindSafe,
[src]
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,