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

Function Encode

libs/coding/geometry_coding.cpp:340–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338} // namespace pts
339
340void Encode(EncodeFunT fn, std::vector<m2::PointD> const & points, GeometryCodingParams const & params,
341 DeltasT & deltas)
342{
343 size_t const count = points.size();
344
345 pts::PointsU upoints;
346 upoints.reserve(count);
347
348 transform(points.begin(), points.end(), std::back_inserter(upoints),
349 std::bind(&pts::D2U, std::placeholders::_1, params.GetCoordBits()));
350
351 ASSERT(deltas.empty(), ());
352 deltas.resize(count);
353
354 coding::OutDeltasT adapt(deltas);
355 (*fn)(make_read_adapter(upoints), pts::GetBasePoint(params), pts::GetMaxPoint(params), adapt);
356}
357
358void Decode(DecodeFunT fn, DeltasT const & deltas, GeometryCodingParams const & params, OutPointsT & points,
359 size_t reserveF)

Callers

nothing calls this directly

Calls 11

ASSERTFunction · 0.85
make_read_adapterFunction · 0.85
GetBasePointFunction · 0.85
GetCoordBitsMethod · 0.80
GetMaxPointFunction · 0.70
sizeMethod · 0.45
reserveMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected