UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FFrameRate Struct Reference

#include <FrameRate.h>

+ Inheritance diagram for FFrameRate:

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
 
CORE_API FText ToPrettyText () const
 
CORE_API bool ComputeGridSpacing (const float PixelsPerSecond, double &OutMajorInterval, int32 &OutMinorDivisions, float MinTickPx=30.f, float DesiredMajorTickPx=120.f) const
 
CORE_API double MaxSeconds () const
 
FFrameRate Reciprocal () const
 
CORE_API 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)
 
uint32 GetTypeHash (const FFrameRate &Rate)
 
CORE_API 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)

Constructor & Destructor Documentation

◆ FFrameRate() [1/2]

FFrameRate::FFrameRate ( )
inline

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

◆ FFrameRate() [2/2]

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

Member Function Documentation

◆ AsDecimal()

double FFrameRate::AsDecimal ( ) const
inline

Get the decimal representation of this framerate

Returns
The number of frames per second

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

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

◆ 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

◆ 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

◆ 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

◆ IsMultipleOf()

bool FFrameRate::IsMultipleOf ( FFrameRate  Other) const
inline

Check whether this frame rate is a multiple of another

◆ IsValid()

bool FFrameRate::IsValid ( ) const
inline

Verify that this frame rate is valid to use

◆ 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

◆ 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

◆ 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

Friends And Related Symbol Documentation

◆ GetTypeHash

uint32 GetTypeHash ( const FFrameRate Rate)
friend

◆ operator!=

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

◆ operator* [1/3]

FFrameTime operator* ( double  TimeInSeconds,
FFrameRate  Rate 
)
friend

◆ operator* [2/3]

FFrameRate operator* ( FFrameRate  A,
FFrameRate  B 
)
friend

◆ operator* [3/3]

FFrameTime operator* ( float  TimeInSeconds,
FFrameRate  Rate 
)
friend

◆ operator/ [1/4]

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

◆ operator/ [2/4]

double operator/ ( FFrameNumber  Frame,
FFrameRate  Rate 
)
friend

◆ operator/ [3/4]

FFrameRate operator/ ( FFrameRate  A,
FFrameRate  B 
)
friend

◆ operator/ [4/4]

double operator/ ( FFrameTime  FrameTime,
FFrameRate  Rate 
)
friend

◆ operator<<

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

◆ operator==

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

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)

◆ Numerator

int32 FFrameRate::Numerator

IMPORTANT: If you change the struct data, ensure that you also update the version in NoExportTypes.h
The numerator of the framerate represented as a number of frames per second (e.g. 60 for 60 fps)


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