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

Method writeByteMajor

io/BpfWriter.cpp:343–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341
342
343void BpfWriter::writeByteMajor(const PointView* data)
344{
345 union
346 {
347 float f;
348 uint32_t u32;
349 } uu;
350
351 // We're going to pretend for now that we only ever have one point buffer.
352 BpfCompressor compressor(m_stream,
353 data->size() * sizeof(float) * m_dims.size());
354
355 if (m_header.m_compression)
356 compressor.startBlock();
357 for (auto & bpfDim : m_dims)
358 {
359 for (size_t b = 0; b < sizeof(float); b++)
360 {
361 for (PointId idx = 0; idx < data->size(); ++idx)
362 {
363 uu.f = (float)getAdjustedValue(data, bpfDim, idx);
364 uint8_t u8 = (uint8_t)(uu.u32 >> (b * CHAR_BIT));
365 m_stream << u8;
366 }
367 }
368 }
369 if (m_header.m_compression)
370 {
371 compressor.compress();
372 compressor.finish();
373 }
374}
375
376
377double BpfWriter::getAdjustedValue(const PointView* data,

Callers

nothing calls this directly

Calls 4

startBlockMethod · 0.80
sizeMethod · 0.45
compressMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected