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

Function write_laszip_vlr_payload

LASzip/src/laszip_dll.cpp:2496–2592  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

2494
2495/*---------------------------------------------------------------------------*/
2496static I32
2497write_laszip_vlr_payload(
2498 laszip_dll_struct* laszip_dll
2499 , const LASzip* laszip
2500 , ByteStreamOut* out
2501)
2502{
2503 // write the LASzip VLR payload
2504
2505 // U16 compressor 2 bytes
2506 // U32 coder 2 bytes
2507 // U8 version_major 1 byte
2508 // U8 version_minor 1 byte
2509 // U16 version_revision 2 bytes
2510 // U32 options 4 bytes
2511 // I32 chunk_size 4 bytes
2512 // I64 number_of_special_evlrs 8 bytes
2513 // I64 offset_to_special_evlrs 8 bytes
2514 // U16 num_items 2 bytes
2515 // U16 type 2 bytes * num_items
2516 // U16 size 2 bytes * num_items
2517 // U16 version 2 bytes * num_items
2518 // which totals 34+6*num_items
2519
2520 try { out->put16bitsLE((const U8*)&(laszip->compressor)); } catch(...)
2521 {
2522 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing compressor %d", (I32)laszip->compressor);
2523 return 1;
2524 }
2525 try { out->put16bitsLE((const U8*)&(laszip->coder)); } catch(...)
2526 {
2527 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing coder %d", (I32)laszip->coder);
2528 return 1;
2529 }
2530 try { out->putBytes((const U8*)&(laszip->version_major), 1); } catch(...)
2531 {
2532 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing version_major %d", (I32)laszip->version_major);
2533 return 1;
2534 }
2535 try { out->putBytes((const U8*)&(laszip->version_minor), 1); } catch(...)
2536 {
2537 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing version_minor %d", (I32)laszip->version_minor);
2538 return 1;
2539 }
2540 try { out->put16bitsLE((const U8*)&(laszip->version_revision)); } catch(...)
2541 {
2542 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing version_revision %d", (I32)laszip->version_revision);
2543 return 1;
2544 }
2545 try { out->put32bitsLE((const U8*)&(laszip->options)); } catch(...)
2546 {
2547 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing options %u", laszip->options);
2548 return 1;
2549 }
2550 try { out->put32bitsLE((const U8*)&(laszip->chunk_size)); } catch(...)
2551 {
2552 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing chunk_size %u", laszip->chunk_size);
2553 return 1;

Callers 2

laszip_write_headerFunction · 0.85

Calls 4

put16bitsLEMethod · 0.45
putBytesMethod · 0.45
put32bitsLEMethod · 0.45
put64bitsLEMethod · 0.45

Tested by

no test coverage detected