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/JBig2_DocumentContext.h | 34 +++ 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 --------------------- core/fxcodec/fx_codec.h | 129 +++++++++++ core/fxcodec/fx_codec_def.h | 92 ++++++++ core/fxcodec/include/DEPS | 3 - core/fxcodec/include/JBig2_DocumentContext.h | 34 --- core/fxcodec/include/fx_codec.h | 129 ----------- core/fxcodec/include/fx_codec_def.h | 92 -------- core/fxcodec/jbig2/JBig2_Context.h | 2 +- core/fxcodec/jbig2/JBig2_GrdProc.cpp | 2 +- core/fxcodec/jbig2/JBig2_GrdProc.h | 2 +- 27 files changed, 512 insertions(+), 515 deletions(-) create mode 100644 core/fxcodec/JBig2_DocumentContext.h create mode 100644 core/fxcodec/codec/ccodec_progressivedecoder.h delete mode 100644 core/fxcodec/codec/include/ccodec_progressivedecoder.h create mode 100644 core/fxcodec/fx_codec.h create mode 100644 core/fxcodec/fx_codec_def.h delete mode 100644 core/fxcodec/include/DEPS delete mode 100644 core/fxcodec/include/JBig2_DocumentContext.h delete mode 100644 core/fxcodec/include/fx_codec.h delete mode 100644 core/fxcodec/include/fx_codec_def.h (limited to 'core/fxcodec') diff --git a/core/fxcodec/JBig2_DocumentContext.h b/core/fxcodec/JBig2_DocumentContext.h new file mode 100644 index 0000000000..9e5d3b3d3b --- /dev/null +++ b/core/fxcodec/JBig2_DocumentContext.h @@ -0,0 +1,34 @@ +// Copyright 2016 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_JBIG2_DOCUMENTCONTEXT_H_ +#define CORE_FXCODEC_JBIG2_DOCUMENTCONTEXT_H_ + +#include +#include +#include + +class CJBig2_SymbolDict; + +using CJBig2_CacheKey = std::pair; +using CJBig2_CachePair = + std::pair>; + +// Holds per-document JBig2 related data. +class JBig2_DocumentContext { + public: + JBig2_DocumentContext(); + ~JBig2_DocumentContext(); + + std::list* GetSymbolDictCache() { + return &m_SymbolDictCache; + } + + private: + std::list m_SymbolDictCache; +}; + +#endif // CORE_FXCODEC_JBIG2_DOCUMENTCONTEXT_H_ 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_ diff --git a/core/fxcodec/fx_codec.h b/core/fxcodec/fx_codec.h new file mode 100644 index 0000000000..5e00faf328 --- /dev/null +++ b/core/fxcodec/fx_codec.h @@ -0,0 +1,129 @@ +// 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_FX_CODEC_H_ +#define CORE_FXCODEC_FX_CODEC_H_ + +#include +#include +#include + +#include "core/fxcodec/codec/ccodec_basicmodule.h" +#include "core/fxcodec/codec/ccodec_faxmodule.h" +#include "core/fxcodec/codec/ccodec_flatemodule.h" +#include "core/fxcodec/codec/ccodec_iccmodule.h" +#include "core/fxcodec/codec/ccodec_jbig2module.h" +#include "core/fxcodec/codec/ccodec_jpegmodule.h" +#include "core/fxcodec/codec/ccodec_jpxmodule.h" +#include "core/fxcodec/codec/ccodec_scanlinedecoder.h" +#include "core/fxcodec/fx_codec_def.h" +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" + +class CFX_DIBSource; +class CJPX_Decoder; +class CPDF_ColorSpace; +class CPDF_StreamAcc; + +#ifdef PDF_ENABLE_XFA +#include "core/fxcodec/codec/ccodec_bmpmodule.h" +#include "core/fxcodec/codec/ccodec_gifmodule.h" +#include "core/fxcodec/codec/ccodec_pngmodule.h" +#include "core/fxcodec/codec/ccodec_tiffmodule.h" + +class CCodec_ProgressiveDecoder; + +class CFX_DIBAttribute { + public: + CFX_DIBAttribute(); + ~CFX_DIBAttribute(); + + int32_t m_nXDPI; + int32_t m_nYDPI; + FX_FLOAT m_fAspectRatio; + uint16_t m_wDPIUnit; + CFX_ByteString m_strAuthor; + uint8_t m_strTime[20]; + int32_t m_nGifLeft; + int32_t m_nGifTop; + uint32_t* m_pGifLocalPalette; + uint32_t m_nGifLocalPalNum; + int32_t m_nBmpCompressType; + std::map m_Exif; +}; +#endif // PDF_ENABLE_XFA + +class CCodec_ModuleMgr { + public: + CCodec_ModuleMgr(); + ~CCodec_ModuleMgr(); + + CCodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } + CCodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } + CCodec_JpegModule* GetJpegModule() const { return m_pJpegModule.get(); } + CCodec_JpxModule* GetJpxModule() const { return m_pJpxModule.get(); } + CCodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); } + CCodec_IccModule* GetIccModule() const { return m_pIccModule.get(); } + CCodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); } + +#ifdef PDF_ENABLE_XFA + CCodec_ProgressiveDecoder* CreateProgressiveDecoder(); + CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } + CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } + CCodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } + CCodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); } +#endif // PDF_ENABLE_XFA + + protected: + std::unique_ptr m_pBasicModule; + std::unique_ptr m_pFaxModule; + std::unique_ptr m_pJpegModule; + std::unique_ptr m_pJpxModule; + std::unique_ptr m_pJbig2Module; + std::unique_ptr m_pIccModule; + +#ifdef PDF_ENABLE_XFA + std::unique_ptr m_pPngModule; + std::unique_ptr m_pGifModule; + std::unique_ptr m_pBmpModule; + std::unique_ptr m_pTiffModule; +#endif // PDF_ENABLE_XFA + + std::unique_ptr m_pFlateModule; +}; + +void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels); +void sRGB_to_AdobeCMYK(FX_FLOAT R, + FX_FLOAT G, + FX_FLOAT B, + FX_FLOAT& c, + FX_FLOAT& m, + FX_FLOAT& y, + FX_FLOAT& k); +void AdobeCMYK_to_sRGB(FX_FLOAT c, + FX_FLOAT m, + FX_FLOAT y, + FX_FLOAT k, + FX_FLOAT& R, + FX_FLOAT& G, + FX_FLOAT& B); +void AdobeCMYK_to_sRGB1(uint8_t c, + uint8_t m, + uint8_t y, + uint8_t k, + uint8_t& R, + uint8_t& G, + uint8_t& B); +FX_BOOL MD5ComputeID(const void* buf, uint32_t dwSize, uint8_t ID[16]); +void FaxG4Decode(const uint8_t* src_buf, + uint32_t src_size, + int* pbitpos, + uint8_t* dest_buf, + int width, + int height, + int pitch); + +#endif // CORE_FXCODEC_FX_CODEC_H_ diff --git a/core/fxcodec/fx_codec_def.h b/core/fxcodec/fx_codec_def.h new file mode 100644 index 0000000000..fd23d78fa5 --- /dev/null +++ b/core/fxcodec/fx_codec_def.h @@ -0,0 +1,92 @@ +// 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_FX_CODEC_DEF_H_ +#define CORE_FXCODEC_FX_CODEC_DEF_H_ + +enum FXCODEC_STATUS { + FXCODEC_STATUS_ERROR = -1, + FXCODEC_STATUS_FRAME_READY, + FXCODEC_STATUS_FRAME_TOBECONTINUE, + FXCODEC_STATUS_DECODE_READY, + FXCODEC_STATUS_DECODE_TOBECONTINUE, + FXCODEC_STATUS_DECODE_FINISH, +#ifdef PDF_ENABLE_XFA + FXCODEC_STATUS_ERR_MEMORY, +#endif // PDF_ENABLE_XFA + FXCODEC_STATUS_ERR_READ, + FXCODEC_STATUS_ERR_FLUSH, + FXCODEC_STATUS_ERR_FORMAT, + FXCODEC_STATUS_ERR_PARAMS +}; +#define JP2_SPACE_INVALID -1 +#define JPX_SPACE_INVALID -1 +#define JP2_SPACE_bilevel1 0 +#define JP2_SPACE_YCbCr1 1 +#define JP2_SPACE_YCbCr2 3 +#define JP2_SPACE_YCbCr3 4 +#define JP2_SPACE_PhotoYCC 9 +#define JP2_SPACE_CMY 11 +#define JP2_SPACE_CMYK 12 +#define JP2_SPACE_YCCK 13 +#define JP2_SPACE_CIELab 14 +#define JP2_SPACE_bilevel2 15 +#define JP2_SPACE_sRGB 16 +#define JP2_SPACE_sLUM 17 +#define JP2_SPACE_sYCC 18 +#define JP2_SPACE_CIEJab 19 +#define JP2_SPACE_esRGB 20 +#define JP2_SPACE_ROMMRGB 21 +#define JP2_SPACE_YPbPr60 22 +#define JP2_SPACE_YPbPr50 23 +#define JP2_SPACE_esYCC 24 +#define JP2_SPACE_iccLUM 100 +#define JP2_SPACE_iccRGB 101 +#define Icc_INTENT_PERCEPTUAL 0 +#define Icc_INTENT_RELATIVE_COLORIMETRIC 1 +#define Icc_INTENT_SATURATION 2 +#define Icc_INTENT_ABSOLUTE_COLORIMETRIC 3 +#define Icc_FORMAT_DEFAULT 0 +#define Icc_FORMAT_SWAP (1 << 10) +#define Icc_FLAGS_DEFAULT 0x0000 +#define Icc_FLAGS_BLACKPOINTCOMPENSATION 0x2000 +#define Icc_FLAGS_NOWHITEONWHITEFIXUP 0x0004 +#define Icc_FLAGS_HIGHRESPRECALC 0x0400 +#define Icc_FLAGS_LOWRESPRECALC 0x0800 +#define Icc_FLAGS_GAMUTCHECK 0x1000 +#define Icc_FLAGS_SOFTPROOFING 0x4000 +#define Icc_PARAMTYPE_NONE 0 +#define Icc_PARAMTYPE_BUFFER 1 +#define Icc_PARAMTYPE_PARAM 2 +#ifdef PDF_ENABLE_XFA +enum FXCODEC_IMAGE_TYPE { + FXCODEC_IMAGE_UNKNOWN = 0, + FXCODEC_IMAGE_BMP, + FXCODEC_IMAGE_JPG, + FXCODEC_IMAGE_PNG, + FXCODEC_IMAGE_GIF, + FXCODEC_IMAGE_TIF, + FXCODEC_IMAGE_MAX +}; +enum FXCODEC_RESUNIT { + FXCODEC_RESUNIT_NONE = 0, + FXCODEC_RESUNIT_INCH, + FXCODEC_RESUNIT_CENTIMETER, + FXCODEC_RESUNIT_METER +}; +#endif // PDF_ENABLE_XFA +#define EXIFTAG_USHORT_RESUNIT 296 +#define EXIFTAG_FLOAT_DPIX 282 +#define EXIFTAG_FLOAT_DPIY 283 +#define EXIFTAG_USHORT_ORIENTATION 274 +#define EXIFTAG_STRING_MANUFACTURER 271 +#define EXIFTAG_STRING_MODULE 272 +#define EXIFTAG_STRING_SOFTWARE 305 +#define EXIFTAG_STRING_IAMGEDESCRIPTION 270 +#define EXIFTAG_STRING_DATETIME 306 +#define EXIFTAG_STRING_COPYRIGHT 33432 + +#endif // CORE_FXCODEC_FX_CODEC_DEF_H_ diff --git a/core/fxcodec/include/DEPS b/core/fxcodec/include/DEPS deleted file mode 100644 index 548eb61a3b..0000000000 --- a/core/fxcodec/include/DEPS +++ /dev/null @@ -1,3 +0,0 @@ -include_rules = [ - '+third_party/zlib_v128/zlib.h', -] diff --git a/core/fxcodec/include/JBig2_DocumentContext.h b/core/fxcodec/include/JBig2_DocumentContext.h deleted file mode 100644 index d49bdfab8e..0000000000 --- a/core/fxcodec/include/JBig2_DocumentContext.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 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_INCLUDE_JBIG2_DOCUMENTCONTEXT_H_ -#define CORE_FXCODEC_INCLUDE_JBIG2_DOCUMENTCONTEXT_H_ - -#include -#include -#include - -class CJBig2_SymbolDict; - -using CJBig2_CacheKey = std::pair; -using CJBig2_CachePair = - std::pair>; - -// Holds per-document JBig2 related data. -class JBig2_DocumentContext { - public: - JBig2_DocumentContext(); - ~JBig2_DocumentContext(); - - std::list* GetSymbolDictCache() { - return &m_SymbolDictCache; - } - - private: - std::list m_SymbolDictCache; -}; - -#endif // CORE_FXCODEC_INCLUDE_JBIG2_DOCUMENTCONTEXT_H_ diff --git a/core/fxcodec/include/fx_codec.h b/core/fxcodec/include/fx_codec.h deleted file mode 100644 index 8621db2b2c..0000000000 --- a/core/fxcodec/include/fx_codec.h +++ /dev/null @@ -1,129 +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_INCLUDE_FX_CODEC_H_ -#define CORE_FXCODEC_INCLUDE_FX_CODEC_H_ - -#include -#include -#include - -#include "core/fxcodec/codec/ccodec_basicmodule.h" -#include "core/fxcodec/codec/ccodec_faxmodule.h" -#include "core/fxcodec/codec/ccodec_flatemodule.h" -#include "core/fxcodec/codec/ccodec_iccmodule.h" -#include "core/fxcodec/codec/ccodec_jbig2module.h" -#include "core/fxcodec/codec/ccodec_jpegmodule.h" -#include "core/fxcodec/codec/ccodec_jpxmodule.h" -#include "core/fxcodec/codec/ccodec_scanlinedecoder.h" -#include "core/fxcodec/include/fx_codec_def.h" -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" - -class CFX_DIBSource; -class CJPX_Decoder; -class CPDF_ColorSpace; -class CPDF_StreamAcc; - -#ifdef PDF_ENABLE_XFA -#include "core/fxcodec/codec/ccodec_bmpmodule.h" -#include "core/fxcodec/codec/ccodec_gifmodule.h" -#include "core/fxcodec/codec/ccodec_pngmodule.h" -#include "core/fxcodec/codec/ccodec_tiffmodule.h" - -class CCodec_ProgressiveDecoder; - -class CFX_DIBAttribute { - public: - CFX_DIBAttribute(); - ~CFX_DIBAttribute(); - - int32_t m_nXDPI; - int32_t m_nYDPI; - FX_FLOAT m_fAspectRatio; - uint16_t m_wDPIUnit; - CFX_ByteString m_strAuthor; - uint8_t m_strTime[20]; - int32_t m_nGifLeft; - int32_t m_nGifTop; - uint32_t* m_pGifLocalPalette; - uint32_t m_nGifLocalPalNum; - int32_t m_nBmpCompressType; - std::map m_Exif; -}; -#endif // PDF_ENABLE_XFA - -class CCodec_ModuleMgr { - public: - CCodec_ModuleMgr(); - ~CCodec_ModuleMgr(); - - CCodec_BasicModule* GetBasicModule() const { return m_pBasicModule.get(); } - CCodec_FaxModule* GetFaxModule() const { return m_pFaxModule.get(); } - CCodec_JpegModule* GetJpegModule() const { return m_pJpegModule.get(); } - CCodec_JpxModule* GetJpxModule() const { return m_pJpxModule.get(); } - CCodec_Jbig2Module* GetJbig2Module() const { return m_pJbig2Module.get(); } - CCodec_IccModule* GetIccModule() const { return m_pIccModule.get(); } - CCodec_FlateModule* GetFlateModule() const { return m_pFlateModule.get(); } - -#ifdef PDF_ENABLE_XFA - CCodec_ProgressiveDecoder* CreateProgressiveDecoder(); - CCodec_PngModule* GetPngModule() const { return m_pPngModule.get(); } - CCodec_GifModule* GetGifModule() const { return m_pGifModule.get(); } - CCodec_BmpModule* GetBmpModule() const { return m_pBmpModule.get(); } - CCodec_TiffModule* GetTiffModule() const { return m_pTiffModule.get(); } -#endif // PDF_ENABLE_XFA - - protected: - std::unique_ptr m_pBasicModule; - std::unique_ptr m_pFaxModule; - std::unique_ptr m_pJpegModule; - std::unique_ptr m_pJpxModule; - std::unique_ptr m_pJbig2Module; - std::unique_ptr m_pIccModule; - -#ifdef PDF_ENABLE_XFA - std::unique_ptr m_pPngModule; - std::unique_ptr m_pGifModule; - std::unique_ptr m_pBmpModule; - std::unique_ptr m_pTiffModule; -#endif // PDF_ENABLE_XFA - - std::unique_ptr m_pFlateModule; -}; - -void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels); -void sRGB_to_AdobeCMYK(FX_FLOAT R, - FX_FLOAT G, - FX_FLOAT B, - FX_FLOAT& c, - FX_FLOAT& m, - FX_FLOAT& y, - FX_FLOAT& k); -void AdobeCMYK_to_sRGB(FX_FLOAT c, - FX_FLOAT m, - FX_FLOAT y, - FX_FLOAT k, - FX_FLOAT& R, - FX_FLOAT& G, - FX_FLOAT& B); -void AdobeCMYK_to_sRGB1(uint8_t c, - uint8_t m, - uint8_t y, - uint8_t k, - uint8_t& R, - uint8_t& G, - uint8_t& B); -FX_BOOL MD5ComputeID(const void* buf, uint32_t dwSize, uint8_t ID[16]); -void FaxG4Decode(const uint8_t* src_buf, - uint32_t src_size, - int* pbitpos, - uint8_t* dest_buf, - int width, - int height, - int pitch); - -#endif // CORE_FXCODEC_INCLUDE_FX_CODEC_H_ diff --git a/core/fxcodec/include/fx_codec_def.h b/core/fxcodec/include/fx_codec_def.h deleted file mode 100644 index fb1b5bcdac..0000000000 --- a/core/fxcodec/include/fx_codec_def.h +++ /dev/null @@ -1,92 +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_INCLUDE_FX_CODEC_DEF_H_ -#define CORE_FXCODEC_INCLUDE_FX_CODEC_DEF_H_ - -enum FXCODEC_STATUS { - FXCODEC_STATUS_ERROR = -1, - FXCODEC_STATUS_FRAME_READY, - FXCODEC_STATUS_FRAME_TOBECONTINUE, - FXCODEC_STATUS_DECODE_READY, - FXCODEC_STATUS_DECODE_TOBECONTINUE, - FXCODEC_STATUS_DECODE_FINISH, -#ifdef PDF_ENABLE_XFA - FXCODEC_STATUS_ERR_MEMORY, -#endif // PDF_ENABLE_XFA - FXCODEC_STATUS_ERR_READ, - FXCODEC_STATUS_ERR_FLUSH, - FXCODEC_STATUS_ERR_FORMAT, - FXCODEC_STATUS_ERR_PARAMS -}; -#define JP2_SPACE_INVALID -1 -#define JPX_SPACE_INVALID -1 -#define JP2_SPACE_bilevel1 0 -#define JP2_SPACE_YCbCr1 1 -#define JP2_SPACE_YCbCr2 3 -#define JP2_SPACE_YCbCr3 4 -#define JP2_SPACE_PhotoYCC 9 -#define JP2_SPACE_CMY 11 -#define JP2_SPACE_CMYK 12 -#define JP2_SPACE_YCCK 13 -#define JP2_SPACE_CIELab 14 -#define JP2_SPACE_bilevel2 15 -#define JP2_SPACE_sRGB 16 -#define JP2_SPACE_sLUM 17 -#define JP2_SPACE_sYCC 18 -#define JP2_SPACE_CIEJab 19 -#define JP2_SPACE_esRGB 20 -#define JP2_SPACE_ROMMRGB 21 -#define JP2_SPACE_YPbPr60 22 -#define JP2_SPACE_YPbPr50 23 -#define JP2_SPACE_esYCC 24 -#define JP2_SPACE_iccLUM 100 -#define JP2_SPACE_iccRGB 101 -#define Icc_INTENT_PERCEPTUAL 0 -#define Icc_INTENT_RELATIVE_COLORIMETRIC 1 -#define Icc_INTENT_SATURATION 2 -#define Icc_INTENT_ABSOLUTE_COLORIMETRIC 3 -#define Icc_FORMAT_DEFAULT 0 -#define Icc_FORMAT_SWAP (1 << 10) -#define Icc_FLAGS_DEFAULT 0x0000 -#define Icc_FLAGS_BLACKPOINTCOMPENSATION 0x2000 -#define Icc_FLAGS_NOWHITEONWHITEFIXUP 0x0004 -#define Icc_FLAGS_HIGHRESPRECALC 0x0400 -#define Icc_FLAGS_LOWRESPRECALC 0x0800 -#define Icc_FLAGS_GAMUTCHECK 0x1000 -#define Icc_FLAGS_SOFTPROOFING 0x4000 -#define Icc_PARAMTYPE_NONE 0 -#define Icc_PARAMTYPE_BUFFER 1 -#define Icc_PARAMTYPE_PARAM 2 -#ifdef PDF_ENABLE_XFA -enum FXCODEC_IMAGE_TYPE { - FXCODEC_IMAGE_UNKNOWN = 0, - FXCODEC_IMAGE_BMP, - FXCODEC_IMAGE_JPG, - FXCODEC_IMAGE_PNG, - FXCODEC_IMAGE_GIF, - FXCODEC_IMAGE_TIF, - FXCODEC_IMAGE_MAX -}; -enum FXCODEC_RESUNIT { - FXCODEC_RESUNIT_NONE = 0, - FXCODEC_RESUNIT_INCH, - FXCODEC_RESUNIT_CENTIMETER, - FXCODEC_RESUNIT_METER -}; -#endif // PDF_ENABLE_XFA -#define EXIFTAG_USHORT_RESUNIT 296 -#define EXIFTAG_FLOAT_DPIX 282 -#define EXIFTAG_FLOAT_DPIY 283 -#define EXIFTAG_USHORT_ORIENTATION 274 -#define EXIFTAG_STRING_MANUFACTURER 271 -#define EXIFTAG_STRING_MODULE 272 -#define EXIFTAG_STRING_SOFTWARE 305 -#define EXIFTAG_STRING_IAMGEDESCRIPTION 270 -#define EXIFTAG_STRING_DATETIME 306 -#define EXIFTAG_STRING_COPYRIGHT 33432 - -#endif // CORE_FXCODEC_INCLUDE_FX_CODEC_DEF_H_ diff --git a/core/fxcodec/jbig2/JBig2_Context.h b/core/fxcodec/jbig2/JBig2_Context.h index 8ae00a9bad..ab94d9eb98 100644 --- a/core/fxcodec/jbig2/JBig2_Context.h +++ b/core/fxcodec/jbig2/JBig2_Context.h @@ -13,7 +13,7 @@ #include #include "core/fpdfapi/fpdf_parser/cpdf_object.h" -#include "core/fxcodec/include/fx_codec_def.h" +#include "core/fxcodec/fx_codec_def.h" #include "core/fxcodec/jbig2/JBig2_List.h" #include "core/fxcodec/jbig2/JBig2_Page.h" #include "core/fxcodec/jbig2/JBig2_Segment.h" diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp index b692909c01..344367dfa3 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp @@ -8,7 +8,7 @@ #include -#include "core/fxcodec/include/fx_codec.h" +#include "core/fxcodec/fx_codec.h" #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" #include "core/fxcodec/jbig2/JBig2_BitStream.h" #include "core/fxcodec/jbig2/JBig2_Image.h" diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h index 6026798aad..ea9748ce80 100644 --- a/core/fxcodec/jbig2/JBig2_GrdProc.h +++ b/core/fxcodec/jbig2/JBig2_GrdProc.h @@ -7,7 +7,7 @@ #ifndef CORE_FXCODEC_JBIG2_JBIG2_GRDPROC_H_ #define CORE_FXCODEC_JBIG2_JBIG2_GRDPROC_H_ -#include "core/fxcodec/include/fx_codec_def.h" +#include "core/fxcodec/fx_codec_def.h" #include "core/fxcrt/include/fx_coordinates.h" #include "core/fxcrt/include/fx_system.h" -- cgit v1.2.3