MCPcopy Create free account
hub / github.com/PDAL/PDAL / toExtraDims

Method toExtraDims

io/private/las/Utils.cpp:311–347  ·  view source on GitHub ↗

NOTE: You must make sure that bufsize is a multiple of ExtraBytesSpecSize before calling.

Source from the content-addressed store, hash-verified

309
310// NOTE: You must make sure that bufsize is a multiple of ExtraBytesSpecSize before calling.
311std::vector<ExtraDim> ExtraBytesIf::toExtraDims(const char *buf, size_t bufsize, int baseSize)
312{
313 std::vector<ExtraDim> eds;
314
315 int byteOffset = baseSize;
316 while (bufsize)
317 {
318 ExtraBytesIf spec;
319 spec.readFrom(buf);
320
321 if (spec.m_type == Dimension::Type::None)
322 {
323 ExtraDim ed(spec.m_name, spec.m_size, byteOffset);
324 eds.push_back(ed);
325 byteOffset += ed.m_size;
326 }
327 else if (spec.m_fieldCnt == 1)
328 {
329 ExtraDim ed(spec.m_name, spec.m_type, byteOffset, spec.m_scale[0], spec.m_offset[0]);
330 eds.push_back(ed);
331 byteOffset += ed.m_size;
332 }
333 else
334 {
335 for (size_t i = 0; i < spec.m_fieldCnt; ++i)
336 {
337 ExtraDim ed(spec.m_name + std::to_string(i), spec.m_type, byteOffset,
338 spec.m_scale[i], spec.m_offset[i]);
339 eds.push_back(ed);
340 byteOffset += ed.m_size;
341 }
342 }
343 bufsize -= ExtraBytesSpecSize;
344 buf += ExtraBytesSpecSize;
345 }
346 return eds;
347}
348
349
350const Dimension::IdList& pdrfDims(int pdrf)

Callers

nothing calls this directly

Calls 1

readFromMethod · 0.80

Tested by

no test coverage detected