compblock.h
上传用户:lbr_007
上传日期:2019-05-31
资源大小:282k
文件大小:1k
源码类别:

传真(Fax)编程

开发平台:

Visual C++

  1. #ifndef COMPBLOCK_H__
  2. #define COMPBLOCK_H__
  3. class CompBlock {
  4. private:
  5. void InitBlock(void)
  6. {
  7. m_bits = 0;
  8. m_length = 0;
  9. m_off = 0;
  10. m_current_bit = 0;
  11. m_pre = m_fol = m_bucket = 0;
  12. m_pushed = m_popped = 0;
  13. }
  14. protected:
  15. unsigned char * m_bits;
  16. UINT32 m_length;
  17. UINT32 m_off;
  18. UINT32 m_current_bit;
  19. UINT32 m_pre;
  20. UINT32 m_fol;
  21. UINT32 m_bucket;
  22. UINT32 m_pushed;
  23. UINT32 m_popped;
  24. public:
  25. CompBlock(void);
  26. CompBlock(UINT32 length, unsigned char * ptr);
  27. ~CompBlock(void);
  28. void SetData(UINT32 length, unsigned char * ptr);
  29. unsigned char * GetData(void){ return m_bits;}
  30. void PopNumber(UINT32 num_bits, short& num);
  31. void PushNumber(UINT32 num_bits, short num);
  32. void PushNumber(UINT32 num_bits, UINT32 num);
  33. void PushNumber(UINT32 num_bits, unsigned char num);
  34. static UINT32 CalculateMinBits(UINT32 num);
  35. UINT32 GetCompressedSize(void)const;
  36. };
  37. #endif