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

Function EncodePolylinePrev2

libs/coding/geometry_coding.cpp:132–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132void EncodePolylinePrev2(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint,
133 OutDeltasT & deltas)
134{
135 size_t const count = points.size();
136 if (count > 0)
137 {
138 deltas.push_back(EncodePointDeltaAsUint(points[0], basePoint));
139 if (count > 1)
140 {
141 m2::PointD const maxPointD(maxPoint);
142 deltas.push_back(EncodePointDeltaAsUint(points[1], points[0]));
143 for (size_t i = 2; i < count; ++i)
144 deltas.push_back(
145 EncodePointDeltaAsUint(points[i], PredictPointInPolyline(maxPointD, points[i - 1], points[i - 2])));
146 }
147 }
148
149 ASSERT(TestDecoding(points, basePoint, maxPoint, deltas, &DecodePolylinePrev2), ());
150}
151
152void DecodePolylinePrev2(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint,
153 OutPointsT & points)

Callers 1

EncodePolylineFunction · 0.85

Calls 6

EncodePointDeltaAsUintFunction · 0.85
PredictPointInPolylineFunction · 0.85
ASSERTFunction · 0.85
TestDecodingFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected