| 38 | } |
| 39 | |
| 40 | double Uint32ToDouble(uint32_t x, double min, double max, uint8_t coordBits) |
| 41 | { |
| 42 | ASSERT_LESS_OR_EQUAL(min, max, ()); |
| 43 | |
| 44 | double const coordSize = CoordSize(coordBits); |
| 45 | auto const d = min + static_cast<double>(x) * (max - min) / coordSize; |
| 46 | |
| 47 | // It doesn't work now because of fancy serialization of m2::DiamondBox. |
| 48 | /// @todo Check PathsThroughLayers search test. Refactor CitiesBoundariesSerDes. |
| 49 | // ASSERT_LESS_OR_EQUAL(x, coordSize, (d, min, max, coordBits)); |
| 50 | |
| 51 | // It doesn't work because of possible floating errors. |
| 52 | // ASSERT(d >= min && d <= max, (d, x, min, max, coordBits)); |
| 53 | |
| 54 | return math::Clamp(d, min, max); |
| 55 | } |
| 56 | |
| 57 | m2::PointU PointDToPointU(double x, double y, uint8_t coordBits) |
| 58 | { |
no test coverage detected