Each center is encoded as delta from some prediction. For the first center in the block map base point is used as a prediction, for all other centers in the block previous center is used as a prediction.
| 120 | // For the first center in the block map base point is used as a prediction, for all other |
| 121 | // centers in the block previous center is used as a prediction. |
| 122 | void CentersTableBuilder::WriteBlock(Writer & w, std::vector<m2::PointU>::const_iterator begin, |
| 123 | std::vector<m2::PointU>::const_iterator end) const |
| 124 | { |
| 125 | uint64_t delta = coding::EncodePointDeltaAsUint(*begin, m_codingParams.GetBasePoint()); |
| 126 | WriteVarUint(w, delta); |
| 127 | auto prevIt = begin; |
| 128 | for (auto it = begin + 1; it != end; ++it) |
| 129 | { |
| 130 | delta = coding::EncodePointDeltaAsUint(*it, *prevIt); |
| 131 | WriteVarUint(w, delta); |
| 132 | prevIt = it; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | void CentersTableBuilder::Freeze(Writer & writer) const |
| 137 | { |
nothing calls this directly
no test coverage detected