#ifndef CNTZIMAGE_H
#define CNTZIMAGE_H
#include <vector>
#include "TImage.hpp"
NAMESPACE_LERC_START
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(bool onlyZPart);
bool read(const 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, const Byte* bArr);
bool readCntTile(const Byte** ppByte, int i0, int i1, int j0, int j1);
bool readZTile(const Byte** ppByte, int i0, int i1, int j0, int j1, double maxZErrorInFile, float maxZInImg);
static int numBytesFlt(float z); static bool readFlt(const Byte** ppByte, float& z, int numBytes);
protected:
InfoFromComputeNumBytes m_infoFromComputeNumBytes;
std::vector<unsigned int> m_tmpDataVec; bool m_bDecoderCanIgnoreMask; };
NAMESPACE_LERC_END
#endif