⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jpdequan.h

📁 超强jpeg解码程序
💻 H
字号:
#ifndef __JPDEQUAN_H
#define __JPDEQUAN_H
#include <iostream>
#include "jpeg.h"
#include "bitimage.h"

class JpegDecoder ;

class JpegDecoderQuantizationTable
{
public:
  JpegDecoderQuantizationTable() ;
  ~JpegDecoderQuantizationTable() {}

  // This function tells the caller if the quantization table has been
  // defined by the JPEG input stream.
  bool Defined () const ;

  // Function to read the quantization table from the input stream.
  void ReadTable (JpegDecoder &decoder, unsigned int precision) ;

  // This function builds the scaled quantization tables used in
  // fast IDCT implementations.
  void BuildScaledTables () ;

  // This function prints the contents of the quantization table to
  // an output stream.
  void Print (std::ostream &) const ;

  UBYTE2 operator[](unsigned int) const ;
  UBYTE2 &operator[](unsigned int) ;
private:
  // Dummy Declarations for Required Member Functions
  JpegDecoderQuantizationTable (const JpegDecoderQuantizationTable&) ;
  JpegDecoderQuantizationTable &operator=(const JpegDecoderQuantizationTable&) ;

  // Quantization Values in Zig-Zag Order.
  UBYTE2 data_values [JpegSampleSize] ;


  // This flag gets set to true when the quantization is defined in the
  // JPEG input stream. It is used to ensure that an compressed scan does
  // not attempt to use an undefined quantization table.
  bool table_defined ;

  friend class JpegDecoderDataUnit ;
} ;

inline bool JpegDecoderQuantizationTable::Defined () const
{
  return table_defined ;
}


inline std::ostream &operator<<(std::ostream &strm,
                                const JpegDecoderQuantizationTable &du)
{
  du.Print (strm) ;
  return strm ;
}

inline UBYTE2 &JpegDecoderQuantizationTable::operator[](unsigned int index)
{
  return data_values [index] ;
}

inline UBYTE2 JpegDecoderQuantizationTable::operator[](unsigned int index) const
{
  return data_values [index] ;
}


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -