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

Method write

LASzip/src/laswritepoint.cpp:296–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296BOOL LASwritePoint::write(const U8 * const * point)
297{
298 U32 i;
299 U32 context = 0;
300
301 if (chunk_count == chunk_size)
302 {
303 if (enc)
304 {
305 if (layered_las14_compression)
306 {
307 // write how many points are in the chunk
308 outstream->put32bitsLE((U8*)&chunk_count);
309 // write all layers
310 for (i = 0; i < num_writers; i++)
311 {
312 ((LASwriteItemCompressed*)writers[i])->chunk_sizes();
313 }
314 for (i = 0; i < num_writers; i++)
315 {
316 ((LASwriteItemCompressed*)writers[i])->chunk_bytes();
317 }
318 }
319 else
320 {
321 enc->done();
322 }
323 add_chunk_to_table();
324 init(outstream);
325 }
326 else
327 {
328 // happens *only* for uncompressed LAS with over U32_MAX points
329 assert(chunk_size == U32_MAX);
330 }
331 chunk_count = 0;
332 }
333 chunk_count++;
334
335 if (writers)
336 {
337 for (i = 0; i < num_writers; i++)
338 {
339 if (!writers[i]->write(point[i], context))
340 {
341 return FALSE;
342 }
343 }
344 }
345 else
346 {
347 for (i = 0; i < num_writers; i++)
348 {
349 if (!writers_raw[i]->write(point[i], context))
350 {
351 return FALSE;
352 }
353 ((LASwriteItemCompressed*)(writers_compressed[i]))->init(point[i], context);

Callers

nothing calls this directly

Calls 6

initFunction · 0.85
put32bitsLEMethod · 0.45
chunk_sizesMethod · 0.45
chunk_bytesMethod · 0.45
doneMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected