| 341 | |
| 342 | |
| 343 | void 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 | |
| 377 | double BpfWriter::getAdjustedValue(const PointView* data, |
nothing calls this directly
no test coverage detected