| 294 | } |
| 295 | |
| 296 | BOOL 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); |
nothing calls this directly
no test coverage detected