Debian Codegraph @

src/LercLib/RLE.h

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 #ifndef RLE_H
25 #define RLE_Hcxx . . $ `src/LercLib/RLE.h:25:9`!
26
27 #include <cstddef>
28 #include "Defines.h"cxx . . $ `<file>/src/LercLib/Defines.h`/
29
30 NAMESPACE_LERC_STARTcxx . . $ LercNS/
31
32 /** RLE:
33 * run length encode a byte array
34 *
35 * best case resize factor (all bytes are the same):
36 * (((n + 1) * 3 / 32767 + 2) / n) ~= (3 / 32767) ~= 0.00009
37 *
38 * worst case resize factor (no stretch of same bytes):
39 * ((n + (n + 1) * 2 / 32767 + 2) / n) ~= (1 + 2 / 32767) ~= 1.00006
40 */
41
42 class RLEcxx . . $ LercNS/RLE#
43 {
44 public:
45 RLEcxx . . $ LercNS/RLE#RLE(49f6e7a06ebc5aa8).() : m_minNumEvencxx . . $ LercNS/RLE#m_minNumEven.(5) {}
46 ~cxx . . $ LercNS/RLE#`~RLE`(ced63f7c635d850d).RLEcxx . . $ LercNS/RLE#() {}
47
48 size_t computeNumBytesRLEcxx . . $ LercNS/RLE#computeNumBytesRLE(c94820f36e75556c).(const Bytecxx . . $ LercNS/Byte#* arr, size_t numBytes) const;
49
50 // when done, call
51 // delete[] *arrRLE;
52 bool compresscxx . . $ LercNS/RLE#compress(34df028bea51163d).(const Bytecxx . . $ LercNS/Byte#* arr, size_t numBytes,
53 Bytecxx . . $ LercNS/Byte#** arrRLE, size_t& numBytesRLE, bool verify = false) const;
54
55 // when done, call
56 // delete[] *arr;
57 static bool decompresscxx . . $ LercNS/RLE#decompress(7410a27c79cefd55).(const Bytecxx . . $ LercNS/Byte#* arrRLE, size_t nBytesRemaining, Bytecxx . . $ LercNS/Byte#** arr, size_t& numBytes);
58
59 // arr already allocated, just fill
60 static bool decompresscxx . . $ LercNS/RLE#decompress(b7ce43e8339adf29).(const Bytecxx . . $ LercNS/Byte#* arrRLE, size_t nBytesRemaining, Bytecxx . . $ LercNS/Byte#* arr, size_t arrSize);
61
62 protected:
63 int m_minNumEvencxx . . $ LercNS/RLE#m_minNumEven.;
64
65 static void writeCountcxx . . $ LercNS/RLE#writeCount(66f9cac98ad7ebe4).(short cnt, Bytecxx . . $ LercNS/Byte#** ppCnt, Bytecxx . . $ LercNS/Byte#** ppDst);
66 static short readCountcxx . . $ LercNS/RLE#readCount(b9712f2bb7185fdb).(const Bytecxx . . $ LercNS/Byte#** ppCnt);
67
68 };
69
70 NAMESPACE_LERC_ENDcxx . . $ `src/LercLib/Defines.h:36:9`!
71 #endif