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

Function demzip_write_header

LASlib/src/demzip_dll.cpp:2378–2756  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2376
2377/*---------------------------------------------------------------------------*/
2378static I32
2379demzip_write_header(
2380 demzip_dll_struct* demzip_dll
2381 , const LASzip* laszip
2382 , const demzip_BOOL compress
2383)
2384{
2385 U32 i;
2386
2387 try { demzip_dll->streamout->putBytes((const U8*)"LASF", 4); } catch(...)
2388 {
2389 sprintf(demzip_dll->error, "writing header.file_signature");
2390 return 1;
2391 }
2392 try { demzip_dll->streamout->put16bitsLE((const U8*)&(demzip_dll->header.file_source_ID)); } catch(...)
2393 {
2394 sprintf(demzip_dll->error, "writing header.file_source_ID");
2395 return 1;
2396 }
2397 try { demzip_dll->streamout->put16bitsLE((const U8*)&(demzip_dll->header.global_encoding)); } catch(...)
2398 {
2399 sprintf(demzip_dll->error, "writing header.global_encoding");
2400 return 1;
2401 }
2402 try { demzip_dll->streamout->put32bitsLE((const U8*)&(demzip_dll->header.project_ID_GUID_data_1)); } catch(...)
2403 {
2404 sprintf(demzip_dll->error, "writing header.project_ID_GUID_data_1");
2405 return 1;
2406 }
2407 try { demzip_dll->streamout->put16bitsLE((const U8*)&(demzip_dll->header.project_ID_GUID_data_2)); } catch(...)
2408 {
2409 sprintf(demzip_dll->error, "writing header.project_ID_GUID_data_2");
2410 return 1;
2411 }
2412 try { demzip_dll->streamout->put16bitsLE((const U8*)&(demzip_dll->header.project_ID_GUID_data_3)); } catch(...)
2413 {
2414 sprintf(demzip_dll->error, "writing header.project_ID_GUID_data_3");
2415 return 1;
2416 }
2417 try { demzip_dll->streamout->putBytes((const U8*)demzip_dll->header.project_ID_GUID_data_4, 8); } catch(...)
2418 {
2419 sprintf(demzip_dll->error, "writing header.project_ID_GUID_data_4");
2420 return 1;
2421 }
2422 try { demzip_dll->streamout->putBytes((const U8*)&(demzip_dll->header.version_major), 1); } catch(...)
2423 {
2424 sprintf(demzip_dll->error, "writing header.version_major");
2425 return 1;
2426 }
2427 try { demzip_dll->streamout->putBytes((const U8*)&(demzip_dll->header.version_minor), 1); } catch(...)
2428 {
2429 sprintf(demzip_dll->error, "writing header.version_minor");
2430 return 1;
2431 }
2432 try { demzip_dll->streamout->putBytes((const U8*)demzip_dll->header.system_identifier, 32); } catch(...)
2433 {
2434 sprintf(demzip_dll->error, "writing header.system_identifier");
2435 return 1;

Calls 7

demzip_vrl_payload_sizeFunction · 0.85
write_demzip_vlr_headerFunction · 0.85
write_demzip_vlr_payloadFunction · 0.85
putBytesMethod · 0.45
put16bitsLEMethod · 0.45
put32bitsLEMethod · 0.45
put64bitsLEMethod · 0.45

Tested by

no test coverage detected