MCPcopy Create free account
hub / github.com/comaps/comaps / EncodePointDelta

Function EncodePointDelta

libs/coding/geometry_coding.hpp:36–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34// Writes the difference of two 2d vectors to sink.
35template <typename Sink>
36void EncodePointDelta(Sink & sink, m2::PointU const & curr, m2::PointU const & next)
37{
38 auto const dx = base::asserted_cast<int32_t>(next.x) - base::asserted_cast<int32_t>(curr.x);
39 auto const dy = base::asserted_cast<int32_t>(next.y) - base::asserted_cast<int32_t>(curr.y);
40 WriteVarInt(sink, dx);
41 WriteVarInt(sink, dy);
42}
43
44// Reads the encoded difference from |source| and returns the
45// point equal to |base| + difference.

Callers 1

SavePointsSequenceMethod · 0.85

Calls 1

WriteVarIntFunction · 0.85

Tested by

no test coverage detected