Struct spectrusty::clock::VFrameTs

source ·
pub struct VFrameTs<V> {
    pub ts: VideoTs,
    /* private fields */
}
Expand description

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§

The end-of-frame timestamp, equal to the total number of T-states per frame.

Constructs a new VFrameTs from the given vertical and horizontal counter values.

Note: The returned VFrameTs is not normalized.

Returns true if a video timestamp is normalized. Otherwise returns false.

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.

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.

Returns the largest value that can be represented by a normalized timestamp.

Returns the smallest value that can be represented by a normalized timestamp.

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.

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.

Returns a video timestamp after subtracting the total number of frame video scanlines from the scan line counter.

Returns a normalized timestamp from the given number of T-states.

Panics

Panics when the given ts overflows the capacity of the timestamp.

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.

Converts the timestamp to FTs.

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).

Trait Implementations§

Returns a normalized video timestamp after adding delta T-states.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

The resulting type after applying the + operator.

Returns a normalized video timestamp after adding a delta T-state count.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

The resulting type after applying the + operator.
Performs the += operation. Read more
Performs the += operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

Returns a VFrameTs from the given VideoTs. A returned VFrameTs is not being normalized.

Panics

Panics when the given ts overflows the capacity of VideoTs.

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

Returns a normalized video timestamp after subtracting delta T-states.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

The resulting type after applying the - operator.

Returns a normalized video timestamp after adding a delta T-state count.

Panics

Panics when normalized timestamp after addition leads to an overflow of the capacity of VideoTs.

The resulting type after applying the - operator.
Performs the -= operation. Read more
Performs the -= operation. Read more
Panics

May panic if self or other hasn’t been normalized.

Panics

May panic if self or other hasn’t been normalized.

Returns a normalized timestamp from the given number of T-states. Read more
Converts the timestamp to FTs. Read more
Returns the largest value that can be represented by a normalized timestamp.
Returns the smallest value that can be represented by a normalized timestamp.
Returns the difference between ts_from and self in the number of T-states. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert to S a sample type from self.
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.