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

Method read

LASzip/src/lasreaditemcompressed_v2.cpp:137–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137inline void LASreadItemCompressed_POINT10_v2::read(U8* item, U32& context)
138{
139 U32 r, n, m, l;
140 U32 k_bits;
141 I32 median, diff;
142
143 // decompress which other values have changed
144 I32 changed_values = dec->decodeSymbol(m_changed_values);
145
146 if (changed_values)
147 {
148 // decompress the edge_of_flight_line, scan_direction_flag, ... if it has changed
149 if (changed_values & 32)
150 {
151 if (m_bit_byte[last_item[14]] == 0)
152 {
153 m_bit_byte[last_item[14]] = dec->createSymbolModel(256);
154 dec->initSymbolModel(m_bit_byte[last_item[14]]);
155 }
156 last_item[14] = (U8)dec->decodeSymbol(m_bit_byte[last_item[14]]);
157 }
158
159 r = ((LASpoint10*)last_item)->return_number;
160 n = ((LASpoint10*)last_item)->number_of_returns_of_given_pulse;
161 m = number_return_map[n][r];
162 l = number_return_level[n][r];
163
164 // decompress the intensity if it has changed
165 if (changed_values & 16)
166 {
167 ((LASpoint10*)last_item)->intensity = (U16)ic_intensity->decompress(last_intensity[m], (m < 3 ? m : 3));
168 last_intensity[m] = ((LASpoint10*)last_item)->intensity;
169 }
170 else
171 {
172 ((LASpoint10*)last_item)->intensity = last_intensity[m];
173 }
174
175 // decompress the classification ... if it has changed
176 if (changed_values & 8)
177 {
178 if (m_classification[last_item[15]] == 0)
179 {
180 m_classification[last_item[15]] = dec->createSymbolModel(256);
181 dec->initSymbolModel(m_classification[last_item[15]]);
182 }
183 last_item[15] = (U8)dec->decodeSymbol(m_classification[last_item[15]]);
184 }
185
186 // decompress the scan_angle_rank ... if it has changed
187 if (changed_values & 4)
188 {
189 I32 val = dec->decodeSymbol(m_scan_angle_rank[((LASpoint10*)last_item)->scan_direction_flag]);
190 last_item[16] = U8_FOLD(val + last_item[16]);
191 }
192
193 // decompress the user_data ... if it has changed
194 if (changed_values & 2)

Callers

nothing calls this directly

Calls 8

decompressMethod · 0.80
getKMethod · 0.80
decodeSymbolMethod · 0.45
createSymbolModelMethod · 0.45
initSymbolModelMethod · 0.45
getMethod · 0.45
addMethod · 0.45
readIntMethod · 0.45

Tested by

no test coverage detected