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

Method copyDataToPoint

plugins/tiledb/io/TileDBUtils.cpp:579–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579void BitFieldsBuffer::copyDataToPoint(PointRef& point, size_t index)
580{
581 // Read the 2 uint8_t values that store the packed bits.
582 const uint16_t full_value = m_data[index];
583 const auto value1 = static_cast<uint8_t>(0xFF & (full_value >> 8));
584 const auto value2 = static_cast<uint8_t>(0xFF & full_value);
585
586 // Unpack the bits.
587 std::array<uint8_t, 6> unpacked{};
588 unpacked[0] = value1 & 0x0F;
589 unpacked[1] = (value1 >> 4) & 0x0F;
590 unpacked[2] = value2 & 0x0F;
591 unpacked[3] = (value2 >> 4) & 0x03;
592 unpacked[4] = (value2 >> 6) & 0x01;
593 unpacked[5] = (value2 >> 7) & 0x01;
594
595 // Set the dimension data on the PDAL point.
596 for (uint32_t index = 0; index < 6; ++index)
597 point.setField(m_ids[index].value(), unpacked[index]);
598}
599
600const std::string& BitFieldsBuffer::name() const
601{

Callers 1

processPointMethod · 0.45

Calls 2

setFieldMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected