| 407 | } |
| 408 | |
| 409 | BOOL LASreadItemCompressed_POINT14_v4::init(const U8* item, U32& context) |
| 410 | { |
| 411 | /* for layered compression 'dec' only hands over the stream */ |
| 412 | |
| 413 | ByteStreamIn* instream = dec->getByteStreamIn(); |
| 414 | |
| 415 | /* on the first init create instreams and decoders */ |
| 416 | |
| 417 | if (instream_channel_returns_XY == 0) |
| 418 | { |
| 419 | /* create instreams */ |
| 420 | |
| 421 | if (Endian::IS_LITTLE_ENDIAN) |
| 422 | { |
| 423 | instream_channel_returns_XY = new ByteStreamInArrayLE(); |
| 424 | instream_Z = new ByteStreamInArrayLE(); |
| 425 | instream_classification = new ByteStreamInArrayLE(); |
| 426 | instream_flags = new ByteStreamInArrayLE(); |
| 427 | instream_intensity = new ByteStreamInArrayLE(); |
| 428 | instream_scan_angle = new ByteStreamInArrayLE(); |
| 429 | instream_user_data = new ByteStreamInArrayLE(); |
| 430 | instream_point_source = new ByteStreamInArrayLE(); |
| 431 | instream_gps_time = new ByteStreamInArrayLE(); |
| 432 | } |
| 433 | else |
| 434 | { |
| 435 | instream_channel_returns_XY = new ByteStreamInArrayBE(); |
| 436 | instream_Z = new ByteStreamInArrayBE(); |
| 437 | instream_classification = new ByteStreamInArrayBE(); |
| 438 | instream_flags = new ByteStreamInArrayBE(); |
| 439 | instream_intensity = new ByteStreamInArrayBE(); |
| 440 | instream_scan_angle = new ByteStreamInArrayBE(); |
| 441 | instream_user_data = new ByteStreamInArrayBE(); |
| 442 | instream_point_source = new ByteStreamInArrayBE(); |
| 443 | instream_gps_time = new ByteStreamInArrayBE(); |
| 444 | } |
| 445 | |
| 446 | /* create decoders */ |
| 447 | |
| 448 | dec_channel_returns_XY = new ArithmeticDecoder(); |
| 449 | dec_Z = new ArithmeticDecoder(); |
| 450 | dec_classification = new ArithmeticDecoder(); |
| 451 | dec_flags = new ArithmeticDecoder(); |
| 452 | dec_intensity = new ArithmeticDecoder(); |
| 453 | dec_scan_angle = new ArithmeticDecoder(); |
| 454 | dec_user_data = new ArithmeticDecoder(); |
| 455 | dec_point_source = new ArithmeticDecoder(); |
| 456 | dec_gps_time = new ArithmeticDecoder(); |
| 457 | } |
| 458 | |
| 459 | /* how many bytes do we need to read */ |
| 460 | |
| 461 | U32 num_bytes = num_bytes_channel_returns_XY; |
| 462 | if (requested_Z) num_bytes += num_bytes_Z; |
| 463 | if (requested_classification) num_bytes += num_bytes_classification; |
| 464 | if (requested_flags) num_bytes += num_bytes_flags; |
| 465 | if (requested_intensity) num_bytes += num_bytes_intensity; |
| 466 | if (requested_scan_angle) num_bytes += num_bytes_scan_angle; |
no test coverage detected