-
Notifications
You must be signed in to change notification settings - Fork 0
/
CntZImage.h
84 lines (62 loc) · 2.3 KB
/
CntZImage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
Copyright 2015 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
A local copy of the license and additional notices are located with the
source distribution at:
http://github.com/Esri/lerc/
Contributors: Thomas Maurer
*/
#ifndef CNTZIMAGE_H
#define CNTZIMAGE_H
#include <vector>
#include "TImage.hpp"
NAMESPACE_LERC_START
/** count / z image
*
* count can also be a weight, therefore float;
* z can be elevation or intensity;
*/
class CntZImage : public TImage< CntZ >
{
public:
CntZImage();
virtual ~CntZImage() {};
std::string getTypeString() const { return "CntZImage "; }
bool resizeFill0(int width, int height);
static unsigned int computeNumBytesNeededToReadHeader();
/// read succeeds only if maxZError on file <= maxZError requested
bool read(Byte** ppByte, double maxZError, bool onlyHeader = false, bool onlyZPart = false);
protected:
struct InfoFromComputeNumBytes
{
double maxZError;
bool cntsNoInt;
int numTilesVertCnt;
int numTilesHoriCnt;
int numBytesCnt;
float maxCntInImg;
int numTilesVertZ;
int numTilesHoriZ;
int numBytesZ;
float maxZInImg;
};
bool readTiles(bool zPart, double maxZErrorInFile, int numTilesVert, int numTilesHori, float maxValInImg, Byte* bArr);
bool readCntTile(Byte** ppByte, int i0, int i1, int j0, int j1);
bool readZTile(Byte** ppByte, int i0, int i1, int j0, int j1, double maxZErrorInFile, float maxZInImg);
static int numBytesFlt(float z); // returns 1, 2, or 4
static bool readFlt(Byte** ppByte, float& z, int numBytes);
protected:
InfoFromComputeNumBytes m_infoFromComputeNumBytes;
std::vector<unsigned int> m_tmpDataVec; // used in read fcts
bool m_bDecoderCanIgnoreMask; // "
};
NAMESPACE_LERC_END
#endif