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

Method readFrom

io/private/las/Utils.cpp:270–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270void ExtraBytesIf::readFrom(const char *buf)
271{
272 LeExtractor extractor(buf, ExtraBytesSpecSize);
273 uint16_t dummy16;
274 uint32_t dummy32;
275 uint64_t dummy64;
276 double dummyd;
277 uint8_t options;
278 uint8_t type;
279
280 uint8_t SCALE_MASK = 1 << 3;
281 uint8_t OFFSET_MASK = 1 << 4;
282
283 extractor >> dummy16 >> type >> options;
284 extractor.get(m_name, 32);
285 extractor >> dummy32;
286 for (size_t i = 0; i < 3; ++i)
287 extractor >> dummy64; // No data field.
288 for (size_t i = 0; i < 3; ++i)
289 extractor >> dummyd; // Min.
290 for (size_t i = 0; i < 3; ++i)
291 extractor >> dummyd; // Max.
292 for (size_t i = 0; i < 3; ++i)
293 extractor >> m_scale[i];
294 for (size_t i = 0; i < 3; ++i)
295 extractor >> m_offset[i];
296 extractor.get(m_description, 32);
297
298 setType(type);
299 if (m_type == Dimension::Type::None)
300 m_size = options;
301 if (!(options & SCALE_MASK))
302 for (size_t i = 0; i < 3; ++i)
303 m_scale[i] = 1.0;
304 if (!(options & OFFSET_MASK))
305 for (size_t i = 0; i < 3; ++i)
306 m_offset[i] = 0.0;
307}
308
309
310// NOTE: You must make sure that bufsize is a multiple of ExtraBytesSpecSize before calling.

Callers 1

toExtraDimsMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected