Debian Codegraph @

src/LercLib/Lerc1Decode/CntZImage.cpp

raw symbols SCIP
1 /*
2 Copyright 2015 - 2026 Esri
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 A local copy of the license and additional notices are located with the
17 source distribution at:
18
19 http://github.com/Esri/lerc/
20
21 Contributors: Thomas Maurer
22 */
23
24 #include <climits>
25 #include <cstring>
26 #include <algorithm>
27 #include "CntZImage.h"cxx . . $ `<file>/src/LercLib/Lerc1Decode/CntZImage.h`/
28 #include "BitStuffer.h"cxx . . $ `<file>/src/LercLib/Lerc1Decode/BitStuffer.h`/
29 #include "../BitMask.h"cxx . . $ `<file>/src/LercLib/BitMask.h`/
30 #include "../RLE.h"cxx . . $ `<file>/src/LercLib/RLE.h`/
31
32 using namespace std;
33 using namespace LercNS;
34
35 // -------------------------------------------------------------------------- ;
36
37 CntZImagecxx . . $ LercNS/CntZImage#::CntZImagecxx . . $ LercNS/CntZImage#CntZImage(49f6e7a06ebc5aa8).()
38 {
39 type_cxx . . $ LercNS/Image#type_. = CNT_Zcxx . . $ LercNS/Image#CNT_Z.;
40 m_bDecoderCanIgnoreMaskcxx . . $ LercNS/CntZImage#m_bDecoderCanIgnoreMask. = false;
41
42 memset(&m_infoFromComputeNumBytescxx . . $ LercNS/CntZImage#m_infoFromComputeNumBytes., 0, sizeof(m_infoFromComputeNumBytescxx . . $ LercNS/CntZImage#m_infoFromComputeNumBytes.));
43 };
44
45 // -------------------------------------------------------------------------- ;
46
47 bool CntZImagecxx . . $ LercNS/CntZImage#::resizeFill0cxx . . $ LercNS/CntZImage#resizeFill0(cf9ef193275fa6d8).(int width, int height)
48 {
49 if (!resizecxx . . $ LercNS/TImage#resize(cf9ef193275fa6d8).(width, height))
50 return false;
51
52 memset(getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).(), 0, sizeof(CntZcxx . . $ LercNS/CntZ#) * width * height);
53 return true;
54 }
55
56 // -------------------------------------------------------------------------- ;
57
58 unsigned int CntZImagecxx . . $ LercNS/CntZImage#::computeNumBytesNeededToReadHeadercxx . . $ LercNS/CntZImage#computeNumBytesNeededToReadHeader(9e1a662fef1ac081).(bool onlyZPart)
59 {
60 CntZImagecxx . . $ LercNS/CntZImage# zImgcxx . . $ LercNS/CntZImage#CntZImage(49f6e7a06ebc5aa8).;
61 unsigned int cnt = (unsigned int)zImg.getTypeStringcxx . . $ LercNS/CntZImage#getTypeString(219584694fe2b248).().lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).(); // "CntZImage ", 10 bytes
62 cnt += 4 * sizeof(int); // version, type, width, height
63 cnt += 1 * sizeof(double); // maxZError
64 if (!onlyZPart)
65 cnt += 3 * sizeof(int) + sizeof(float); // cnt part
66 cnt += 3 * sizeof(int) + sizeof(float); // z part
67 cnt += 1;
68 return cnt;
69 }
70
71 // -------------------------------------------------------------------------- ;
72
73 bool CntZImagecxx . . $ LercNS/CntZImage#::readcxx . . $ LercNS/CntZImage#read(3fcf2816e18529d4).(const Bytecxx . . $ LercNS/Byte#** ppByte, const Bytecxx . . $ LercNS/Byte#* bArr_end, double maxZError, bool onlyHeader, bool onlyZPart)
74 {
75 if (!ppByte || !*ppByte)
76 return false;
77
78 size_t len = getTypeStringcxx . . $ LercNS/CntZImage#getTypeString(219584694fe2b248).().lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).();
79
80 if (*ppByte + len > bArr_end)
81 return false;
82
83 stringcxx . . $ std/string# typeStrcxx . . $ std/__cxx11/basic_string#basic_string(57f9c416bbf2a7d6).(len, '0');
84 memcpy(&typeStr[cxx . . $ std/__cxx11/basic_string#`operator[]`(7b73c3179b3cb3ad).0], *ppByte, len);
85 *ppByte += len;
86
87 if (typeStr !=cxx . . $ std/`operator!=`(5ea818b58063a774). getTypeStringcxx . . $ LercNS/CntZImage#getTypeString(219584694fe2b248).())
88 return false;
89
90 int version = 0, type = 0, width = 0, height = 0;
91 double maxZErrorInFile = 0;
92
93 const Bytecxx . . $ LercNS/Byte#* ptr = *ppByte;
94
95 if (ptr + 4 * sizeof(int) + sizeof(double) > bArr_end)
96 return false;
97
98 memcpy(&version, ptr, sizeof(int)); ptr += sizeof(int);
99 memcpy(&type, ptr, sizeof(int)); ptr += sizeof(int);
100 memcpy(&height, ptr, sizeof(int)); ptr += sizeof(int);
101 memcpy(&width, ptr, sizeof(int)); ptr += sizeof(int);
102 memcpy(&maxZErrorInFile, ptr, sizeof(double)); ptr += sizeof(double);
103
104 *ppByte = ptr;
105
106 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(version);
107 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(type);
108 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(height);
109 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(width);
110 SWAP_8cxx . . $ `src/LercLib/Defines.h:62:9`!(maxZErrorInFile);
111
112 if (version != 11 || type != type_cxx . . $ LercNS/Image#type_.)
113 return false;
114
115 if (height < 0 || width < 0 || height > 40000 || width > 40000) // guard against bogus numbers; size limitation for old Lerc1
116 return false;
117
118 if (sizeof(CntZcxx . . $ LercNS/CntZ#) * height * width > (size_t)INT_MAXcxx . . $ `<external>/2419331716647297546/limits.h:120:9`!)
119 return false;
120
121 if (maxZErrorInFile > maxZError)
122 return false;
123
124 if (onlyHeader)
125 return true;
126
127 if (!onlyZPart && !resizeFill0cxx . . $ LercNS/CntZImage#resizeFill0(cf9ef193275fa6d8).(width, height)) // init with (0,0), used below
128 return false;
129
130 m_bDecoderCanIgnoreMaskcxx . . $ LercNS/CntZImage#m_bDecoderCanIgnoreMask. = false;
131
132 for (int iPart = 0; iPart < 2; iPart++)
133 {
134 bool zPart = iPart ? true : false; // first cnt part, then z part
135
136 if (!zPart && onlyZPart)
137 continue;
138
139 int numTilesVert = 0, numTilesHori = 0, numBytes = 0;
140 float maxValInImg = 0;
141
142 const Bytecxx . . $ LercNS/Byte#* ptr = *ppByte;
143
144 if (ptr + 3 * sizeof(int) + sizeof(float) > bArr_end)
145 return false;
146
147 memcpy(&numTilesVert, ptr, sizeof(int)); ptr += sizeof(int);
148 memcpy(&numTilesHori, ptr, sizeof(int)); ptr += sizeof(int);
149 memcpy(&numBytes, ptr, sizeof(int)); ptr += sizeof(int);
150 memcpy(&maxValInImg, ptr, sizeof(float)); ptr += sizeof(float);
151
152 *ppByte = ptr;
153 const Bytecxx . . $ LercNS/Byte#* bArr = ptr;
154
155 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(numTilesVert);
156 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(numTilesHori);
157 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(numBytes);
158 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(maxValInImg);
159
160 if (numBytes < 0 || ptr + numBytes > bArr_end)
161 return false;
162
163 if (!zPart && numTilesVert == 0 && numTilesHori == 0) // no tiling for this cnt part
164 {
165 if (numBytes == 0) // cnt part is const
166 {
167 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).();
168 for (int i = 0; i < height_cxx . . $ LercNS/Image#height_.; i++)
169 for (int j = 0; j < width_cxx . . $ LercNS/Image#width_.; j++)
170 {
171 dstPtr->cntcxx . . $ LercNS/CntZ#cnt. = maxValInImg;
172 dstPtr++;
173 }
174
175 if (maxValInImg > 0)
176 m_bDecoderCanIgnoreMaskcxx . . $ LercNS/CntZImage#m_bDecoderCanIgnoreMask. = true;
177 }
178
179 if (numBytes > 0) // cnt part is binary mask, use fast RLE class
180 {
181 // decompress to bit mask
182 BitMaskcxx . . $ LercNS/BitMask# bitMaskcxx . . $ LercNS/BitMask#BitMask(3e454b8ccf442868).(width_cxx . . $ LercNS/Image#width_., height_cxx . . $ LercNS/Image#height_.);
183 RLEcxx . . $ LercNS/RLE# rlecxx . . $ LercNS/RLE#RLE(49f6e7a06ebc5aa8).;
184 if (!rle.decompresscxx . . $ LercNS/RLE#decompress(b7ce43e8339adf29).(bArr, (size_t)width_cxx . . $ LercNS/Image#width_. * height_cxx . . $ LercNS/Image#height_. * 2, (Bytecxx . . $ LercNS/Byte#*)bitMask.Bitscxx . . $ LercNS/BitMask#Bits(37d8967d10cb1e7b).(), bitMask.Sizecxx . . $ LercNS/BitMask#Size(fe4d2d262d4164a8).()))
185 return false;
186
187 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).();
188 for (int k = 0, i = 0; i < height_cxx . . $ LercNS/Image#height_.; i++)
189 for (int j = 0; j < width_cxx . . $ LercNS/Image#width_.; j++, k++, dstPtr++)
190 dstPtr->cntcxx . . $ LercNS/CntZ#cnt. = bitMask.IsValidcxx . . $ LercNS/BitMask#IsValid(7c969c143e367631).(k) ? 1.0f : 0.0f;
191 }
192 }
193 else if (!readTilescxx . . $ LercNS/CntZImage#readTiles(e84934dc8472c914).(zPart, maxZErrorInFile, numTilesVert, numTilesHori, maxValInImg, bArr))
194 return false;
195
196 *ppByte += numBytes;
197 }
198
199 m_tmpDataVeccxx . . $ LercNS/CntZImage#m_tmpDataVec..clearcxx . . $ std/vector#clear(ced63f7c635d850d).();
200 return true;
201 }
202
203 // -------------------------------------------------------------------------- ;
204
205 bool CntZImagecxx . . $ LercNS/CntZImage#::readTilescxx . . $ LercNS/CntZImage#readTiles(e84934dc8472c914).(bool zPart, double maxZErrorInFile, int numTilesVert, int numTilesHori,
206 float maxValInImg, const Bytecxx . . $ LercNS/Byte#* bArr)
207 {
208 if (numTilesVert <= 0 || numTilesHori <= 0
209 || numTilesVert > height_cxx . . $ LercNS/Image#height_. || numTilesHori > width_cxx . . $ LercNS/Image#width_.)
210 return false;
211
212 const Bytecxx . . $ LercNS/Byte#* ptr = bArr;
213
214 for (int iTile = 0; iTile <= numTilesVert; iTile++)
215 {
216 int tileH = height_cxx . . $ LercNS/Image#height_. / numTilesVert;
217 int i0 = iTile * tileH;
218 if (iTile == numTilesVert)
219 tileH = height_cxx . . $ LercNS/Image#height_. % numTilesVert;
220
221 if (tileH == 0)
222 continue;
223
224 for (int jTile = 0; jTile <= numTilesHori; jTile++)
225 {
226 int tileW = width_cxx . . $ LercNS/Image#width_. / numTilesHori;
227 int j0 = jTile * tileW;
228 if (jTile == numTilesHori)
229 tileW = width_cxx . . $ LercNS/Image#width_. % numTilesHori;
230
231 if (tileW == 0)
232 continue;
233
234 bool rv = zPart ? readZTilecxx . . $ LercNS/CntZImage#readZTile(f7f521bc3f0dc4ba).( &ptr, i0, i0 + tileH, j0, j0 + tileW, maxZErrorInFile, maxValInImg) :
235 readCntTilecxx . . $ LercNS/CntZImage#readCntTile(ce4b704fb8629e3a).(&ptr, i0, i0 + tileH, j0, j0 + tileW);
236
237 if (!rv)
238 return false;
239 }
240 }
241
242 return true;
243 }
244
245 // -------------------------------------------------------------------------- ;
246
247 bool CntZImagecxx . . $ LercNS/CntZImage#::readCntTilecxx . . $ LercNS/CntZImage#readCntTile(ce4b704fb8629e3a).(const Bytecxx . . $ LercNS/Byte#** ppByte, int i0, int i1, int j0, int j1)
248 {
249 if (i0 >= i1 || j0 >= j1)
250 return false;
251
252 const Bytecxx . . $ LercNS/Byte#* ptr = *ppByte;
253 Bytecxx . . $ LercNS/Byte# comprFlag = *ptr++;
254
255 if (comprFlag == 2) // entire tile is constant 0 (invalid)
256 { // here we depend on resizeFill0()
257 *ppByte = ptr;
258 return true;
259 }
260
261 if (comprFlag == 3 || comprFlag == 4) // entire tile is constant -1 (invalid) or 1 (valid)
262 {
263 CntZcxx . . $ LercNS/CntZ# cz1m = {-1, 0};
264 CntZcxx . . $ LercNS/CntZ# cz1p = { 1, 0};
265 CntZcxx . . $ LercNS/CntZ# cz1 = (comprFlag == 3) ? cz1m : cz1p;
266
267 for (int i = i0; i < i1; i++)
268 {
269 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
270 for (int j = j0; j < j1; j++)
271 *dstPtr++ =cxx . . $ LercNS/CntZ#`operator=`(e13c7ec27fe490c8). cz1;
272 }
273
274 *ppByte = ptr;
275 return true;
276 }
277
278 if ((comprFlag & 63) > 4)
279 return false;
280
281 if (comprFlag == 0)
282 {
283 // read cnt's as flt arr uncompressed
284 for (int i = i0; i < i1; i++)
285 {
286 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
287 for (int j = j0; j < j1; j++)
288 {
289 memcpy(&dstPtr->cntcxx . . $ LercNS/CntZ#cnt., ptr, 4); ptr += 4;
290 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(dstPtr->cnt);
291 dstPtr++;
292 }
293 }
294 }
295 else
296 {
297 // read cnt's as int arr bit stuffed
298 int bits67 = comprFlag >> 6;
299 int n = (bits67 == 0) ? 4 : 3 - bits67;
300
301 float offset = 0;
302 if (!readFltcxx . . $ LercNS/CntZImage#readFlt(12fe475206794ad).(&ptr, offset, n))
303 return false;
304
305 int numPixel = (i1 - i0) * (j1 - j0);
306 BitStuffercxx . . $ LercNS/BitStuffer# bitStuffercxx . . $ LercNS/BitStuffer#BitStuffer(49f6e7a06ebc5aa8).;
307 if (!bitStuffer.readcxx . . $ LercNS/BitStuffer#read(a75a2035d0283180).(&ptr, m_tmpDataVeccxx . . $ LercNS/CntZImage#m_tmpDataVec.) || m_tmpDataVeccxx . . $ LercNS/CntZImage#m_tmpDataVec..sizecxx . . $ std/vector#size(c9b1e749b64d5edc).() < (size_t)numPixel)
308 return false;
309
310 unsigned int* srcPtr = &m_tmpDataVeccxx . . $ LercNS/CntZImage#m_tmpDataVec.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0];
311
312 for (int i = i0; i < i1; i++)
313 {
314 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
315 for (int j = j0; j < j1; j++)
316 {
317 dstPtr->cntcxx . . $ LercNS/CntZ#cnt. = offset + (float)(*srcPtr++);
318 dstPtr++;
319 }
320 }
321 }
322
323 *ppByte = ptr;
324 return true;
325 }
326
327 // -------------------------------------------------------------------------- ;
328
329 bool CntZImagecxx . . $ LercNS/CntZImage#::readZTilecxx . . $ LercNS/CntZImage#readZTile(f7f521bc3f0dc4ba).(const Bytecxx . . $ LercNS/Byte#** ppByte, int i0, int i1, int j0, int j1, double maxZErrorInFile, float maxZInImg)
330 {
331 const Bytecxx . . $ LercNS/Byte#* ptr = *ppByte;
332 Bytecxx . . $ LercNS/Byte# comprFlag = *ptr++;
333 int bits67 = comprFlag >> 6;
334 comprFlag &= 63;
335
336 if (comprFlag == 2) // entire zTile is constant 0 (if valid or invalid doesn't matter)
337 {
338 for (int i = i0; i < i1; i++)
339 {
340 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
341 for (int j = j0; j < j1; j++)
342 {
343 if (dstPtr->cntcxx . . $ LercNS/CntZ#cnt. > 0)
344 dstPtr->zcxx . . $ LercNS/CntZ#z. = 0;
345 dstPtr++;
346 }
347 }
348
349 *ppByte = ptr;
350 return true;
351 }
352
353 if (comprFlag > 3)
354 return false;
355
356 if (comprFlag == 0)
357 {
358 // read z's as flt arr uncompressed
359 for (int i = i0; i < i1; i++)
360 {
361 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
362 for (int j = j0; j < j1; j++)
363 {
364 if (dstPtr->cntcxx . . $ LercNS/CntZ#cnt. > 0)
365 {
366 memcpy(&dstPtr->zcxx . . $ LercNS/CntZ#z., ptr, 4); ptr += 4;
367 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(dstPtr->z);
368 }
369 dstPtr++;
370 }
371 }
372 }
373 else
374 {
375 // read z's as int arr bit stuffed
376 int n = (bits67 == 0) ? 4 : 3 - bits67;
377 float offset = 0;
378 if (!readFltcxx . . $ LercNS/CntZImage#readFlt(12fe475206794ad).(&ptr, offset, n))
379 return false;
380
381 if (comprFlag == 3)
382 {
383 for (int i = i0; i < i1; i++)
384 {
385 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
386 for (int j = j0; j < j1; j++)
387 {
388 if (dstPtr->cntcxx . . $ LercNS/CntZ#cnt. > 0)
389 dstPtr->zcxx . . $ LercNS/CntZ#z. = offset;
390 dstPtr++;
391 }
392 }
393 }
394 else
395 {
396 vectorcxx . . $ std/vector#<unsigned int>& dataVec = m_tmpDataVeccxx . . $ LercNS/CntZImage#m_tmpDataVec.;
397 BitStuffercxx . . $ LercNS/BitStuffer# bitStuffercxx . . $ LercNS/BitStuffer#BitStuffer(49f6e7a06ebc5aa8).;
398 if (!bitStuffer.readcxx . . $ LercNS/BitStuffer#read(a75a2035d0283180).(&ptr, dataVec))
399 return false;
400
401 double invScale = 2 * maxZErrorInFile;
402 unsigned int* srcPtr = &dataVec[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0];
403
404 if (m_bDecoderCanIgnoreMaskcxx . . $ LercNS/CntZImage#m_bDecoderCanIgnoreMask.)
405 {
406 for (int i = i0; i < i1; i++)
407 {
408 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
409 for (int j = j0; j < j1; j++)
410 {
411 float z = (float)(offset + *srcPtr++ * invScale);
412 dstPtr->zcxx . . $ LercNS/CntZ#z. = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(z, maxZInImg); // make sure we stay in the orig range
413 dstPtr++;
414 }
415 }
416 }
417 else
418 {
419 for (int i = i0; i < i1; i++)
420 {
421 CntZcxx . . $ LercNS/CntZ#* dstPtr = getDatacxx . . $ LercNS/TImage#getData(155dc7f103cdb9db).() + i * width_cxx . . $ LercNS/Image#width_. + j0;
422 for (int j = j0; j < j1; j++)
423 {
424 if (dstPtr->cntcxx . . $ LercNS/CntZ#cnt. > 0)
425 {
426 float z = (float)(offset + *srcPtr++ * invScale);
427 dstPtr->zcxx . . $ LercNS/CntZ#z. = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(z, maxZInImg); // make sure we stay in the orig range
428 }
429 dstPtr++;
430 }
431 }
432 }
433 }
434 }
435
436 *ppByte = ptr;
437 return true;
438 }
439
440 // -------------------------------------------------------------------------- ;
441
442 int CntZImagecxx . . $ LercNS/CntZImage#::numBytesFltcxx . . $ LercNS/CntZImage#numBytesFlt(1bb0578f3efdc255).(float z)
443 {
444 short s = (short)z;
445 char c = (char)s;
446 return ((float)c == z) ? 1 : ((float)s == z) ? 2 : 4;
447 }
448
449 // -------------------------------------------------------------------------- ;
450
451 bool CntZImagecxx . . $ LercNS/CntZImage#::readFltcxx . . $ LercNS/CntZImage#readFlt(12fe475206794ad).(const Bytecxx . . $ LercNS/Byte#** ppByte, float& z, int numBytes)
452 {
453 const Bytecxx . . $ LercNS/Byte#* ptr = *ppByte;
454
455 if (numBytes == 1)
456 {
457 char c = *((char*)ptr);
458 z = c;
459 }
460 else if (numBytes == 2)
461 {
462 short s;
463 memcpy(&s, ptr, sizeof(short));
464 SWAP_2cxx . . $ `src/LercLib/Defines.h:60:9`!(s);
465 z = s;
466 }
467 else if (numBytes == 4)
468 {
469 memcpy(&z, ptr, sizeof(float));
470 SWAP_4cxx . . $ `src/LercLib/Defines.h:61:9`!(z);
471 }
472 else
473 return false;
474
475 *ppByte = ptr + numBytes;
476 return true;
477 }
478
479 // -------------------------------------------------------------------------- ;
480