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

Function laszip_write_header

LASzip/src/laszip_dll.cpp:2595–2981  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2593
2594/*---------------------------------------------------------------------------*/
2595static I32
2596laszip_write_header(
2597 laszip_dll_struct* laszip_dll
2598 , const LASzip* laszip
2599 , const laszip_BOOL compress
2600)
2601{
2602 U32 i;
2603
2604 try { laszip_dll->streamout->putBytes((const U8*)"LASF", 4); } catch(...)
2605 {
2606 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.file_signature");
2607 return 1;
2608 }
2609 try { laszip_dll->streamout->put16bitsLE((const U8*)&(laszip_dll->header.file_source_ID)); } catch(...)
2610 {
2611 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.file_source_ID");
2612 return 1;
2613 }
2614 try { laszip_dll->streamout->put16bitsLE((const U8*)&(laszip_dll->header.global_encoding)); } catch(...)
2615 {
2616 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.global_encoding");
2617 return 1;
2618 }
2619 try { laszip_dll->streamout->put32bitsLE((const U8*)&(laszip_dll->header.project_ID_GUID_data_1)); } catch(...)
2620 {
2621 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.project_ID_GUID_data_1");
2622 return 1;
2623 }
2624 try { laszip_dll->streamout->put16bitsLE((const U8*)&(laszip_dll->header.project_ID_GUID_data_2)); } catch(...)
2625 {
2626 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.project_ID_GUID_data_2");
2627 return 1;
2628 }
2629 try { laszip_dll->streamout->put16bitsLE((const U8*)&(laszip_dll->header.project_ID_GUID_data_3)); } catch(...)
2630 {
2631 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.project_ID_GUID_data_3");
2632 return 1;
2633 }
2634 try { laszip_dll->streamout->putBytes((const U8*)laszip_dll->header.project_ID_GUID_data_4, 8); } catch(...)
2635 {
2636 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.project_ID_GUID_data_4");
2637 return 1;
2638 }
2639 try { laszip_dll->streamout->putBytes((const U8*)&(laszip_dll->header.version_major), 1); } catch(...)
2640 {
2641 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.version_major");
2642 return 1;
2643 }
2644 try { laszip_dll->streamout->putBytes((const U8*)&(laszip_dll->header.version_minor), 1); } catch(...)
2645 {
2646 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.version_minor");
2647 return 1;
2648 }
2649 try { laszip_dll->streamout->putBytes((const U8*)laszip_dll->header.system_identifier, 32); } catch(...)
2650 {
2651 snprintf(laszip_dll->error, sizeof(laszip_dll->error), "writing header.system_identifier");
2652 return 1;

Calls 7

laszip_vrl_payload_sizeFunction · 0.85
write_laszip_vlr_headerFunction · 0.85
write_laszip_vlr_payloadFunction · 0.85
putBytesMethod · 0.45
put16bitsLEMethod · 0.45
put32bitsLEMethod · 0.45
put64bitsLEMethod · 0.45

Tested by

no test coverage detected