Chromium Code Reviews| Index: core/include/fxcodec/fx_codec.h |
| diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h |
| index 8eacbb2e965dc75f9c2505eed7fcaa607399b9db..07ac37a5d872a6247c9bfc514697847e84e2e85e 100644 |
| --- a/core/include/fxcodec/fx_codec.h |
| +++ b/core/include/fxcodec/fx_codec.h |
| @@ -12,16 +12,16 @@ |
| #include "../../../third_party/base/nonstd_unique_ptr.h" |
| #include "../fxcrt/fx_basic.h" |
| -#include "../fxcrt/fx_coordinates.h" |
| #include "fx_codec_def.h" |
| #include "fx_codec_provider.h" |
| +#include "../fxcrt/fx_coordinates.h" // For FX_RECT. |
|
Tom Sepez
2015/10/29 21:54:03
note: moved because XFA only. Will look nice when
Lei Zhang
2015/10/30 06:06:31
Acknowledged.
|
| + |
| class CFX_DIBSource; |
| class CJPX_Decoder; |
| class CPDF_PrivateData; |
| class CPDF_StreamAcc; |
| class ICodec_ScanlineDecoder; |
| -class ICodec_ProgressiveDecoder; |
| class ICodec_BasicModule; |
| class ICodec_FaxModule; |
| class ICodec_JpegModule; |
| @@ -30,17 +30,36 @@ class ICodec_Jbig2Module; |
| class ICodec_IccModule; |
| class ICodec_FlateModule; |
| class ICodec_Jbig2Encoder; |
| +class ICodec_ScanlineDecoder; |
| + |
| +class ICodec_ProgressiveDecoder; |
|
Tom Sepez
2015/10/29 21:54:03
***
Lei Zhang
2015/10/30 06:06:31
Care to sort this section and the one above?
Tom Sepez
2015/10/30 20:10:34
Done. And there was a duplicate class that popped
|
| class ICodec_PngModule; |
| class ICodec_GifModule; |
| class ICodec_BmpModule; |
| class ICodec_TiffModule; |
| -class CFX_DIBAttribute; |
| -class ICodec_ScanlineDecoder; |
| + |
| +class CFX_DIBAttribute { |
| + public: |
| + CFX_DIBAttribute(); |
| + ~CFX_DIBAttribute(); |
| + |
| + int32_t m_nXDPI; |
| + int32_t m_nYDPI; |
| + FX_FLOAT m_fAspectRatio; |
| + FX_WORD m_wDPIUnit; |
| + CFX_ByteString m_strAuthor; |
| + uint8_t m_strTime[20]; |
| + int32_t m_nGifLeft; |
| + int32_t m_nGifTop; |
| + FX_DWORD* m_pGifLocalPalette; |
| + FX_DWORD m_nGifLocalPalNum; |
| + int32_t m_nBmpCompressType; |
| + std::map<FX_DWORD, void*> m_Exif; |
| +}; |
| class CCodec_ModuleMgr { |
| public: |
| CCodec_ModuleMgr(); |
| - ICodec_ProgressiveDecoder* CreateProgressiveDecoder(); |
| ICodec_Jbig2Encoder* CreateJbig2Encoder(); |
| ICodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } |
| ICodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } |
| @@ -49,6 +68,8 @@ class CCodec_ModuleMgr { |
| ICodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); } |
| ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); } |
| ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); } |
| + |
| + ICodec_ProgressiveDecoder* CreateProgressiveDecoder(); |
|
Tom Sepez
2015/10/29 21:54:03
***
Lei Zhang
2015/10/30 06:06:32
Acknowledged.
|
| ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } |
| ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } |
| ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } |
| @@ -62,6 +83,7 @@ class CCodec_ModuleMgr { |
| nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module; |
| nonstd::unique_ptr<ICodec_IccModule> m_pIccModule; |
| nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule; |
| + |
| nonstd::unique_ptr<ICodec_PngModule> m_pPngModule; |
|
Lei Zhang
2015/10/30 06:06:32
*** ?
Tom Sepez
2015/10/30 20:10:34
***
|
| nonstd::unique_ptr<ICodec_GifModule> m_pGifModule; |
| nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule; |
| @@ -212,7 +234,7 @@ class ICodec_JpegModule { |
| int* width, |
| int* height, |
| int* nComps, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| + CFX_DIBAttribute* pAttribute) = 0; |
| virtual int StartScanline(void* pContext, int down_scale) = 0; |
| @@ -253,9 +275,15 @@ class ICodec_PngModule { |
| virtual FX_BOOL Input(void* pContext, |
| const uint8_t* src_buf, |
| FX_DWORD src_size, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| + CFX_DIBAttribute* pAttribute) = 0; |
| - FX_BOOL (*ReadHeaderCallback)(void* pModule, int width, int height, int bpc, int pass, int* color_type, double* gamma); |
| + FX_BOOL (*ReadHeaderCallback)(void* pModule, |
| + int width, |
| + int height, |
| + int bpc, |
| + int pass, |
| + int* color_type, |
| + double* gamma); |
| FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, uint8_t*& src_buf); |
| @@ -282,7 +310,7 @@ class ICodec_GifModule { |
| int* pal_num, |
| void** pal_pp, |
| int* bg_index, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| + CFX_DIBAttribute* pAttribute) = 0; |
| virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0; |
| @@ -294,12 +322,18 @@ class ICodec_GifModule { |
| virtual int32_t LoadFrame(void* pContext, |
| int frame_num, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| - |
| - FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, FX_DWORD 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); |
| + CFX_DIBAttribute* pAttribute) = 0; |
| + |
| + FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, |
| + FX_DWORD 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); |
| void (*ReadScanlineCallback)(void* pModule, |
| int32_t row_num, |
| @@ -327,7 +361,7 @@ class ICodec_BmpModule { |
| int32_t* components, |
| int* pal_num, |
| FX_DWORD** pal_pp, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| + CFX_DIBAttribute* pAttribute) = 0; |
| virtual int32_t LoadImage(void* pContext) = 0; |
| @@ -351,7 +385,7 @@ class ICodec_TiffModule { |
| FX_DWORD& height, |
| FX_DWORD& comps, |
| FX_DWORD& bpc, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| + CFX_DIBAttribute* pAttribute) = 0; |
| virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0; |
| @@ -382,20 +416,15 @@ class ICodec_ProgressiveDecoder { |
| public: |
| virtual ~ICodec_ProgressiveDecoder() {} |
| - virtual FXCODEC_STATUS LoadImageInfo( |
| - IFX_FileRead* pFile, |
| - FXCODEC_IMAGE_TYPE imageType = FXCODEC_IMAGE_UNKNOWN, |
| - CFX_DIBAttribute* pAttribute = NULL) = 0; |
| - |
| - virtual FXCODEC_IMAGE_TYPE GetType() = 0; |
| - |
| - virtual int32_t GetWidth() = 0; |
| - |
| - virtual int32_t GetHeight() = 0; |
| - |
| - virtual int32_t GetNumComponents() = 0; |
| + virtual FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, |
| + FXCODEC_IMAGE_TYPE imageType, |
| + CFX_DIBAttribute* pAttribute) = 0; |
| - virtual int32_t GetBPC() = 0; |
| + virtual FXCODEC_IMAGE_TYPE GetType() const = 0; |
| + virtual int32_t GetWidth() const = 0; |
| + virtual int32_t GetHeight() const = 0; |
| + virtual int32_t GetNumComponents() const = 0; |
| + virtual int32_t GetBPC() const = 0; |
| virtual void SetClipBox(FX_RECT* clip) = 0; |
| @@ -503,26 +532,6 @@ void AdobeCMYK_to_sRGB1(uint8_t c, |
| uint8_t& G, |
| uint8_t& B); |
| FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]); |
| - |
| -class CFX_DIBAttribute { |
| - public: |
| - CFX_DIBAttribute(); |
| - ~CFX_DIBAttribute(); |
| - |
| - int32_t m_nXDPI; |
| - int32_t m_nYDPI; |
| - FX_FLOAT m_fAspectRatio; |
| - FX_WORD m_wDPIUnit; |
| - CFX_ByteString m_strAuthor; |
| - uint8_t m_strTime[20]; |
| - int32_t m_nGifLeft; |
| - int32_t m_nGifTop; |
| - FX_DWORD* m_pGifLocalPalette; |
| - FX_DWORD m_nGifLocalPalNum; |
| - int32_t m_nBmpCompressType; |
| - std::map<FX_DWORD, void*> m_Exif; |
| -}; |
| - |
| FX_BOOL FaxSkipEOL(const uint8_t* src_buf, int bitsize, int& bitpos); |
| FX_BOOL FaxGet1DLine(const uint8_t* src_buf, |
| int bitsize, |