MCPcopy Create free account
hub / github.com/LASzip/LASzip / read

Method read

src/lasreadpoint.cpp:408–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408BOOL LASreadPoint::read(U8* const * point)
409{
410 U32 i;
411 U32 context = 0;
412
413 try
414 {
415 if (dec)
416 {
417 if (chunk_count == chunk_size)
418 {
419 if (point_start != 0)
420 {
421 dec->done();
422 current_chunk++;
423 // check integrity
424 if (current_chunk < tabled_chunks)
425 {
426 I64 here = instream->tell();
427 if (chunk_starts[current_chunk] != here)
428 {
429 // previous chunk was corrupt
430 current_chunk--;
431 throw 4711;
432 }
433 }
434 }
435 init_dec();
436 if (current_chunk == tabled_chunks) // no or incomplete chunk table?
437 {
438 if (current_chunk >= number_chunks)
439 {
440 number_chunks += 256;
441 chunk_starts = (I64*)realloc_las(chunk_starts, sizeof(I64)*(number_chunks+1));
442 }
443 chunk_starts[tabled_chunks] = point_start; // needs fixing
444 tabled_chunks++;
445 }
446 else if (chunk_totals) // variable sized chunks?
447 {
448 chunk_size = chunk_totals[current_chunk+1]-chunk_totals[current_chunk];
449 }
450 chunk_count = 0;
451 }
452 chunk_count++;
453
454 if (readers)
455 {
456 for (i = 0; i < num_readers; i++)
457 {
458 readers[i]->read(point[i], context);
459 }
460 }
461 else
462 {
463 for (i = 0; i < num_readers; i++)
464 {
465 readers_raw[i]->read(point[i], context);

Callers

nothing calls this directly

Calls 7

realloc_lasFunction · 0.85
doneMethod · 0.45
tellMethod · 0.45
initMethod · 0.45
get32bitsLEMethod · 0.45
chunk_sizesMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected