Home | History | Annotate | Download | only in hwc

Lines Matching full:rational

204 class Rational {
206 Rational(void) : _n(0), _d(1) {}
207 Rational(uint32_t n, uint32_t d) : _n(n), _d(d) {}
212 bool operator==(const Rational& other) const;
213 bool operator!=(const Rational& other) const { return !(*this == other); }
214 bool operator<(const Rational& other) const;
215 bool operator>(const Rational& other) const {
219 Rational& lower, Rational& upper);
263 Rational hScale;
266 Rational vScale;
293 Rational scHScale(uint32_t format,
297 Rational scVScale(uint32_t format,
536 >= Rational(searchLimits.sourceCrop.width(),
551 >= Rational(searchLimits.sourceCrop.height(),
1087 // binary search of rational numbers. The numerator in each of the
1088 // rational numbers contains the dimension for the source crop, while
1093 // named double2Rational, which determines the closest rational numbers
1094 // just below and above the mid-point. By default the lower rational
1099 Rational scHScale(uint32_t format,
1105 Rational best(0, 1), minBad; // Current bounds for a binary search
1122 Rational lower, upper, selected;
1125 // TODO: Avoid rounding issue by using Rational type for
1130 Rational::double2Rational(mid,
1155 num, (float) Rational(scDim.width(), dfDim.width()),
1167 if (firstPass) { return Rational(scDim.width(), dfDim.width()); }
1170 best = Rational(scDim.width(), dfDim.width());
1174 minBad = Rational(scDim.width(), dfDim.width());
1186 // binary search of rational numbers. The numerator in each of the
1187 // rational numbers contains the dimension for the source crop, while
1192 // named double2Rational, which determines the closest rational numbers
1193 // just below and above the mid-point. By default the lower rational
1198 Rational scVScale(uint32_t format,
1204 Rational best(0, 1), minBad; // Current bounds for a binary search
1221 Rational lower, upper, selected;
1224 // TODO: Avoid rounding issue by using Rational type for
1229 Rational::double2Rational(mid,
1254 num, (float) Rational(scDim.height(), dfDim.height()),
1266 if (firstPass) { return Rational(scDim.height(), dfDim.height()); }
1269 best = Rational(scDim.height(), dfDim.height());
1273 minBad = Rational(scDim.height(), dfDim.height());
1339 // Rational member functions
1340 bool Rational::operator==(const Rational& other) const
1348 bool Rational::operator<(const Rational& other) const
1356 Rational::operator string() const
1365 void Rational::double2Rational(double f, Range nRange, Range dRange,
1366 Rational& lower, Rational& upper)
1368 Rational bestLower(nRange.lower(), dRange.upper());
1369 Rational bestUpper(nRange.upper(), dRange.lower());
1373 Rational val(d * f, d); // Lower, because double to int cast truncates