| 528 | } |
| 529 | |
| 530 | BOOL LASreaderBuffered::copy_point_to_buffer() |
| 531 | { |
| 532 | U32 point_count_in_buffer = (buffered_points % points_per_buffer); |
| 533 | if (point_count_in_buffer == 0) |
| 534 | { |
| 535 | if (buffers == 0) |
| 536 | { |
| 537 | size_of_buffers_array = 1024; |
| 538 | buffers = (U8**)malloc_las(sizeof(U8*) * size_of_buffers_array); |
| 539 | number_of_buffers = 0; |
| 540 | } |
| 541 | else if (number_of_buffers == size_of_buffers_array) |
| 542 | { |
| 543 | size_of_buffers_array *= 2; |
| 544 | buffers = (U8**)realloc_las(buffers, sizeof(U8*)*size_of_buffers_array); |
| 545 | } |
| 546 | if (buffers != nullptr) |
| 547 | { |
| 548 | buffers[number_of_buffers] = (U8*)malloc_las((size_t)point.total_point_size * (size_t)points_per_buffer); |
| 549 | current_buffer = buffers[number_of_buffers]; |
| 550 | } |
| 551 | number_of_buffers++; |
| 552 | } |
| 553 | if (current_buffer != nullptr) point.copy_to(&(current_buffer[point_count_in_buffer * point.total_point_size])); |
| 554 | buffered_points++; |
| 555 | return TRUE; |
| 556 | } |
| 557 | |
| 558 | BOOL LASreaderBuffered::copy_point_from_buffer() |
| 559 | { |
nothing calls this directly
no test coverage detected