• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_FXCODEC_CODEC_CCODEC_SCANLINEDECODER_H_
8 #define CORE_FXCODEC_CODEC_CCODEC_SCANLINEDECODER_H_
9 
10 #include "core/fxcrt/fx_system.h"
11 
12 class IFX_PauseIndicator;
13 
14 class CCodec_ScanlineDecoder {
15  public:
16   CCodec_ScanlineDecoder();
17   CCodec_ScanlineDecoder(int nOrigWidth,
18                          int nOrigHeight,
19                          int nOutputWidth,
20                          int nOutputHeight,
21                          int nComps,
22                          int nBpc,
23                          uint32_t nPitch);
24   virtual ~CCodec_ScanlineDecoder();
25 
26   const uint8_t* GetScanline(int line);
27   bool SkipToScanline(int line, IFX_PauseIndicator* pPause);
28 
GetWidth()29   int GetWidth() { return m_OutputWidth; }
GetHeight()30   int GetHeight() { return m_OutputHeight; }
CountComps()31   int CountComps() { return m_nComps; }
GetBPC()32   int GetBPC() { return m_bpc; }
33 
34   virtual uint32_t GetSrcOffset() = 0;
35 
36  protected:
37   virtual bool v_Rewind() = 0;
38   virtual uint8_t* v_GetNextLine() = 0;
39 
40   uint8_t* ReadNextLine();
41 
42   int m_OrigWidth;
43   int m_OrigHeight;
44   int m_OutputWidth;
45   int m_OutputHeight;
46   int m_nComps;
47   int m_bpc;
48   uint32_t m_Pitch;
49   int m_NextLine;
50   uint8_t* m_pLastScanline;
51 };
52 
53 #endif  // CORE_FXCODEC_CODEC_CCODEC_SCANLINEDECODER_H_
54