Struct FrameSpan
- Namespace
- Backdash
- Assembly
- Backdash.dll
Value representation of a span of frames Uses the FPS defined in FrameTime.CurrentFrameRate
public readonly struct FrameSpan : IComparable<FrameSpan>, IUtf8SpanFormattable, IFormattable, IComparisonOperators<FrameSpan, FrameSpan, bool>, IEqualityOperators<FrameSpan, FrameSpan, bool>, IAdditionOperators<FrameSpan, FrameSpan, FrameSpan>, ISubtractionOperators<FrameSpan, FrameSpan, FrameSpan>, IModulusOperators<FrameSpan, int, FrameSpan>, IAdditionOperators<FrameSpan, int, FrameSpan>, IMultiplyOperators<FrameSpan, int, FrameSpan>, ISubtractionOperators<FrameSpan, int, FrameSpan>, IAdditionOperators<FrameSpan, Frame, FrameSpan>, ISubtractionOperators<FrameSpan, Frame, FrameSpan>, IEquatable<FrameSpan>
- Implements
- Inherited Members
Constructors
FrameSpan(int)
Initialize new FrameSpan for frame frameCount
.
public FrameSpan(int frameCount)
Parameters
frameCount
int
Fields
FrameCount
public readonly int FrameCount
Field Value
MaxValue
Returns max frame span value
public static readonly FrameSpan MaxValue
Field Value
One
Return frame span of 1
frame
public static readonly FrameSpan One
Field Value
Zero
Return frame span of 0
frames
public static readonly FrameSpan Zero
Field Value
Properties
FrameValue
Returns the value for the current frame span as a Frame.
public Frame FrameValue { get; }
Property Value
Methods
Abs(in FrameSpan)
Returns the absolute value of a Frame.
public static FrameSpan Abs(in FrameSpan frame)
Parameters
frame
FrameSpan
Returns
Clamp(in FrameSpan, in Frame, in Frame)
Clamps frame value to a range
public static FrameSpan Clamp(in FrameSpan frame, in Frame min, in Frame max)
Parameters
Returns
Clamp(in FrameSpan, in FrameSpan, in FrameSpan)
Clamps frame value to a range
public static FrameSpan Clamp(in FrameSpan frame, in FrameSpan min, in FrameSpan max)
Parameters
Returns
Clamp(in FrameSpan, int, int)
Clamps frame value to a range
public static FrameSpan Clamp(in FrameSpan frame, int min, int max)
Parameters
Returns
CompareTo(FrameSpan)
public int CompareTo(FrameSpan other)
Parameters
other
FrameSpan
Returns
Duration()
Returns the time value for the current frame span in TimeSpan.
public TimeSpan Duration()
Returns
Duration(int)
Returns the time value for the current frame span in TimeSpan.
public TimeSpan Duration(int fps)
Parameters
fps
int
Returns
Equals(FrameSpan)
public bool Equals(FrameSpan other)
Parameters
other
FrameSpan
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
FromMilliseconds(double)
Returns new FrameSpan for milliseconds
public static FrameSpan FromMilliseconds(double milliseconds)
Parameters
milliseconds
double
Returns
FromMilliseconds(double, int)
Returns new FrameSpan for milliseconds
at specified fps
.
public static FrameSpan FromMilliseconds(double milliseconds, int fps)
Parameters
Returns
FromSeconds(double)
Returns new FrameSpan for seconds
public static FrameSpan FromSeconds(double seconds)
Parameters
seconds
double
Returns
FromSeconds(double, int)
Returns new FrameSpan for seconds
at specified fps
.
public static FrameSpan FromSeconds(double seconds, int fps)
Parameters
Returns
FromTimeSpan(TimeSpan)
Returns new FrameSpan for duration
.
public static FrameSpan FromTimeSpan(TimeSpan duration)
Parameters
duration
TimeSpan
Returns
FromTimeSpan(TimeSpan, int)
Returns new FrameSpan for duration
at specified fps
.
public static FrameSpan FromTimeSpan(TimeSpan duration, int fps)
Parameters
Returns
GetFrameAt(TimeSpan)
Returns frame at the timespan position
public Frame GetFrameAt(TimeSpan duration)
Parameters
duration
TimeSpan
Returns
GetFrameAt(TimeSpan, int)
Returns frame at the timespan position
public Frame GetFrameAt(TimeSpan duration, int fps)
Parameters
Returns
GetFrameAtMilliSecond(double)
Returns frame at the time position in milliseconds
public Frame GetFrameAtMilliSecond(double millis)
Parameters
millis
double
Returns
GetFrameAtMilliSecond(double, int)
Returns frame at the time position in milliseconds
public Frame GetFrameAtMilliSecond(double millis, int fps)
Parameters
Returns
GetFrameAtSecond(double)
Returns frame at the time position in seconds
public Frame GetFrameAtSecond(double seconds)
Parameters
seconds
double
Returns
GetFrameAtSecond(double, int)
Returns frame at the time position in seconds
public Frame GetFrameAtSecond(double seconds, int fps)
Parameters
Returns
GetHashCode()
public override int GetHashCode()
Returns
Max(in FrameSpan, in FrameSpan)
Returns the larger of two FrameSpan.
public static FrameSpan Max(in FrameSpan left, in FrameSpan right)
Parameters
Returns
Min(in FrameSpan, in FrameSpan)
Returns the smaller of two FrameSpan.
public static FrameSpan Min(in FrameSpan left, in FrameSpan right)
Parameters
Returns
Of(int)
Initialize new FrameSpan for frame frameCount
.
public static FrameSpan Of(int frameCount)
Parameters
frameCount
int
Returns
Seconds()
Returns the time value for the current frame span in seconds.
public double Seconds()
Returns
Seconds(int)
Returns the time value for the current frame span in seconds.
public double Seconds(int fps)
Parameters
fps
int
Returns
ToString()
public override string ToString()
Returns
ToString(string?, IFormatProvider?)
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
format
stringformatProvider
IFormatProvider
Returns
TryFormat(Span<byte>, out int, ReadOnlySpan<char>, IFormatProvider?)
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider)
Parameters
utf8Destination
Span<byte>bytesWritten
intformat
ReadOnlySpan<char>provider
IFormatProvider
Returns
Operators
operator *(int, FrameSpan)
public static FrameSpan operator *(int left, FrameSpan right)
Parameters
Returns
Explicit Interface Implementations
operator +(FrameSpan, Frame)
static FrameSpan operator +(FrameSpan left, Frame right)
Parameters
Returns
operator +(FrameSpan, FrameSpan)
static FrameSpan operator +(FrameSpan left, FrameSpan right)
Parameters
Returns
operator +(FrameSpan, int)
static FrameSpan operator +(FrameSpan left, int right)
Parameters
Returns
operator ==(FrameSpan, FrameSpan)
static bool operator ==(FrameSpan left, FrameSpan right)
Parameters
Returns
operator >(FrameSpan, FrameSpan)
static bool operator >(FrameSpan left, FrameSpan right)
Parameters
Returns
operator >=(FrameSpan, FrameSpan)
static bool operator >=(FrameSpan left, FrameSpan right)
Parameters
Returns
operator !=(FrameSpan, FrameSpan)
static bool operator !=(FrameSpan left, FrameSpan right)
Parameters
Returns
operator <(FrameSpan, FrameSpan)
static bool operator <(FrameSpan left, FrameSpan right)
Parameters
Returns
operator <=(FrameSpan, FrameSpan)
static bool operator <=(FrameSpan left, FrameSpan right)
Parameters
Returns
operator %(FrameSpan, int)
static FrameSpan operator %(FrameSpan left, int right)
Parameters
Returns
operator *(FrameSpan, int)
static FrameSpan operator *(FrameSpan left, int right)
Parameters
Returns
operator -(FrameSpan, Frame)
static FrameSpan operator -(FrameSpan left, Frame right)
Parameters
Returns
operator -(FrameSpan, FrameSpan)
static FrameSpan operator -(FrameSpan left, FrameSpan right)
Parameters
Returns
operator -(FrameSpan, int)
static FrameSpan operator -(FrameSpan left, int right)