From 8a4e286e686c3027f382afb07d3ddcec4610fdd9 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 13:43:30 -0700 Subject: Move core/fxcodec/codec/include and core/fxcodec/include files up BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2381063002 --- core/fxcodec/codec/ccodec_iccmodule.h | 2 +- core/fxcodec/codec/ccodec_jbig2module.h | 2 +- core/fxcodec/codec/ccodec_progressivedecoder.h | 238 +++++++++++++++++++++ core/fxcodec/codec/codec_int.h | 2 +- core/fxcodec/codec/fx_codec.cpp | 2 +- core/fxcodec/codec/fx_codec_bmp.cpp | 2 +- core/fxcodec/codec/fx_codec_fax.cpp | 2 +- core/fxcodec/codec/fx_codec_flate.cpp | 2 +- core/fxcodec/codec/fx_codec_gif.cpp | 2 +- core/fxcodec/codec/fx_codec_icc.cpp | 2 +- core/fxcodec/codec/fx_codec_jbig.cpp | 2 +- core/fxcodec/codec/fx_codec_jpeg.cpp | 2 +- core/fxcodec/codec/fx_codec_jpx_opj.cpp | 2 +- core/fxcodec/codec/fx_codec_png.cpp | 2 +- core/fxcodec/codec/fx_codec_progress.cpp | 4 +- core/fxcodec/codec/fx_codec_tiff.cpp | 2 +- .../codec/include/ccodec_progressivedecoder.h | 238 --------------------- 17 files changed, 254 insertions(+), 254 deletions(-) create mode 100644 core/fxcodec/codec/ccodec_progressivedecoder.h delete mode 100644 core/fxcodec/codec/include/ccodec_progressivedecoder.h (limited to 'core/fxcodec/codec') diff --git a/core/fxcodec/codec/ccodec_iccmodule.h b/core/fxcodec/codec/ccodec_iccmodule.h index 8d4d0e9ca0..f97065b971 100644 --- a/core/fxcodec/codec/ccodec_iccmodule.h +++ b/core/fxcodec/codec/ccodec_iccmodule.h @@ -7,7 +7,7 @@ #ifndef CORE_FXCODEC_CODEC_CCODEC_ICCMODULE_H_ #define CORE_FXCODEC_CODEC_CCODEC_ICCMODULE_H_ -#include "core/fxcodec/include/fx_codec_def.h" +#include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" diff --git a/core/fxcodec/codec/ccodec_jbig2module.h b/core/fxcodec/codec/ccodec_jbig2module.h index 765a11fcb4..d2b97b82a0 100644 --- a/core/fxcodec/codec/ccodec_jbig2module.h +++ b/core/fxcodec/codec/ccodec_jbig2module.h @@ -9,7 +9,7 @@ #include -#include "core/fxcodec/include/fx_codec_def.h" +#include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/include/fx_basic.h" class CJBig2_Context; diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h new file mode 100644 index 0000000000..8540493648 --- /dev/null +++ b/core/fxcodec/codec/ccodec_progressivedecoder.h @@ -0,0 +1,238 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ +#define CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ + +#include + +#include "core/fxcodec/fx_codec_def.h" +#include "core/fxcrt/include/fx_system.h" +#include "core/fxge/include/fx_dib.h" + +class CCodec_BmpModule; +class CCodec_GifContext; +class CCodec_GifModule; +class CCodec_JpegModule; +class CCodec_ModuleMgr; +class CCodec_PngContext; +class CCodec_TiffContext; +class CFX_DIBAttribute; +class IFX_FileRead; +class IFX_Pause; +struct FXBMP_Context; +struct FXGIF_Context; +struct FXJPEG_Context; +struct FXPNG_Context; + +class CCodec_ProgressiveDecoder { + public: + enum FXCodec_Format { + FXCodec_Invalid = 0, + FXCodec_1bppGray = 0x101, + FXCodec_1bppRgb = 0x001, + FXCodec_8bppGray = 0x108, + FXCodec_8bppRgb = 0x008, + FXCodec_Rgb = 0x018, + FXCodec_Rgb32 = 0x020, + FXCodec_Argb = 0x220, + FXCodec_Cmyk = 0x120 + }; + + explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); + ~CCodec_ProgressiveDecoder(); + + FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, + FXCODEC_IMAGE_TYPE imageType, + CFX_DIBAttribute* pAttribute, + bool bSkipImageTypeCheck); + + FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } + int32_t GetWidth() const { return m_SrcWidth; } + int32_t GetHeight() const { return m_SrcHeight; } + int32_t GetNumComponents() const { return m_SrcComponents; } + int32_t GetBPC() const { return m_SrcBPC; } + void SetClipBox(FX_RECT* clip); + + FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = nullptr); + FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap, + int start_x, + int start_y, + int size_x, + int size_y, + int32_t frames = 0, + FX_BOOL bInterpol = TRUE); + + FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); + + struct PixelWeight { + int m_SrcStart; + int m_SrcEnd; + int m_Weights[1]; + }; + + class CFXCODEC_WeightTable { + public: + CFXCODEC_WeightTable(); + ~CFXCODEC_WeightTable(); + + void Calc(int dest_len, + int dest_min, + int dest_max, + int src_len, + int src_min, + int src_max, + FX_BOOL bInterpol); + PixelWeight* GetPixelWeight(int pixel) { + return reinterpret_cast(m_pWeightTables.data() + + (pixel - m_DestMin) * m_ItemSize); + } + + int m_DestMin; + int m_ItemSize; + std::vector m_pWeightTables; + }; + + class CFXCODEC_HorzTable { + public: + CFXCODEC_HorzTable(); + ~CFXCODEC_HorzTable(); + + void Calc(int dest_len, int src_len, FX_BOOL bInterpol); + PixelWeight* GetPixelWeight(int pixel) { + return reinterpret_cast(m_pWeightTables.data() + + pixel * m_ItemSize); + } + + int m_ItemSize; + std::vector m_pWeightTables; + }; + + class CFXCODEC_VertTable { + public: + CFXCODEC_VertTable(); + ~CFXCODEC_VertTable(); + + void Calc(int dest_len, int src_len); + PixelWeight* GetPixelWeight(int pixel) { + return reinterpret_cast(m_pWeightTables.data() + + pixel * m_ItemSize); + } + int m_ItemSize; + std::vector m_pWeightTables; + }; + + IFX_FileRead* m_pFile; + CCodec_ModuleMgr* m_pCodecMgr; + FXJPEG_Context* m_pJpegContext; + FXPNG_Context* m_pPngContext; + FXGIF_Context* m_pGifContext; + FXBMP_Context* m_pBmpContext; + CCodec_TiffContext* m_pTiffContext; + FXCODEC_IMAGE_TYPE m_imagType; + uint32_t m_offSet; + uint8_t* m_pSrcBuf; + uint32_t m_SrcSize; + uint8_t* m_pDecodeBuf; + int m_ScanlineSize; + CFX_DIBitmap* m_pDeviceBitmap; + FX_BOOL m_bInterpol; + CFXCODEC_WeightTable m_WeightHorz; + CFXCODEC_VertTable m_WeightVert; + CFXCODEC_HorzTable m_WeightHorzOO; + int m_SrcWidth; + int m_SrcHeight; + int m_SrcComponents; + int m_SrcBPC; + FX_RECT m_clipBox; + int m_startX; + int m_startY; + int m_sizeX; + int m_sizeY; + int m_TransMethod; + FX_ARGB* m_pSrcPalette; + int m_SrcPaletteNumber; + int m_SrcRow; + FXCodec_Format m_SrcFormat; + int m_SrcPassNumber; + int m_FrameNumber; + int m_FrameCur; + int m_GifBgIndex; + uint8_t* m_pGifPalette; + int32_t m_GifPltNumber; + int m_GifTransIndex; + FX_RECT m_GifFrameRect; + FX_BOOL m_BmpIsTopBottom; + FXCODEC_STATUS m_status; + + protected: + static FX_BOOL PngReadHeaderFunc(void* pModule, + int width, + int height, + int bpc, + int pass, + int* color_type, + double* gamma); + static FX_BOOL PngAskScanlineBufFunc(void* pModule, + int line, + uint8_t*& src_buf); + static void PngFillScanlineBufCompletedFunc(void* pModule, + int pass, + int line); + static void GifRecordCurrentPositionCallback(void* pModule, + uint32_t& cur_pos); + static uint8_t* GifAskLocalPaletteBufCallback(void* pModule, + int32_t frame_num, + int32_t pal_size); + static FX_BOOL GifInputRecordPositionBufCallback(void* pModule, + uint32_t rcd_pos, + const FX_RECT& img_rc, + int32_t pal_num, + void* pal_ptr, + int32_t delay_time, + FX_BOOL user_input, + int32_t trans_index, + int32_t disposal_method, + FX_BOOL interlace); + static void GifReadScanlineCallback(void* pModule, + int32_t row_num, + uint8_t* row_buf); + static FX_BOOL BmpInputImagePositionBufCallback(void* pModule, + uint32_t rcd_pos); + static void BmpReadScanlineCallback(void* pModule, + int32_t row_num, + uint8_t* row_buf); + + FX_BOOL DetectImageType(FXCODEC_IMAGE_TYPE imageType, + CFX_DIBAttribute* pAttribute); + void GetDownScale(int& down_scale); + void GetTransMethod(FXDIB_Format des_format, FXCodec_Format src_format); + void ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, + int32_t des_line, + uint8_t* src_scan, + FXCodec_Format src_format); + void Resample(CFX_DIBitmap* pDeviceBitmap, + int32_t src_line, + uint8_t* src_scan, + FXCodec_Format src_format); + void ResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); + FX_BOOL JpegReadMoreData(CCodec_JpegModule* pJpegModule, + FXCODEC_STATUS& err_status); + void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, + int32_t des_line, + uint8_t* src_scan, + FXCodec_Format src_format); + FX_BOOL GifReadMoreData(CCodec_GifModule* pGifModule, + FXCODEC_STATUS& err_status); + void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, + double scale_y, + int des_row); + FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, + FXCODEC_STATUS& err_status); + void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); +}; + +#endif // CORE_FXCODEC_CODEC_CCODEC_PROGRESSIVEDECODER_H_ diff --git a/core/fxcodec/codec/codec_int.h b/core/fxcodec/codec/codec_int.h index 566bbc3c9b..edd5a67a25 100644 --- a/core/fxcodec/codec/codec_int.h +++ b/core/fxcodec/codec/codec_int.h @@ -14,7 +14,7 @@ #include #include -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcodec/jbig2/JBig2_Context.h" #include "third_party/libopenjpeg20/openjpeg.h" diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index 7f0c8ad225..60a64a1ab6 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include #include diff --git a/core/fxcodec/codec/fx_codec_bmp.cpp b/core/fxcodec/codec/fx_codec_bmp.cpp index beda53c05b..c58aefbef7 100644 --- a/core/fxcodec/codec/fx_codec_bmp.cpp +++ b/core/fxcodec/codec/fx_codec_bmp.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcodec/lbmp/fx_bmp.h" #include "core/fxge/include/fx_dib.h" struct FXBMP_Context { diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp index 91e6f9a7be..336c35b8d4 100644 --- a/core/fxcodec/codec/fx_codec_fax.cpp +++ b/core/fxcodec/codec/fx_codec_fax.cpp @@ -8,7 +8,7 @@ #include #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" namespace { diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp index fd86cf3380..c34aabbcab 100644 --- a/core/fxcodec/codec/fx_codec_flate.cpp +++ b/core/fxcodec/codec/fx_codec_flate.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/include/fx_ext.h" #include "third_party/zlib_v128/zlib.h" diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp index f04192ebef..f02dace23e 100644 --- a/core/fxcodec/codec/fx_codec_gif.cpp +++ b/core/fxcodec/codec/fx_codec_gif.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcodec/lgif/fx_gif.h" #include "core/fxge/include/fx_dib.h" struct FXGIF_Context { diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp index b5060a9fb6..8e48bfbfea 100644 --- a/core/fxcodec/codec/fx_codec_icc.cpp +++ b/core/fxcodec/codec/fx_codec_icc.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "third_party/lcms2-2.6/include/lcms2.h" const uint32_t N_COMPONENT_LAB = 3; diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp index 650d616a73..93e5494ea0 100644 --- a/core/fxcodec/codec/fx_codec_jbig.cpp +++ b/core/fxcodec/codec/fx_codec_jbig.cpp @@ -9,7 +9,7 @@ #include #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" -#include "core/fxcodec/include/JBig2_DocumentContext.h" +#include "core/fxcodec/JBig2_DocumentContext.h" #include "core/fxcodec/jbig2/JBig2_Context.h" #include "core/fxcodec/jbig2/JBig2_Image.h" #include "core/fxcrt/include/fx_memory.h" diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index c2814a4b4c..29c6f8c423 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -7,7 +7,7 @@ #include #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/include/fx_safe_types.h" #include "core/fxge/include/fx_dib.h" diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp index d5a95eef89..219b1a0a12 100644 --- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp +++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp @@ -10,7 +10,7 @@ #include "core/fpdfapi/fpdf_page/cpdf_colorspace.h" #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcrt/include/fx_safe_types.h" #include "third_party/lcms2-2.6/include/lcms2.h" #include "third_party/libopenjpeg20/openjpeg.h" diff --git a/core/fxcodec/codec/fx_codec_png.cpp b/core/fxcodec/codec/fx_codec_png.cpp index 9f7faa68e0..bfbdf6c675 100644 --- a/core/fxcodec/codec/fx_codec_png.cpp +++ b/core/fxcodec/codec/fx_codec_png.cpp @@ -7,7 +7,7 @@ #include #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxge/include/fx_dib.h" extern "C" { diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp index 9ac6913788..d468296acd 100644 --- a/core/fxcodec/codec/fx_codec_progress.cpp +++ b/core/fxcodec/codec/fx_codec_progress.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fxcodec/codec/include/ccodec_progressivedecoder.h" +#include "core/fxcodec/codec/ccodec_progressivedecoder.h" #include -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxge/include/fx_dib.h" #include "third_party/base/numerics/safe_math.h" diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp index 2a00bb2d20..d4e5ddeeb8 100644 --- a/core/fxcodec/codec/fx_codec_tiff.cpp +++ b/core/fxcodec/codec/fx_codec_tiff.cpp @@ -5,7 +5,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/fxcodec/codec/codec_int.h" -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxge/include/fx_dib.h" extern "C" { diff --git a/core/fxcodec/codec/include/ccodec_progressivedecoder.h b/core/fxcodec/codec/include/ccodec_progressivedecoder.h deleted file mode 100644 index 04b21da5ee..0000000000 --- a/core/fxcodec/codec/include/ccodec_progressivedecoder.h +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ -#define CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ - -#include - -#include "core/fxcodec/include/fx_codec_def.h" -#include "core/fxcrt/include/fx_system.h" -#include "core/fxge/include/fx_dib.h" - -class CCodec_BmpModule; -class CCodec_GifContext; -class CCodec_GifModule; -class CCodec_JpegModule; -class CCodec_ModuleMgr; -class CCodec_PngContext; -class CCodec_TiffContext; -class CFX_DIBAttribute; -class IFX_FileRead; -class IFX_Pause; -struct FXBMP_Context; -struct FXGIF_Context; -struct FXJPEG_Context; -struct FXPNG_Context; - -class CCodec_ProgressiveDecoder { - public: - enum FXCodec_Format { - FXCodec_Invalid = 0, - FXCodec_1bppGray = 0x101, - FXCodec_1bppRgb = 0x001, - FXCodec_8bppGray = 0x108, - FXCodec_8bppRgb = 0x008, - FXCodec_Rgb = 0x018, - FXCodec_Rgb32 = 0x020, - FXCodec_Argb = 0x220, - FXCodec_Cmyk = 0x120 - }; - - explicit CCodec_ProgressiveDecoder(CCodec_ModuleMgr* pCodecMgr); - ~CCodec_ProgressiveDecoder(); - - FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, - FXCODEC_IMAGE_TYPE imageType, - CFX_DIBAttribute* pAttribute, - bool bSkipImageTypeCheck); - - FXCODEC_IMAGE_TYPE GetType() const { return m_imagType; } - int32_t GetWidth() const { return m_SrcWidth; } - int32_t GetHeight() const { return m_SrcHeight; } - int32_t GetNumComponents() const { return m_SrcComponents; } - int32_t GetBPC() const { return m_SrcBPC; } - void SetClipBox(FX_RECT* clip); - - FXCODEC_STATUS GetFrames(int32_t& frames, IFX_Pause* pPause = nullptr); - FXCODEC_STATUS StartDecode(CFX_DIBitmap* pDIBitmap, - int start_x, - int start_y, - int size_x, - int size_y, - int32_t frames = 0, - FX_BOOL bInterpol = TRUE); - - FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = nullptr); - - struct PixelWeight { - int m_SrcStart; - int m_SrcEnd; - int m_Weights[1]; - }; - - class CFXCODEC_WeightTable { - public: - CFXCODEC_WeightTable(); - ~CFXCODEC_WeightTable(); - - void Calc(int dest_len, - int dest_min, - int dest_max, - int src_len, - int src_min, - int src_max, - FX_BOOL bInterpol); - PixelWeight* GetPixelWeight(int pixel) { - return reinterpret_cast(m_pWeightTables.data() + - (pixel - m_DestMin) * m_ItemSize); - } - - int m_DestMin; - int m_ItemSize; - std::vector m_pWeightTables; - }; - - class CFXCODEC_HorzTable { - public: - CFXCODEC_HorzTable(); - ~CFXCODEC_HorzTable(); - - void Calc(int dest_len, int src_len, FX_BOOL bInterpol); - PixelWeight* GetPixelWeight(int pixel) { - return reinterpret_cast(m_pWeightTables.data() + - pixel * m_ItemSize); - } - - int m_ItemSize; - std::vector m_pWeightTables; - }; - - class CFXCODEC_VertTable { - public: - CFXCODEC_VertTable(); - ~CFXCODEC_VertTable(); - - void Calc(int dest_len, int src_len); - PixelWeight* GetPixelWeight(int pixel) { - return reinterpret_cast(m_pWeightTables.data() + - pixel * m_ItemSize); - } - int m_ItemSize; - std::vector m_pWeightTables; - }; - - IFX_FileRead* m_pFile; - CCodec_ModuleMgr* m_pCodecMgr; - FXJPEG_Context* m_pJpegContext; - FXPNG_Context* m_pPngContext; - FXGIF_Context* m_pGifContext; - FXBMP_Context* m_pBmpContext; - CCodec_TiffContext* m_pTiffContext; - FXCODEC_IMAGE_TYPE m_imagType; - uint32_t m_offSet; - uint8_t* m_pSrcBuf; - uint32_t m_SrcSize; - uint8_t* m_pDecodeBuf; - int m_ScanlineSize; - CFX_DIBitmap* m_pDeviceBitmap; - FX_BOOL m_bInterpol; - CFXCODEC_WeightTable m_WeightHorz; - CFXCODEC_VertTable m_WeightVert; - CFXCODEC_HorzTable m_WeightHorzOO; - int m_SrcWidth; - int m_SrcHeight; - int m_SrcComponents; - int m_SrcBPC; - FX_RECT m_clipBox; - int m_startX; - int m_startY; - int m_sizeX; - int m_sizeY; - int m_TransMethod; - FX_ARGB* m_pSrcPalette; - int m_SrcPaletteNumber; - int m_SrcRow; - FXCodec_Format m_SrcFormat; - int m_SrcPassNumber; - int m_FrameNumber; - int m_FrameCur; - int m_GifBgIndex; - uint8_t* m_pGifPalette; - int32_t m_GifPltNumber; - int m_GifTransIndex; - FX_RECT m_GifFrameRect; - FX_BOOL m_BmpIsTopBottom; - FXCODEC_STATUS m_status; - - protected: - static FX_BOOL PngReadHeaderFunc(void* pModule, - int width, - int height, - int bpc, - int pass, - int* color_type, - double* gamma); - static FX_BOOL PngAskScanlineBufFunc(void* pModule, - int line, - uint8_t*& src_buf); - static void PngFillScanlineBufCompletedFunc(void* pModule, - int pass, - int line); - static void GifRecordCurrentPositionCallback(void* pModule, - uint32_t& cur_pos); - static uint8_t* GifAskLocalPaletteBufCallback(void* pModule, - int32_t frame_num, - int32_t pal_size); - static FX_BOOL GifInputRecordPositionBufCallback(void* pModule, - uint32_t rcd_pos, - const FX_RECT& img_rc, - int32_t pal_num, - void* pal_ptr, - int32_t delay_time, - FX_BOOL user_input, - int32_t trans_index, - int32_t disposal_method, - FX_BOOL interlace); - static void GifReadScanlineCallback(void* pModule, - int32_t row_num, - uint8_t* row_buf); - static FX_BOOL BmpInputImagePositionBufCallback(void* pModule, - uint32_t rcd_pos); - static void BmpReadScanlineCallback(void* pModule, - int32_t row_num, - uint8_t* row_buf); - - FX_BOOL DetectImageType(FXCODEC_IMAGE_TYPE imageType, - CFX_DIBAttribute* pAttribute); - void GetDownScale(int& down_scale); - void GetTransMethod(FXDIB_Format des_format, FXCodec_Format src_format); - void ReSampleScanline(CFX_DIBitmap* pDeviceBitmap, - int32_t des_line, - uint8_t* src_scan, - FXCodec_Format src_format); - void Resample(CFX_DIBitmap* pDeviceBitmap, - int32_t src_line, - uint8_t* src_scan, - FXCodec_Format src_format); - void ResampleVert(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); - FX_BOOL JpegReadMoreData(CCodec_JpegModule* pJpegModule, - FXCODEC_STATUS& err_status); - void PngOneOneMapResampleHorz(CFX_DIBitmap* pDeviceBitmap, - int32_t des_line, - uint8_t* src_scan, - FXCodec_Format src_format); - FX_BOOL GifReadMoreData(CCodec_GifModule* pGifModule, - FXCODEC_STATUS& err_status); - void GifDoubleLineResampleVert(CFX_DIBitmap* pDeviceBitmap, - double scale_y, - int des_row); - FX_BOOL BmpReadMoreData(CCodec_BmpModule* pBmpModule, - FXCODEC_STATUS& err_status); - void ResampleVertBT(CFX_DIBitmap* pDeviceBitmap, double scale_y, int des_row); -}; - -#endif // CORE_FXCODEC_CODEC_INCLUDE_CCODEC_PROGRESSIVEDECODER_H_ -- cgit v1.2.3