| 284 | |
| 285 | |
| 286 | void BpfWriter::writePointMajor(const PointView* data) |
| 287 | { |
| 288 | // Blocks of 10,000 points will ensure that we're under 16MB, even |
| 289 | // for 255 dimensions. |
| 290 | size_t blockpoints = std::min<point_count_t>(10000UL, data->size()); |
| 291 | |
| 292 | // For compression we're going to write to a buffer so that it can be |
| 293 | // compressed before it's written to the file stream. |
| 294 | BpfCompressor compressor(m_stream, |
| 295 | blockpoints * sizeof(float) * m_dims.size()); |
| 296 | PointId idx = 0; |
| 297 | while (idx < data->size()) |
| 298 | { |
| 299 | if (m_header.m_compression) |
| 300 | compressor.startBlock(); |
| 301 | size_t blockId; |
| 302 | for (blockId = 0; idx < data->size() && blockId < blockpoints; |
| 303 | ++idx, ++blockId) |
| 304 | { |
| 305 | for (auto & bpfDim : m_dims) |
| 306 | { |
| 307 | double d = getAdjustedValue(data, bpfDim, idx); |
| 308 | m_stream << (float)d; |
| 309 | } |
| 310 | } |
| 311 | if (m_header.m_compression) |
| 312 | { |
| 313 | compressor.compress(); |
| 314 | compressor.finish(); |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | |
| 320 | void BpfWriter::writeDimMajor(const PointView* data) |
nothing calls this directly
no test coverage detected