| 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/fx_system.h" | 13 #include "core/fxcrt/fx_system.h" |
| 14 #include "core/fxge/fx_dib.h" | 14 #include "core/fxge/fx_dib.h" |
| 15 | 15 |
| 16 class CCodec_BmpModule; | 16 class CCodec_BmpModule; |
| 17 class CCodec_GifContext; | 17 class CCodec_GifContext; |
| 18 class CCodec_GifModule; | 18 class CCodec_GifModule; |
| 19 class CCodec_JpegModule; | 19 class CCodec_JpegModule; |
| 20 class CCodec_ModuleMgr; | 20 class CCodec_ModuleMgr; |
| 21 class CCodec_PngContext; | 21 class CCodec_PngContext; |
| 22 class CCodec_TiffContext; | 22 class CCodec_TiffContext; |
| 23 class CFX_DIBAttribute; | 23 class CFX_DIBAttribute; |
| 24 class IFX_FileRead; | 24 class IFX_SeekableReadStream; |
| 25 class IFX_Pause; | 25 class IFX_Pause; |
| 26 struct FXBMP_Context; | 26 struct FXBMP_Context; |
| 27 struct FXGIF_Context; | 27 struct FXGIF_Context; |
| 28 struct FXJPEG_Context; | 28 struct FXJPEG_Context; |
| 29 struct FXPNG_Context; | 29 struct FXPNG_Context; |
| 30 | 30 |
| 31 class CCodec_ProgressiveDecoder { | 31 class CCodec_ProgressiveDecoder { |
| 32 public: | 32 public: |
| 33 enum FXCodec_Format { | 33 enum FXCodec_Format { |
| 34 FXCodec_Invalid = 0, | 34 FXCodec_Invalid = 0, |
| 35 FXCodec_1bppGray = 0x101, | 35 FXCodec_1bppGray = 0x101, |
| 36 FXCodec_1bppRgb = 0x001, | 36 FXCodec_1bppRgb = 0x001, |
| 37 FXCodec_8bppGray = 0x108, | 37 FXCodec_8bppGray = 0x108, |
| 38 FXCodec_8bppRgb = 0x008, | 38 FXCodec_8bppRgb = 0x008, |
| 39 FXCodec_Rgb = 0x018, | 39 FXCodec_Rgb = 0x018, |
| 40 FXCodec_Rgb32 = 0x020, | 40 FXCodec_Rgb32 = 0x020, |
| 41 FXCodec_Argb = 0x220, | 41 FXCodec_Argb = 0x220, |
| 42 FXCodec_Cmyk = 0x120 | 42 FXCodec_Cmyk = 0x120 |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); | 45 explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); |
| 46 ~CCodec_ProgressiveDecoder(); | 46 ~CCodec_ProgressiveDecoder(); |
| 47 | 47 |
| 48 FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, | 48 FXCODEC_STATUS LoadImageInfo(IFX_SeekableReadStream* pFile, |
| 49 FXCODEC_IMAGE_TYPE imageType, | 49 FXCODEC_IMAGE_TYPE imageType, |
| 50 CFX_DIBAttribute* pAttribute, | 50 CFX_DIBAttribute* pAttribute, |
| 51 bool bSkipImageTypeCheck); | 51 bool bSkipImageTypeCheck); |
| 52 | 52 |
| 53 FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } | 53 FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } |
| 54 int32_t GetWidth() const { return m_SrcWidth; } | 54 int32_t GetWidth() const { return m_SrcWidth; } |
| 55 int32_t GetHeight() const { return m_SrcHeight; } | 55 int32_t GetHeight() const { return m_SrcHeight; } |
| 56 int32_t GetNumComponents() const { return m_SrcComponents; } | 56 int32_t GetNumComponents() const { return m_SrcComponents; } |
| 57 int32_t GetBPC() const { return m_SrcBPC; } | 57 int32_t GetBPC() const { return m_SrcBPC; } |
| 58 void SetClipBox(FX_RECT* clip); | 58 void SetClipBox(FX_RECT* clip); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 void Calc(int dest_len, int src_len); | 119 void Calc(int dest_len, int src_len); |
| 120 PixelWeight* GetPixelWeight(int pixel) { | 120 PixelWeight* GetPixelWeight(int pixel) { |
| 121 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + | 121 return reinterpret_cast<PixelWeight*>(m_pWeightTables.data() + |
| 122 pixel * m_ItemSize); | 122 pixel * m_ItemSize); |
| 123 } | 123 } |
| 124 int m_ItemSize; | 124 int m_ItemSize; |
| 125 std::vector<uint8_t> m_pWeightTables; | 125 std::vector<uint8_t> m_pWeightTables; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 IFX_FileRead* m_pFile; | 128 IFX_SeekableReadStream* m_pFile; |
| 129 CCodec_ModuleMgr* m_pCodecMgr; | 129 CCodec_ModuleMgr* m_pCodecMgr; |
| 130 FXJPEG_Context* m_pJpegContext; | 130 FXJPEG_Context* m_pJpegContext; |
| 131 FXPNG_Context* m_pPngContext; | 131 FXPNG_Context* m_pPngContext; |
| 132 FXGIF_Context* m_pGifContext; | 132 FXGIF_Context* m_pGifContext; |
| 133 FXBMP_Context* m_pBmpContext; | 133 FXBMP_Context* m_pBmpContext; |
| 134 CCodec_TiffContext* m_pTiffContext; | 134 CCodec_TiffContext* m_pTiffContext; |
| 135 FXCODEC_IMAGE_TYPE m_imagType; | 135 FXCODEC_IMAGE_TYPE m_imagType; |
| 136 uint32_t m_offSet; | 136 uint32_t m_offSet; |
| 137 uint8_t* m_pSrcBuf; | 137 uint8_t* m_pSrcBuf; |
| 138 uint32_t m_SrcSize; | 138 uint32_t m_SrcSize; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 FXCODEC_STATUS& err_status); | 229 FXCODEC_STATUS& err_status); |
| 230 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, | 230 void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, |
| 231 double scale_y, | 231 double scale_y, |
| 232 int des_row); | 232 int des_row); |
| 233 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, | 233 FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, |
| 234 FXCODEC_STATUS& err_status); | 234 FXCODEC_STATUS& err_status); |
| 235 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); | 235 void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 #endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ | 238 #endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ |
| OLD | NEW |