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

Function write_demzip_vlr_header

LASlib/src/demzip_dll.cpp:2233–2276  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2231
2232/*---------------------------------------------------------------------------*/
2233static I32
2234write_demzip_vlr_header(
2235 demzip_dll_struct* demzip_dll
2236 , const LASzip* laszip
2237 , ByteStreamOut* out
2238)
2239{
2240 // write the LASzip VLR header
2241
2242 U16 reserved = 0x0;
2243 try { out->put16bitsLE((U8*)&reserved); } catch(...)
2244 {
2245 sprintf(demzip_dll->error, "writing LASzip VLR header.reserved");
2246 return 1;
2247 }
2248 U8 user_id[16] = "laszip encoded\0";
2249 try { out->putBytes((U8*)user_id, 16); } catch(...)
2250 {
2251 sprintf(demzip_dll->error, "writing LASzip VLR header.user_id");
2252 return 1;
2253 }
2254 U16 record_id = 22204;
2255 try { out->put16bitsLE((U8*)&record_id); } catch(...)
2256 {
2257 sprintf(demzip_dll->error, "writing LASzip VLR header.record_id");
2258 return 1;
2259 }
2260 U16 record_length_after_header = (U16)demzip_vrl_payload_size(laszip);
2261 try { out->put16bitsLE((U8*)&record_length_after_header); } catch(...)
2262 {
2263 sprintf(demzip_dll->error, "writing LASzip VLR header.record_length_after_header");
2264 return 1;
2265 }
2266 CHAR description[32];
2267 memset(description, 0, 32);
2268 sprintf(description, "LASzip DLL %d.%d r%d (%d)", LASZIP_VERSION_MAJOR, LASZIP_VERSION_MINOR, LASZIP_VERSION_REVISION, LASZIP_VERSION_BUILD_DATE);
2269 try { out->putBytes((U8*)description, 32); } catch(...)
2270 {
2271 sprintf(demzip_dll->error, "writing LASzip VLR header.description");
2272 return 1;
2273 }
2274
2275 return 0;
2276}
2277
2278/*---------------------------------------------------------------------------*/
2279static I32

Callers 2

demzip_write_headerFunction · 0.85

Calls 3

demzip_vrl_payload_sizeFunction · 0.85
put16bitsLEMethod · 0.45
putBytesMethod · 0.45

Tested by

no test coverage detected