MCPcopy Create free account
hub / github.com/LAStools/LAStools / copy_point_to_buffer

Method copy_point_to_buffer

LASlib/src/lasreaderbuffered.cpp:530–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530BOOL 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
558BOOL LASreaderBuffered::copy_point_from_buffer()
559{

Callers

nothing calls this directly

Calls 2

malloc_lasFunction · 0.85
realloc_lasFunction · 0.85

Tested by

no test coverage detected