OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ | 7 #ifndef CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ |
8 #define CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ | 8 #define CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "core/fxcodec/fx_codec_def.h" | 12 #include "core/fxcodec/fx_codec_def.h" |
| 13 #include "core/fxcrt/cfx_retain_ptr.h" |
13 #include "core/fxcrt/fx_system.h" | 14 #include "core/fxcrt/fx_system.h" |
14 #include "core/fxge/fx_dib.h" | 15 #include "core/fxge/fx_dib.h" |
15 | 16 |
16 class CCodec_BmpModule; | 17 class CCodec_BmpModule; |
17 class CCodec_GifContext; | 18 class CCodec_GifContext; |
18 class CCodec_GifModule; | 19 class CCodec_GifModule; |
19 class CCodec_JpegModule; | 20 class CCodec_JpegModule; |
20 class CCodec_ModuleMgr; | 21 class CCodec_ModuleMgr; |
21 class CCodec_PngContext; | 22 class CCodec_PngContext; |
22 class CCodec_TiffContext; | 23 class CCodec_TiffContext; |
(...skipping 15 matching lines...) Expand all Loading... |
38 FXCodec_8bppRgb = 0x008, | 39 FXCodec_8bppRgb = 0x008, |
39 FXCodec_Rgb = 0x018, | 40 FXCodec_Rgb = 0x018, |
40 FXCodec_Rgb32 = 0x020, | 41 FXCodec_Rgb32 = 0x020, |
41 FXCodec_Argb = 0x220, | 42 FXCodec_Argb = 0x220, |
42 FXCodec_Cmyk = 0x120 | 43 FXCodec_Cmyk = 0x120 |
43 }; | 44 }; |
44 | 45 |
45 explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); | 46 explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); |
46 ~CCodec_ProgressiveDecoder(); | 47 ~CCodec_ProgressiveDecoder(); |
47 | 48 |
48 FXCODEC_STATUS LoadImageInfo(IFX_SeekableReadStream* pFile, | 49 FXCODEC_STATUS LoadImageInfo( |
49 FXCODEC_IMAGE_TYPE imageType, | 50 const CFX_RetainPtr<IFX_SeekableReadStream>& pFile, |
50 CFX_DIBAttribute* pAttribute, | 51 FXCODEC_IMAGE_TYPE imageType, |
51 bool bSkipImageTypeCheck); | 52 CFX_DIBAttribute* pAttribute, |
| 53 bool bSkipImageTypeCheck); |
52 | 54 |
53 FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } | 55 FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } |
54 int32_t GetWidth() const { return m_SrcWidth; } | 56 int32_t GetWidth() const { return m_SrcWidth; } |
55 int32_t GetHeight() const { return m_SrcHeight; } | 57 int32_t GetHeight() const { return m_SrcHeight; } |
56 int32_t GetNumComponents() const { return m_SrcComponents; } | 58 int32_t GetNumComponents() const { return m_SrcComponents; } |
57 int32_t GetBPC() const { return m_SrcBPC; } | 59 int32_t GetBPC() const { return m_SrcBPC; } |
58 void SetClipBox(FX_RECT* clip); | 60 void SetClipBox(FX_RECT* clip); |
59 | 61 |
60 FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = nullptr); | 62 FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = nullptr); |
61 FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap, | 63 FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 120 |
119 void Calc(int dest_len, int src_len); | 121 void Calc(int dest_len, int src_len); |
120 PixelWeight* GetPixelWeight(int pixel) { | 122 PixelWeight* GetPixelWeight(int pixel) { |
121 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + | 123 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + |
122 pixel * m_ItemSize); | 124 pixel * m_ItemSize); |
123 } | 125 } |
124 int m_ItemSize; | 126 int m_ItemSize; |
125 std::vector<uint8_t> m_pWeightTables; | 127 std::vector<uint8_t> m_pWeightTables; |
126 }; | 128 }; |
127 | 129 |
128 IFX_SeekableReadStream* m_pFile; | 130 CFX_RetainPtr<IFX_SeekableReadStream> m_pFile; |
129 CCodec_ModuleMgr* m_pCodecMgr; | 131 CCodec_ModuleMgr* m_pCodecMgr; |
130 FXJPEG_Context* m_pJpegContext; | 132 FXJPEG_Context* m_pJpegContext; |
131 FXPNG_Context* m_pPngContext; | 133 FXPNG_Context* m_pPngContext; |
132 FXGIF_Context* m_pGifContext; | 134 FXGIF_Context* m_pGifContext; |
133 FXBMP_Context* m_pBmpContext; | 135 FXBMP_Context* m_pBmpContext; |
134 CCodec_TiffContext* m_pTiffContext; | 136 CCodec_TiffContext* m_pTiffContext; |
135 FXCODEC_IMAGE_TYPE m_imagType; | 137 FXCODEC_IMAGE_TYPE m_imagType; |
136 uint32_t m_offSet; | 138 uint32_t m_offSet; |
137 uint8_t* m_pSrcBuf; | 139 uint8_t* m_pSrcBuf; |
138 uint32_t m_SrcSize; | 140 uint32_t m_SrcSize; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 FXCODEC_STATUS& err_status); | 228 FXCODEC_STATUS& err_status); |
227 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, | 229 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, |
228 double scale_y, | 230 double scale_y, |
229 int des_row); | 231 int des_row); |
230 bool BmpReadMoreData(CCodec_BmpModule* pBmpModule, | 232 bool BmpReadMoreData(CCodec_BmpModule* pBmpModule, |
231 FXCODEC_STATUS& err_status); | 233 FXCODEC_STATUS& err_status); |
232 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); | 234 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); |
233 }; | 235 }; |
234 | 236 |
235 #endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ | 237 #endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ |
OLD | NEW |