Lines Matching full:rational
203 class Rational {
205 Rational(void) : _n(0), _d(1) {}
206 Rational(uint32_t n, uint32_t d) : _n(n), _d(d) {}
211 bool operator==(const Rational& other) const;
212 bool operator!=(const Rational& other) const { return !(*this == other); }
213 bool operator<(const Rational& other) const;
214 bool operator>(const Rational& other) const {
218 Rational& lower, Rational& upper);
262 Rational hScale;
265 Rational vScale;
292 Rational scHScale(uint32_t format,
296 Rational scVScale(uint32_t format,
534 >= Rational(searchLimits.sourceCrop.width(),
549 >= Rational(searchLimits.sourceCrop.height(),
1085 // binary search of rational numbers. The numerator in each of the
1086 // rational numbers contains the dimension for the source crop, while
1091 // named double2Rational, which determines the closest rational numbers
1092 // just below and above the mid-point. By default the lower rational
1097 Rational scHScale(uint32_t format,
1103 Rational best(0, 1), minBad; // Current bounds for a binary search
1120 Rational lower, upper, selected;
1123 // TODO: Avoid rounding issue by using Rational type for
1128 Rational::double2Rational(mid,
1153 num, (float) Rational(scDim.width(), dfDim.width()),
1165 if (firstPass) { return Rational(scDim.width(), dfDim.width()); }
1168 best = Rational(scDim.width(), dfDim.width());
1172 minBad = Rational(scDim.width(), dfDim.width());
1184 // binary search of rational numbers. The numerator in each of the
1185 // rational numbers contains the dimension for the source crop, while
1190 // named double2Rational, which determines the closest rational numbers
1191 // just below and above the mid-point. By default the lower rational
1196 Rational scVScale(uint32_t format,
1202 Rational best(0, 1), minBad; // Current bounds for a binary search
1219 Rational lower, upper, selected;
1222 // TODO: Avoid rounding issue by using Rational type for
1227 Rational::double2Rational(mid,
1252 num, (float) Rational(scDim.height(), dfDim.height()),
1264 if (firstPass) { return Rational(scDim.height(), dfDim.height()); }
1267 best = Rational(scDim.height(), dfDim.height());
1271 minBad = Rational(scDim.height(), dfDim.height());
1337 // Rational member functions
1338 bool Rational::operator==(const Rational& other) const
1346 bool Rational::operator<(const Rational& other) const
1354 Rational::operator string() const
1363 void Rational::double2Rational(double f, Range nRange, Range dRange,
1364 Rational& lower, Rational& upper)
1366 Rational bestLower(nRange.lower(), dRange.upper());
1367 Rational bestUpper(nRange.upper(), dRange.lower());
1371 Rational val(d * f, d); // Lower, because double to int cast truncates