| 577 | } |
| 578 | |
| 579 | void 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 | |
| 600 | const std::string& BitFieldsBuffer::name() const |
| 601 | { |
no test coverage detected