Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Unified Diff: core/include/fxcodec/fx_codec.h

Issue 1398383002: core/ difference with XFA (for information only). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 2015-11-24 version Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/include/fpdfdoc/fpdf_doc.h ('k') | core/include/fxcodec/fx_codec_def.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fxcodec/fx_codec.h
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index c068a080257dfd72d410f39cbe756f57e36b8de2..54d185a8cef3fbcb3f4c1f13de291ec3353fdd6e 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -7,27 +7,71 @@
#ifndef CORE_INCLUDE_FXCODEC_FX_CODEC_H_
#define CORE_INCLUDE_FXCODEC_FX_CODEC_H_
+#ifdef PDF_ENABLE_XFA
+#include <map>
+#endif
#include <vector>
#include "core/include/fxcrt/fx_basic.h"
#include "fx_codec_def.h"
#include "third_party/base/nonstd_unique_ptr.h"
+#ifdef PDF_ENABLE_XFA
+#include "../fxcrt/fx_coordinates.h" // For FX_RECT.
+
+#endif
class CFX_DIBSource;
class CJPX_Decoder;
class CPDF_PrivateData;
class CPDF_StreamAcc;
+#ifndef PDF_ENABLE_XFA
class ICodec_ScanlineDecoder;
+#endif
class ICodec_BasicModule;
class ICodec_FaxModule;
+#ifdef PDF_ENABLE_XFA
+class ICodec_FlateModule;
+class ICodec_IccModule;
+class ICodec_Jbig2Encoder;
+class ICodec_Jbig2Module;
+#endif
class ICodec_JpegModule;
class ICodec_JpxModule;
+#ifndef PDF_ENABLE_XFA
class ICodec_Jbig2Module;
class ICodec_IccModule;
class ICodec_FlateModule;
class ICodec_Jbig2Encoder;
+#endif
class ICodec_ScanlineDecoder;
+#ifdef PDF_ENABLE_XFA
+class ICodec_BmpModule;
+class ICodec_GifModule;
+class ICodec_PngModule;
+class ICodec_ProgressiveDecoder;
+class ICodec_TiffModule;
+
+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;
+};
+
+#endif
class CCodec_ModuleMgr {
public:
CCodec_ModuleMgr();
@@ -40,6 +84,14 @@ class CCodec_ModuleMgr {
ICodec_IccModule* GetIccModule() const { return m_pIccModule.get(); }
ICodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); }
+#ifdef PDF_ENABLE_XFA
+ ICodec_ProgressiveDecoder* CreateProgressiveDecoder();
+ ICodec_PngModule* GetPngModule() const { return m_pPngModule.get(); }
+ ICodec_GifModule* GetGifModule() const { return m_pGifModule.get(); }
+ ICodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); }
+ ICodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); }
+
+#endif
protected:
nonstd::unique_ptr<ICodec_BasicModule> m_pBasicModule;
nonstd::unique_ptr<ICodec_FaxModule> m_pFaxModule;
@@ -48,6 +100,13 @@ class CCodec_ModuleMgr {
nonstd::unique_ptr<ICodec_Jbig2Module> m_pJbig2Module;
nonstd::unique_ptr<ICodec_IccModule> m_pIccModule;
nonstd::unique_ptr<ICodec_FlateModule> m_pFlateModule;
+#ifdef PDF_ENABLE_XFA
+
+ nonstd::unique_ptr<ICodec_PngModule> m_pPngModule;
+ nonstd::unique_ptr<ICodec_GifModule> m_pGifModule;
+ nonstd::unique_ptr<ICodec_BmpModule> m_pBmpModule;
+ nonstd::unique_ptr<ICodec_TiffModule> m_pTiffModule;
+#endif
};
class ICodec_BasicModule {
public:
@@ -191,7 +250,12 @@ class ICodec_JpegModule {
virtual int ReadHeader(void* pContext,
int* width,
int* height,
+#ifndef PDF_ENABLE_XFA
int* nComps) = 0;
+#else
+ int* nComps,
+ CFX_DIBAttribute* pAttribute) = 0;
+#endif
virtual int StartScanline(void* pContext, int down_scale) = 0;
@@ -221,6 +285,135 @@ class ICodec_JpxModule {
virtual void DestroyDecoder(CJPX_Decoder* pDecoder) = 0;
};
+#ifdef PDF_ENABLE_XFA
+class ICodec_PngModule {
+ public:
+ virtual ~ICodec_PngModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_BOOL Input(void* pContext,
+ const uint8_t* src_buf,
+ FX_DWORD src_size,
+ CFX_DIBAttribute* pAttribute) = 0;
+
+ 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);
+
+ void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line);
+};
+class ICodec_GifModule {
+ public:
+ virtual ~ICodec_GifModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_DWORD GetAvailInput(void* pContext,
+ uint8_t** avail_buf_ptr = NULL) = 0;
+
+ virtual void Input(void* pContext,
+ const uint8_t* src_buf,
+ FX_DWORD src_size) = 0;
+
+ virtual int32_t ReadHeader(void* pContext,
+ int* width,
+ int* height,
+ int* pal_num,
+ void** pal_pp,
+ int* bg_index,
+ CFX_DIBAttribute* pAttribute) = 0;
+
+ virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0;
+
+ void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
+
+ uint8_t* (*AskLocalPaletteBufCallback)(void* pModule,
+ int32_t frame_num,
+ int32_t pal_size);
+
+ virtual int32_t LoadFrame(void* pContext,
+ int frame_num,
+ 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,
+ uint8_t* row_buf);
+};
+class ICodec_BmpModule {
+ public:
+ virtual ~ICodec_BmpModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_DWORD GetAvailInput(void* pContext,
+ uint8_t** avail_buf_ptr = NULL) = 0;
+
+ virtual void Input(void* pContext,
+ const uint8_t* src_buf,
+ FX_DWORD src_size) = 0;
+
+ virtual int32_t ReadHeader(void* pContext,
+ int32_t* width,
+ int32_t* height,
+ FX_BOOL* tb_flag,
+ int32_t* components,
+ int* pal_num,
+ FX_DWORD** pal_pp,
+ CFX_DIBAttribute* pAttribute) = 0;
+
+ virtual int32_t LoadImage(void* pContext) = 0;
+
+ FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
+
+ void (*ReadScanlineCallback)(void* pModule,
+ int32_t row_num,
+ uint8_t* row_buf);
+};
+class ICodec_TiffModule {
+ public:
+ virtual ~ICodec_TiffModule() {}
+
+ virtual void* CreateDecoder(IFX_FileRead* file_ptr) = 0;
+
+ virtual void GetFrames(void* ctx, int32_t& frames) = 0;
+
+ virtual FX_BOOL LoadFrameInfo(void* ctx,
+ int32_t frame,
+ FX_DWORD& width,
+ FX_DWORD& height,
+ FX_DWORD& comps,
+ FX_DWORD& bpc,
+ CFX_DIBAttribute* pAttribute) = 0;
+
+ virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0;
+
+ virtual void DestroyDecoder(void* ctx) = 0;
+};
+#endif
class ICodec_Jbig2Module {
public:
@@ -242,6 +435,37 @@ class ICodec_Jbig2Module {
IFX_Pause* pPause) = 0;
virtual void DestroyJbig2Context(void* pJbig2Content) = 0;
};
+#ifdef PDF_ENABLE_XFA
+class ICodec_ProgressiveDecoder {
+ public:
+ virtual ~ICodec_ProgressiveDecoder() {}
+
+ virtual FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile,
+ FXCODEC_IMAGE_TYPE imageType,
+ CFX_DIBAttribute* pAttribute) = 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;
+
+ virtual FXCODEC_STATUS GetFrames(int32_t& frames,
+ IFX_Pause* pPause = NULL) = 0;
+
+ virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap,
+ int32_t start_x,
+ int32_t start_y,
+ int32_t size_x,
+ int32_t size_y,
+ int32_t frames = 0,
+ FX_BOOL bInterpol = TRUE) = 0;
+
+ virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
+};
+#endif
class ICodec_Jbig2Encoder {
public:
virtual ~ICodec_Jbig2Encoder() {}
« no previous file with comments | « core/include/fpdfdoc/fpdf_doc.h ('k') | core/include/fxcodec/fx_codec_def.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698