Table of Contents

Struct FrameSpan

Namespace
Backdash.Data
Assembly
Backdash.dll

Value representation of a span of frames

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

DefaultFramesPerSecond

Default FPS(frames per second)60

public const short DefaultFramesPerSecond = 60

Field Value

short

FrameCount

Returns the int count of frames in the current frame span Frame.

public readonly int FrameCount

Field Value

int

MaxValue

Returns max frame span value

public static readonly FrameSpan MaxValue

Field Value

FrameSpan

One

Return frame span of 1 frame

public static readonly FrameSpan One

Field Value

FrameSpan

Zero

Return frame span of 0 frames

public static readonly FrameSpan Zero

Field Value

FrameSpan

Properties

FrameValue

Returns the value for the current frame span as a Frame.

public Frame FrameValue { get; }

Property Value

Frame

Methods

Abs(in FrameSpan)

Returns the absolute value of a Frame.

public static FrameSpan Abs(in FrameSpan frame)

Parameters

frame FrameSpan

Returns

FrameSpan

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

frame FrameSpan
min Frame
max Frame

Returns

FrameSpan

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

frame FrameSpan
min FrameSpan
max FrameSpan

Returns

FrameSpan

Clamp(in FrameSpan, int, int)

Clamps frame value to a range

public static FrameSpan Clamp(in FrameSpan frame, int min, int max)

Parameters

frame FrameSpan
min int
max int

Returns

FrameSpan

CompareTo(FrameSpan)

public int CompareTo(FrameSpan other)

Parameters

other FrameSpan

Returns

int

Duration(short)

Returns the time value for the current frame span in TimeSpan.

public TimeSpan Duration(short fps = 60)

Parameters

fps short

Returns

TimeSpan

Equals(FrameSpan)

public bool Equals(FrameSpan other)

Parameters

other FrameSpan

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

FromMilliseconds(double, short)

Returns new FrameSpan for milliseconds at specified fps.

public static FrameSpan FromMilliseconds(double milliseconds, short fps = 60)

Parameters

milliseconds double
fps short

Returns

FrameSpan

FromSeconds(double, short)

Returns new FrameSpan for seconds at specified fps.

public static FrameSpan FromSeconds(double seconds, short fps = 60)

Parameters

seconds double
fps short

Returns

FrameSpan

FromTimeSpan(TimeSpan, short)

Returns new FrameSpan for time at specified fps.

public static FrameSpan FromTimeSpan(TimeSpan time, short fps = 60)

Parameters

time TimeSpan
fps short

Returns

FrameSpan

GetDuration(int, short)

Returns TimeSpan for frameCount at specified fps.

public static TimeSpan GetDuration(int frameCount, short fps = 60)

Parameters

frameCount int
fps short

Returns

TimeSpan

GetFrameAt(TimeSpan, short)

Returns frame at the timespan position

public Frame GetFrameAt(TimeSpan duration, short fps = 60)

Parameters

duration TimeSpan
fps short

Returns

Frame

GetFrameAtMilliSecond(double, short)

Returns frame at the time position in milliseconds

public Frame GetFrameAtMilliSecond(double millis, short fps = 60)

Parameters

millis double
fps short

Returns

Frame

GetFrameAtSecond(double, short)

Returns frame at the time position in seconds

public Frame GetFrameAtSecond(double seconds, short fps = 60)

Parameters

seconds double
fps short

Returns

Frame

GetHashCode()

public override int GetHashCode()

Returns

int

InSeconds(int, short)

Returns double seconds for frameCount at specified fps.

public static double InSeconds(int frameCount, short fps = 60)

Parameters

frameCount int
fps short

Returns

double

Max(in FrameSpan, in FrameSpan)

Returns the larger of two FrameSpan.

public static FrameSpan Max(in FrameSpan left, in FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

FrameSpan

Min(in FrameSpan, in FrameSpan)

Returns the smaller of two FrameSpan.

public static FrameSpan Min(in FrameSpan left, in FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

FrameSpan

Of(int)

Initialize new FrameSpan for frame frameCount.

public static FrameSpan Of(int frameCount)

Parameters

frameCount int

Returns

FrameSpan

Seconds(short)

Returns the time value for the current frame span in seconds

public double Seconds(short fps = 60)

Parameters

fps short

Returns

double

ToString()

public override string ToString()

Returns

string

ToString(string?, IFormatProvider?)

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string
formatProvider IFormatProvider

Returns

string

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 int
format ReadOnlySpan<char>
provider IFormatProvider

Returns

bool

Operators

operator *(int, FrameSpan)

public static FrameSpan operator *(int left, FrameSpan right)

Parameters

left int
right FrameSpan

Returns

FrameSpan

Explicit Interface Implementations

operator +(FrameSpan, Frame)

static FrameSpan operator +(FrameSpan left, Frame right)

Parameters

left FrameSpan
right Frame

Returns

FrameSpan

operator +(FrameSpan, FrameSpan)

static FrameSpan operator +(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

FrameSpan

operator +(FrameSpan, int)

static FrameSpan operator +(FrameSpan left, int right)

Parameters

left FrameSpan
right int

Returns

FrameSpan

operator ==(FrameSpan, FrameSpan)

static bool operator ==(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator >(FrameSpan, FrameSpan)

static bool operator >(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator >=(FrameSpan, FrameSpan)

static bool operator >=(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator !=(FrameSpan, FrameSpan)

static bool operator !=(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator <(FrameSpan, FrameSpan)

static bool operator <(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator <=(FrameSpan, FrameSpan)

static bool operator <=(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

bool

operator %(FrameSpan, int)

static FrameSpan operator %(FrameSpan left, int right)

Parameters

left FrameSpan
right int

Returns

FrameSpan

operator *(FrameSpan, int)

static FrameSpan operator *(FrameSpan left, int right)

Parameters

left FrameSpan
right int

Returns

FrameSpan

operator -(FrameSpan, Frame)

static FrameSpan operator -(FrameSpan left, Frame right)

Parameters

left FrameSpan
right Frame

Returns

FrameSpan

operator -(FrameSpan, FrameSpan)

static FrameSpan operator -(FrameSpan left, FrameSpan right)

Parameters

left FrameSpan
right FrameSpan

Returns

FrameSpan

operator -(FrameSpan, int)

static FrameSpan operator -(FrameSpan left, int right)

Parameters

left FrameSpan
right int

Returns

FrameSpan