📄 codecy.h
字号:
#ifndef CODECY_H
#define CODECY_H
struct CODECHDR {
char hdr[16];
unsigned int size; //compressed size not including header
unsigned short width; //image width
unsigned short height; //image height
unsigned short crc; //check sum including header
char res[6]; //reserved padding for 8byte alignement
};
class BaseFWT2D;
class mBior97;
class EZW;
class CodecY
{
public:
CodecY();
~CodecY();
inline unsigned int width() const;
inline unsigned int height() const;
void initgray(unsigned int width, unsigned int height);
unsigned char* compressgray(const unsigned char* data, unsigned int& size, unsigned int TH = 0);
int decompressgray(unsigned char* dest, unsigned char* sour);
private:
int m_status; //0 - not ready, 1 - OK initilazed
int m_width; //original image width
int m_height; //original image height
mBior97 *bior97; //bior97 class
EZW *ezw; //embedded zero-tree class
unsigned short crc(const unsigned char* addr, unsigned int len) const; //checksum for a frame
};
inline unsigned int CodecY::width() const
{
return m_width;
}
inline unsigned int CodecY::height() const
{
return m_height;
}
#endif
/*
initgray(width, height);
frame = compressgray(image, *size, TH); //0 - not initialized error
//0xaddr - OK addres of compressed frame
res = decompressgray(image, frame); //0 - not initialized error
//-1 - not 'YBior97EZW' header
//-2 - header width,height not equal to initialized bior97
//-3 - wrong crc of the frame, data corruption?
//-4 - EZW decompression error
//W*H - OK decompressed image size
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -