16#define PROMEKI_WELL_KNOWN_FRAME_RATES \
17 X(FPS_Invalid, "INV", 0, 1) \
18 X(FPS_60, "60", 60, 1) \
19 X(FPS_5994, "59.94", 60000, 1001) \
20 X(FPS_50, "50", 50, 1) \
21 X(FPS_30, "30", 30, 1) \
22 X(FPS_2997, "29.97", 30000, 1001) \
23 X(FPS_25, "25", 25, 1) \
24 X(FPS_24, "24", 24, 1) \
25 X(FPS_2398, "23.98", 24000, 1001)
41#define X(type, string, num, den) type,
45 PROMEKI_WELL_KNOWN_FRAME_RATES
Represents a video frame rate as a rational number.
Definition framerate.h:36
WellKnownRate
Enumeration of well-known industry-standard frame rates.
Definition framerate.h:43
@ FPS_NotWellKnown
Not a well-known rate.
Definition framerate.h:44
double toDouble() const
Returns the frame rate as a double-precision floating point value.
Definition framerate.h:80
bool isWellKnownRate() const
Returns true if this is a well-known industry frame rate.
Definition framerate.h:92
bool isValid() const
Returns true if this frame rate is valid (numerator > 0).
Definition framerate.h:68
unsigned int numerator() const
Returns the numerator of the frame rate rational.
Definition framerate.h:71
FrameRate()=default
Default constructor. Creates an invalid (zero) frame rate.
WellKnownRate wellKnownRate() const
Returns the WellKnownRate enum value for this frame rate.
Definition framerate.h:98
String toString() const
Returns a string representation of the frame rate.
Definition framerate.h:86
FrameRate(const RationalType &r)
Constructs a FrameRate from an arbitrary rational value.
FrameRate(WellKnownRate rate)
Constructs a FrameRate from a well-known rate enum.
unsigned int denominator() const
Returns the denominator of the frame rate rational.
Definition framerate.h:74
Rational< unsigned int > RationalType
Underlying rational type used to store the frame rate.
Definition framerate.h:39
Dynamic array container wrapping std::vector.
Definition list.h:40
T numerator() const
Returns the numerator.
Definition rational.h:112
double toDouble() const
Converts to double.
Definition rational.h:121
String toString() const
Converts to a String in "num/den" format.
Definition rational.h:127
T denominator() const
Returns the denominator.
Definition rational.h:115
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19