Represents a video frame rate as a rational number. More...
#include <framerate.h>
Public Types | |
| enum | WellKnownRate { FPS_NotWellKnown = 0 , FPS_Invalid , FPS_60 , FPS_5994 , FPS_50 , FPS_30 , FPS_2997 , FPS_25 , FPS_24 , FPS_2398 } |
| Enumeration of well-known industry-standard frame rates. More... | |
| using | RationalType = Rational< unsigned int > |
| Underlying rational type used to store the frame rate. | |
Public Member Functions | |
| FrameRate ()=default | |
| Default constructor. Creates an invalid (zero) frame rate. | |
| FrameRate (WellKnownRate rate) | |
| Constructs a FrameRate from a well-known rate enum. | |
| FrameRate (const RationalType &r) | |
| Constructs a FrameRate from an arbitrary rational value. | |
| bool | isValid () const |
| Returns true if this frame rate is valid (numerator > 0). | |
| unsigned int | numerator () const |
| Returns the numerator of the frame rate rational. | |
| unsigned int | denominator () const |
| Returns the denominator of the frame rate rational. | |
| double | toDouble () const |
| Returns the frame rate as a double-precision floating point value. | |
| String | toString () const |
| Returns a string representation of the frame rate. | |
| bool | isWellKnownRate () const |
| Returns true if this is a well-known industry frame rate. | |
| WellKnownRate | wellKnownRate () const |
| Returns the WellKnownRate enum value for this frame rate. | |
Represents a video frame rate as a rational number.
FrameRate wraps a Rational value and provides an enumeration of well-known industry-standard frame rates (24, 25, 29.97, 30, etc.). A frame rate can be constructed from a WellKnownRate enum or from an arbitrary rational value.
| FrameRate::FrameRate | ( | WellKnownRate | rate | ) |
Constructs a FrameRate from a well-known rate enum.
| rate | The well-known rate to use. |
| FrameRate::FrameRate | ( | const RationalType & | r | ) |
Constructs a FrameRate from an arbitrary rational value.
| r | The rational frame rate (numerator / denominator). |
|
inline |
Returns true if this frame rate is valid (numerator > 0).
|
inline |
Returns true if this is a well-known industry frame rate.
|
inline |
Returns the frame rate as a double-precision floating point value.
|
inline |
Returns a string representation of the frame rate.
|
inline |
Returns the WellKnownRate enum value for this frame rate.