Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FFrameRate Struct Reference

#include <FrameRate.h>

Public Member Functions

 FFrameRate ()
 
 FFrameRate (uint32 InNumerator, uint32 InDenominator)
 
bool IsValid () const
 
double AsInterval () const
 
double AsDecimal () const
 
double AsSeconds (FFrameTime FrameNumber) const
 
FFrameTime AsFrameTime (double InTimeSeconds) const
 
FFrameNumber AsFrameNumber (double InTimeSeconds) const
 
bool IsMultipleOf (FFrameRate Other) const
 
bool IsFactorOf (FFrameRate Other) const
 
FText ToPrettyText () const
 
bool ComputeGridSpacing (const float PixelsPerSecond, double &OutMajorInterval, int32 &OutMinorDivisions, float MinTickPx=30.f, float DesiredMajorTickPx=120.f) const
 
double MaxSeconds () const
 
FFrameRate Reciprocal () const
 
bool Serialize (FArchive &Ar)
 

Static Public Member Functions

static FFrameTime TransformTime (FFrameTime SourceTime, FFrameRate SourceRate, FFrameRate DestinationRate)
 
static FFrameTime Snap (FFrameTime SourceTime, FFrameRate SourceRate, FFrameRate SnapToRate)
 

Public Attributes

int32 Numerator
 
int32 Denominator
 

Friends

bool operator== (const FFrameRate &A, const FFrameRate &B)
 
bool operator!= (const FFrameRate &A, const FFrameRate &B)
 
FFrameRate operator* (FFrameRate A, FFrameRate B)
 
FFrameRate operator/ (FFrameRate A, FFrameRate B)
 
double operator/ (FFrameNumber Frame, FFrameRate Rate)
 
TRange< doubleoperator/ (const TRange< FFrameNumber > &FrameRange, FFrameRate Rate)
 
double operator/ (FFrameTime FrameTime, FFrameRate Rate)
 
FFrameTime operator* (double TimeInSeconds, FFrameRate Rate)
 
FFrameTime operator* (float TimeInSeconds, FFrameRate Rate)
 
FArchiveoperator<< (FArchive &Ar, FFrameRate &FrameRate)
 

Detailed Description

A frame rate represented as a fraction comprising 2 integers: a numerator (number of frames), and a denominator (per second)

Definition at line 21 of file FrameRate.h.

Constructor & Destructor Documentation

◆ FFrameRate() [1/2]

FFrameRate::FFrameRate ( )
inline

Default construction to a frame rate of 60000 frames per second (0.0166 ms)

Definition at line 26 of file FrameRate.h.

◆ FFrameRate() [2/2]

FFrameRate::FFrameRate ( uint32 InNumerator,
uint32 InDenominator )
inline

Definition at line 30 of file FrameRate.h.

+ Here is the caller graph for this function:

Member Function Documentation

◆ AsDecimal()

double FFrameRate::AsDecimal ( ) const
inline

Get the decimal representation of this framerate

Returns
The number of frames per second

Definition at line 221 of file FrameRate.h.

+ Here is the caller graph for this function:

◆ AsFrameNumber()

FFrameNumber FFrameRate::AsFrameNumber ( double InTimeSeconds) const
inline

Convert the specified time in seconds to a frame number by rounding down to the nearest integer.

Parameters
InTimeSecondsThe time to convert in seconds
Returns
A frame number that represents the supplied time. Rounded down to the nearest integer.

Definition at line 252 of file FrameRate.h.

◆ AsFrameTime()

FFrameTime FFrameRate::AsFrameTime ( double InTimeSeconds) const
inline

Convert the specified time in seconds to a frame number by rounding down to the nearest integer.

Parameters
InTimeSecondsThe time to convert in seconds
Returns
A frame number that represents the supplied time. Rounded down to the nearest integer.

Definition at line 234 of file FrameRate.h.

+ Here is the call graph for this function:

◆ AsInterval()

double FFrameRate::AsInterval ( ) const
inline

Get the decimal representation of this framerate's interval

Returns
The time in seconds for a single frame under this frame rate

Definition at line 216 of file FrameRate.h.

+ Here is the caller graph for this function:

◆ AsSeconds()

double FFrameRate::AsSeconds ( FFrameTime FrameNumber) const
inline

Convert the specified frame number to a floating-point number of seconds based on this framerate

Parameters
FrameNumberThe frame number to convert
Returns
The number of seconds that the specified frame number represents

Definition at line 226 of file FrameRate.h.

+ Here is the call graph for this function:

◆ ComputeGridSpacing()

bool FFrameRate::ComputeGridSpacing ( const float PixelsPerSecond,
double & OutMajorInterval,
int32 & OutMinorDivisions,
float MinTickPx = 30.f,
float DesiredMajorTickPx = 120.f ) const

Compute a desirable grid spacing for the specified screen units

Parameters
PixelsPerSecondThe number of pixels representing a second of time
OutMajorInterval(Out) The interval in seconds at which to draw major grid lines
OutMinorDivisions(Out) The number of divisions to draw between major tick lines
MinTickPx(Optional) The smallest size in pixels that is desirable between ticks
DesiredMajorTickPx(Optional) The desired size to compute major tick lines from
Returns
True if a valid grid spacing was computed, false otherwise.

◆ IsFactorOf()

bool FFrameRate::IsFactorOf ( FFrameRate Other) const
inline

Check whether this frame rate is a factor of another

Definition at line 311 of file FrameRate.h.

+ Here is the call graph for this function:

◆ IsMultipleOf()

bool FFrameRate::IsMultipleOf ( FFrameRate Other) const
inline

Check whether this frame rate is a multiple of another

Definition at line 303 of file FrameRate.h.

+ Here is the caller graph for this function:

◆ IsValid()

bool FFrameRate::IsValid ( ) const
inline

Verify that this frame rate is valid to use

Definition at line 47 of file FrameRate.h.

◆ MaxSeconds()

double FFrameRate::MaxSeconds ( ) const

Get the maximum number of seconds representable with this framerate

◆ Reciprocal()

FFrameRate FFrameRate::Reciprocal ( ) const
inline

Get the reciprocal of this frame rate

Definition at line 146 of file FrameRate.h.

+ Here is the call graph for this function:

◆ Serialize()

bool FFrameRate::Serialize ( FArchive & Ar)

◆ Snap()

FFrameTime FFrameRate::Snap ( FFrameTime SourceTime,
FFrameRate SourceRate,
FFrameRate SnapToRate )
inlinestatic

Snap a time specified in one framerate, to another

Parameters
SourceTimeThe frame number to convert
SourceRateThe source frame rate
SnapToRateThe destination frame rate
Returns
A frame time in the destination frame rate

Definition at line 298 of file FrameRate.h.

+ Here is the call graph for this function:

◆ ToPrettyText()

FText FFrameRate::ToPrettyText ( ) const

Convert this frame rate to a prettified text string.

Note
: Does not check against decorated frame rate names in FCommonFrameRates

◆ TransformTime()

FFrameTime FFrameRate::TransformTime ( FFrameTime SourceTime,
FFrameRate SourceRate,
FFrameRate DestinationRate )
inlinestatic

Convert the specified time from one framerate to another framerate

Parameters
SourceTimeThe frame number to convert
SourceRateThe source frame rate
DestinationRateThe destination frame rate
Returns
A frame time in the destination frame rate

Definition at line 293 of file FrameRate.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const FFrameRate & A,
const FFrameRate & B )
friend

Definition at line 156 of file FrameRate.h.

◆ operator* [1/3]

FFrameTime operator* ( double TimeInSeconds,
FFrameRate Rate )
friend

Definition at line 201 of file FrameRate.h.

◆ operator* [2/3]

Definition at line 161 of file FrameRate.h.

◆ operator* [3/3]

FFrameTime operator* ( float TimeInSeconds,
FFrameRate Rate )
friend

Definition at line 206 of file FrameRate.h.

◆ operator/ [1/4]

TRange< double > operator/ ( const TRange< FFrameNumber > & FrameRange,
FFrameRate Rate )
friend

Definition at line 176 of file FrameRate.h.

◆ operator/ [2/4]

double operator/ ( FFrameNumber Frame,
FFrameRate Rate )
friend

Definition at line 171 of file FrameRate.h.

◆ operator/ [3/4]

Definition at line 166 of file FrameRate.h.

◆ operator/ [4/4]

double operator/ ( FFrameTime FrameTime,
FFrameRate Rate )
friend

Definition at line 196 of file FrameRate.h.

◆ operator<<

FArchive & operator<< ( FArchive & Ar,
FFrameRate & FrameRate )
friend

◆ operator==

bool operator== ( const FFrameRate & A,
const FFrameRate & B )
friend

Definition at line 151 of file FrameRate.h.

Member Data Documentation

◆ Denominator

int32 FFrameRate::Denominator

The denominator of the framerate represented as a number of frames per second (e.g. 1 for 60 fps)

Definition at line 42 of file FrameRate.h.

◆ Numerator

int32 FFrameRate::Numerator

The numerator of the framerate represented as a number of frames per second (e.g. 60 for 60 fps)

Definition at line 37 of file FrameRate.h.


The documentation for this struct was generated from the following file: