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

Function write_demzip_vlr_payload

LASlib/src/demzip_dll.cpp:2279–2375  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2277
2278/*---------------------------------------------------------------------------*/
2279static I32
2280write_demzip_vlr_payload(
2281 demzip_dll_struct* demzip_dll
2282 , const LASzip* laszip
2283 , ByteStreamOut* out
2284)
2285{
2286 // write the LASzip VLR payload
2287
2288 // U16 compressor 2 bytes
2289 // U32 coder 2 bytes
2290 // U8 version_major 1 byte
2291 // U8 version_minor 1 byte
2292 // U16 version_revision 2 bytes
2293 // U32 options 4 bytes
2294 // I32 chunk_size 4 bytes
2295 // I64 number_of_special_evlrs 8 bytes
2296 // I64 offset_to_special_evlrs 8 bytes
2297 // U16 num_items 2 bytes
2298 // U16 type 2 bytes * num_items
2299 // U16 size 2 bytes * num_items
2300 // U16 version 2 bytes * num_items
2301 // which totals 34+6*num_items
2302
2303 try { out->put16bitsLE((const U8*)&(laszip->compressor)); } catch(...)
2304 {
2305 sprintf(demzip_dll->error, "writing compressor %d", (I32)laszip->compressor);
2306 return 1;
2307 }
2308 try { out->put16bitsLE((const U8*)&(laszip->coder)); } catch(...)
2309 {
2310 sprintf(demzip_dll->error, "writing coder %d", (I32)laszip->coder);
2311 return 1;
2312 }
2313 try { out->putBytes((const U8*)&(laszip->version_major), 1); } catch(...)
2314 {
2315 sprintf(demzip_dll->error, "writing version_major %d", (I32)laszip->version_major);
2316 return 1;
2317 }
2318 try { out->putBytes((const U8*)&(laszip->version_minor), 1); } catch(...)
2319 {
2320 sprintf(demzip_dll->error, "writing version_minor %d", (I32)laszip->version_minor);
2321 return 1;
2322 }
2323 try { out->put16bitsLE((const U8*)&(laszip->version_revision)); } catch(...)
2324 {
2325 sprintf(demzip_dll->error, "writing version_revision %d", (I32)laszip->version_revision);
2326 return 1;
2327 }
2328 try { out->put32bitsLE((const U8*)&(laszip->options)); } catch(...)
2329 {
2330 sprintf(demzip_dll->error, "writing options %u", laszip->options);
2331 return 1;
2332 }
2333 try { out->put32bitsLE((const U8*)&(laszip->chunk_size)); } catch(...)
2334 {
2335 sprintf(demzip_dll->error, "writing chunk_size %u", laszip->chunk_size);
2336 return 1;

Callers 2

demzip_write_headerFunction · 0.85

Calls 4

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

Tested by

no test coverage detected