31#ifndef OPENSHOT_FRACTION_H
32#define OPENSHOT_FRACTION_H
66 Fraction(std::map<std::string, int> mapping);
This class represents a fraction.
int num
Numerator for the fraction.
Fraction()
Default Constructor.
float ToFloat()
Return this fraction as a float (i.e. 1/2 = 0.5)
double ToDouble() const
Return this fraction as a double (i.e. 1/2 = 0.5)
void Reduce()
Reduce this fraction (i.e. 640/480 = 4/3)
int ToInt()
Return a rounded integer of the fraction (for example 30000/1001 returns 30)
Fraction Reciprocal() const
Return the reciprocal as a Fraction.
int GreatestCommonDenominator()
Calculate the greatest common denominator.
int den
Denominator for the fraction.
This namespace is the default namespace for all code in the openshot library.