| 71 | } |
| 72 | |
| 73 | BOOL LASreadPoint::setup(U32 num_items, const LASitem* items, const LASzip* laszip) |
| 74 | { |
| 75 | U32 i; |
| 76 | |
| 77 | // is laszip exists then we must use its items |
| 78 | if (laszip) |
| 79 | { |
| 80 | if (num_items == 0) return FALSE; |
| 81 | if (items == 0) return FALSE; |
| 82 | if (num_items != laszip->num_items) return FALSE; |
| 83 | if (items != laszip->items) return FALSE; |
| 84 | } |
| 85 | |
| 86 | // delete old entropy decoder |
| 87 | if (dec) |
| 88 | { |
| 89 | delete dec; |
| 90 | dec = 0; |
| 91 | layered_las14_compression = FALSE; |
| 92 | } |
| 93 | |
| 94 | // is the content compressed? |
| 95 | if (laszip && laszip->compressor) |
| 96 | { |
| 97 | // create new entropy decoder (if requested) |
| 98 | switch (laszip->coder) |
| 99 | { |
| 100 | case LASZIP_CODER_ARITHMETIC: |
| 101 | dec = new ArithmeticDecoder(); |
| 102 | break; |
| 103 | default: |
| 104 | // entropy decoder not supported |
| 105 | return FALSE; |
| 106 | } |
| 107 | // maybe layered compression for LAS 1.4 |
| 108 | layered_las14_compression = (laszip->compressor == LASZIP_COMPRESSOR_LAYERED_CHUNKED); |
| 109 | } |
| 110 | |
| 111 | // initizalize the readers |
| 112 | readers = 0; |
| 113 | num_readers = num_items; |
| 114 | |
| 115 | // disable chunking |
| 116 | chunk_size = U32_MAX; |
| 117 | |
| 118 | // always create the raw readers |
| 119 | readers_raw = new LASreadItem*[num_readers]; |
| 120 | for (i = 0; i < num_readers; i++) |
| 121 | { |
| 122 | switch (items[i].type) |
| 123 | { |
| 124 | case LASitem::POINT10: |
| 125 | if (Endian::IS_LITTLE_ENDIAN) |
| 126 | readers_raw[i] = new LASreadItemRaw_POINT10_LE(); |
| 127 | else |
| 128 | readers_raw[i] = new LASreadItemRaw_POINT10_BE(); |
| 129 | break; |
| 130 | case LASitem::GPSTIME11: |
nothing calls this directly
no outgoing calls
no test coverage detected