23 #include <com/avpkit/core/FfmpegIncludes.h>
24 #include <com/avpkit/core/IRational.h>
26 namespace com {
namespace avpkit {
namespace core
31 VS_JNIUTILS_REFCOUNTED_OBJECT(
Rational);
40 virtual int32_t
reduce(int64_t num, int64_t den, int64_t max);
86 virtual int64_t
rescale(int64_t origValue,
90 static int64_t
rescale(int64_t srcValue,
92 int32_t dstDenominator,
94 int32_t srcDenominator,
108 AVRational mRational;
This class wraps represents a Rational number for the AVPKit.
static IRational * make()
Get a new rational that will be set to 0/0.
virtual void init()
Marks this object as finalized and immutable.
virtual IRational * multiply(IRational *arg)
Multiplies this number by arg.
virtual void setDenominator(int32_t value)
Sets the denominator on this object.
virtual double getValue()
An alias for getDouble() but matching JavaBean conventions.
virtual double getDouble()
Rational to double conversion.
virtual int32_t getDenominator()
Get the denominator for this rational.
virtual int32_t reduce(int64_t num, int64_t den, int64_t max)
Reduce a fraction to it's lowest common denominators.
virtual void setValue(double value)
Sets the numerator and denominator on this object by reducing the double to the closest integer numer...
virtual IRational * divide(IRational *arg)
Divides this rational by arg.
virtual int64_t rescale(int64_t origValue, IRational *origBase)
Takes a value scaled in increments of origBase and gives the equivalent value scaled in terms of this...
virtual void setNumerator(int32_t value)
Sets the numerator on this object.
virtual IRational * add(IRational *arg)
Adds arg to this rational.
virtual int32_t compareTo(IRational *other)
Compare a rational to this rational.
virtual bool isFinalized()
Returns true if init() has been called and this object is now considered finalized and immutable.
virtual int32_t getNumerator()
Get the numerator for this rational.
virtual IRational * subtract(IRational *arg)
Subtracts arg from this rational.
virtual IRational * copy()
Creates a new IRational object by copying (by value) this object.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...