Debian Codegraph @

src/LercLib/fpl_Predictor.cpp

raw symbols SCIP
1 /*
2 Copyright 2021 - 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 Analytical Raster Compression.
22 Original coding 2021 Yuriy Yakimenko
23 */
24
25 #include "fpl_Predictor.h"cxx . . $ `<file>/src/LercLib/fpl_Predictor.h`/
26
27 USING_NAMESPACE_LERCcxx . . $ `src/LercLib/Defines.h:37:9`!
28
29 int Predictorcxx . . $ LercNS/Predictor#::getMaxByteDeltacxx . . $ LercNS/Predictor#getMaxByteDelta(d8ddbb2269178517). (const PredictorTypecxx . . $ LercNS/PredictorType# p)
30 {
31 return MAX_DELTAcxx . . $ `src/LercLib/fpl_Predictor.h:32:9`! - Predictorcxx . . $ LercNS/Predictor#::getIntDeltacxx . . $ LercNS/Predictor#getIntDelta(d8ddbb2269178517). (p);
32 }
33
34 PredictorTypecxx . . $ LercNS/PredictorType# Predictorcxx . . $ LercNS/Predictor#::getTypecxx . . $ LercNS/Predictor#getType(f57b6a48cece57f0). (const char code)
35 {
36 if (code == 0) return PREDICTOR_NONEcxx . . $ LercNS/PREDICTOR_NONE.;
37 if (code == 1) return PREDICTOR_DELTA1cxx . . $ LercNS/PREDICTOR_DELTA1.;
38 if (code == 2) return PREDICTOR_ROWS_COLScxx . . $ LercNS/PREDICTOR_ROWS_COLS.;
39
40 return PREDICTOR_UNKNOWNcxx . . $ LercNS/PREDICTOR_UNKNOWN.;
41 }
42
43 unsigned char Predictorcxx . . $ LercNS/Predictor#::getCodecxx . . $ LercNS/Predictor#getCode(6d3690282f9f8b57). (const PredictorTypecxx . . $ LercNS/PredictorType# p)
44 {
45 if (p == PREDICTOR_NONEcxx . . $ LercNS/PREDICTOR_NONE.) return 0;
46 if (p == PREDICTOR_DELTA1cxx . . $ LercNS/PREDICTOR_DELTA1.) return 1;
47 if (p == PREDICTOR_ROWS_COLScxx . . $ LercNS/PREDICTOR_ROWS_COLS.) return 2;
48
49 return -1;
50 }
51
52
53 int Predictorcxx . . $ LercNS/Predictor#::getIntDeltacxx . . $ LercNS/Predictor#getIntDelta(d8ddbb2269178517). (const PredictorTypecxx . . $ LercNS/PredictorType# p)
54 {
55 switch (p)
56 {
57 case PREDICTOR_NONEcxx . . $ LercNS/PREDICTOR_NONE.:
58 return 0;
59 case PREDICTOR_ROWS_COLScxx . . $ LercNS/PREDICTOR_ROWS_COLS.:
60 return 2;
61 case PREDICTOR_DELTA1cxx . . $ LercNS/PREDICTOR_DELTA1.:
62 return 1;
63 default:
64 return 0;
65 }
66
67 return 0;
68
69 }
70
71 PredictorTypecxx . . $ LercNS/PredictorType# Predictorcxx . . $ LercNS/Predictor#::fromDeltaAndCrosscxx . . $ LercNS/Predictor#fromDeltaAndCross(3449515b7e45aa45). (int delta, bool cross)
72 {
73 if (delta < 0)
74 return PREDICTOR_UNKNOWNcxx . . $ LercNS/PREDICTOR_UNKNOWN.;
75
76 else if (delta == 0)
77 return PREDICTOR_NONEcxx . . $ LercNS/PREDICTOR_NONE.;
78
79 else if (false == cross)
80 {
81 if (delta == 1)
82 return PREDICTOR_DELTA1cxx . . $ LercNS/PREDICTOR_DELTA1.;
83 }
84 else
85 {
86 if (delta == 2)
87 return PREDICTOR_ROWS_COLScxx . . $ LercNS/PREDICTOR_ROWS_COLS.;
88 }
89
90 return PREDICTOR_UNKNOWNcxx . . $ LercNS/PREDICTOR_UNKNOWN.;
91 }