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

Method copyDataToBuffer

plugins/tiledb/io/TileDBUtils.cpp:555–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555void BitFieldsBuffer::copyDataToBuffer(PointRef& point, size_t index)
556{
557 // Get bit field data. Set to zero if bit field does not exist in table.
558 std::array<uint8_t, 6> unpacked{};
559 if (m_ids[0].has_value())
560 unpacked[0] = point.getFieldAs<uint8_t>(m_ids[0].value()) & 0x0F;
561 if (m_ids[1].has_value())
562 unpacked[1] = (point.getFieldAs<uint8_t>(m_ids[1].value()) & 0x0F) << 4;
563 if (m_ids[2].has_value())
564 unpacked[2] = point.getFieldAs<uint8_t>(m_ids[2].value()) & 0x0F;
565 if (m_ids[3].has_value())
566 unpacked[3] = (point.getFieldAs<uint8_t>(m_ids[3].value()) & 0x03) << 4;
567 if (m_ids[4].has_value())
568 unpacked[4] = (point.getFieldAs<uint8_t>(m_ids[4].value()) & 0x01) << 6;
569 if (m_ids[5].has_value())
570 unpacked[5] = (point.getFieldAs<uint8_t>(m_ids[5].value()) & 0x01) << 7;
571
572 // Set the 2 bytes of data in the buffer.
573 auto value1 = static_cast<uint16_t>(unpacked[0] | unpacked[1]) << 8;
574 auto value2 = static_cast<uint16_t>(unpacked[2] | unpacked[3] |
575 unpacked[4] | unpacked[5]);
576 m_data[index] = value1 | value2;
577}
578
579void BitFieldsBuffer::copyDataToPoint(PointRef& point, size_t index)
580{

Callers 1

processOneMethod · 0.45

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected