| 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_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 7 #ifndef CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
| 8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 8 #define CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
| 9 | 9 |
| 10 #include "../../../../third_party/base/nonstd_unique_ptr.h" |
| 10 #include "../../../include/fpdfapi/fpdf_pageobj.h" | 11 #include "../../../include/fpdfapi/fpdf_pageobj.h" |
| 11 | 12 |
| 12 class CPDF_QuickStretcher; | 13 class CPDF_QuickStretcher; |
| 13 #define TYPE3_MAX_BLUES 16 | 14 #define TYPE3_MAX_BLUES 16 |
| 14 class CPDF_Type3Glyphs | 15 class CPDF_Type3Glyphs |
| 15 { | 16 { |
| 16 public: | 17 public: |
| 17 CPDF_Type3Glyphs() | 18 CPDF_Type3Glyphs() |
| 18 { | 19 { |
| 19 m_GlyphMap.InitHashTable(253); | 20 m_GlyphMap.InitHashTable(253); |
| 20 m_TopBlueCount = m_BottomBlueCount = 0; | 21 m_TopBlueCount = m_BottomBlueCount = 0; |
| 21 } | 22 } |
| 22 ~CPDF_Type3Glyphs(); | 23 ~CPDF_Type3Glyphs(); |
| 23 CFX_MapPtrToPtr m_GlyphMap; | 24 CFX_MapPtrToPtr m_GlyphMap; |
| 24 void AdjustBlue(FX_FLOAT top, FX_FLOA
T bottom, int& top_line, int& bottom_line); | 25 void AdjustBlue(FX_FLOAT top, FX_FLOA
T bottom, int& top_line, int& bottom_line); |
| 25 | 26 |
| 26 int m_TopBlue[TYPE3_MAX_BLUES], m_Bo
ttomBlue[TYPE3_MAX_BLUES]; | 27 int m_TopBlue[TYPE3_MAX_BLUES], m_Bo
ttomBlue[TYPE3_MAX_BLUES]; |
| 27 int m_TopBlueCount, m_BottomBlueCoun
t; | 28 int m_TopBlueCount, m_BottomBlueCoun
t; |
| 28 }; | 29 }; |
| 29 class CFX_GlyphBitmap; | 30 class CFX_GlyphBitmap; |
| 30 class CPDF_Type3Cache | 31 class CPDF_Type3Cache |
| 31 { | 32 { |
| 32 public: | 33 public: |
| 33 CPDF_Type3Cache(CPDF_Type3Font* pFont) | 34 CPDF_Type3Cache(CPDF_Type3Font* pFont) |
| 34 { | 35 { |
| 35 m_pFont = pFont; | 36 m_pFont = pFont; |
| 36 } | 37 } |
| 37 ~CPDF_Type3Cache(); | 38 ~CPDF_Type3Cache(); |
| 38 CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, const CFX_AffineMat
rix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f); | 39 CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, const CFX_AffineMat
rix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT retinaScaleY = 1.0f); |
| 39 protected: | 40 protected: |
| 40 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD ch
arcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT
retinaScaleY = 1.0f); | 41 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, FX_DWORD ch
arcode, const CFX_AffineMatrix* pMatrix, FX_FLOAT retinaScaleX = 1.0f, FX_FLOAT
retinaScaleY = 1.0f); |
| 41 CPDF_Type3Font* m_pFont; | 42 CPDF_Type3Font* m_pFont; |
| 42 CFX_MapByteStringToPtr m_SizeMap; | 43 CFX_MapByteStringToPtr m_SizeMap; |
| 43 }; | 44 }; |
| 44 class CPDF_TransferFunc | 45 class CPDF_TransferFunc |
| 45 { | 46 { |
| 46 public: | 47 public: |
| 47 CPDF_Document* m_pPDFDoc; | 48 CPDF_Document* m_pPDFDoc; |
| 48 FX_BYTE m_Samples[256 * 3]; | 49 FX_BYTE m_Samples[256 * 3]; |
| 49 FX_BOOL m_bIdentity; | 50 FX_BOOL m_bIdentity; |
| 50 | 51 |
| 51 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoD
ropSrc); | 52 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, FX_BOOL bAutoD
ropSrc); |
| 52 FX_COLORREF TranslateColor(FX_COLORREF src); | 53 FX_COLORREF TranslateColor(FX_COLORREF src); |
| 53 }; | 54 }; |
| 54 typedef CFX_MapPtrTemplate<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache*>*> CP
DF_Type3CacheMap; | 55 typedef CFX_MapPtrTemplate<CPDF_Font*, CPDF_CountedObject<CPDF_Type3Cache*>*> CP
DF_Type3CacheMap; |
| 55 typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_TransferFunc*>*
> CPDF_TransferFuncMap; | 56 typedef CFX_MapPtrTemplate<CPDF_Object*, CPDF_CountedObject<CPDF_TransferFunc*>*
> CPDF_TransferFuncMap; |
| 56 class CPDF_DocRenderData | 57 class CPDF_DocRenderData |
| 57 { | 58 { |
| 58 public: | 59 public: |
| 59 CPDF_DocRenderData(CPDF_Document* pPDFDoc = NULL); | 60 CPDF_DocRenderData(CPDF_Document* pPDFDoc = NULL); |
| 60 ~CPDF_DocRenderData(); | 61 ~CPDF_DocRenderData(); |
| 61 FX_BOOL Initialize(); | 62 FX_BOOL Initialize(); |
| 62 CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont); | 63 CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont); |
| 63 CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj); | 64 CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj); |
| 64 CFX_FontCache* GetFontCache() | 65 CFX_FontCache* GetFontCache() |
| 65 { | 66 { |
| 66 return m_pFontCache; | 67 return m_pFontCache; |
| 67 } | 68 } |
| 68 void Clear(FX_BOOL bRelease = FALSE); | 69 void Clear(FX_BOOL bRelease = FALSE); |
| 69 void ReleaseCachedType3(CPDF_Type3Font* pFont
); | 70 void ReleaseCachedType3(CPDF_Type3Font* pFont
); |
| 70 void ReleaseTransferFunc(CPDF_Object* pObj); | 71 void ReleaseTransferFunc(CPDF_Object* pObj); |
| 71 private: | 72 private: |
| 72 CPDF_Document* m_pPDFDoc; | 73 CPDF_Document* m_pPDFDoc; |
| 73 CFX_FontCache* m_pFontCache; | 74 CFX_FontCache* m_pFontCache; |
| 74 CPDF_Type3CacheMap m_Type3FaceMap; | 75 CPDF_Type3CacheMap m_Type3FaceMap; |
| 75 CPDF_TransferFuncMap m_TransferFuncMap; | 76 CPDF_TransferFuncMap m_TransferFuncMap; |
| 76 }; | 77 }; |
| 77 struct _PDF_RenderItem { | 78 struct _PDF_RenderItem { |
| 78 public: | 79 public: |
| 79 CPDF_PageObjects* m_pObjectList; | 80 CPDF_PageObjects* m_pObjectList; |
| 80 CFX_AffineMatrix m_Matrix; | 81 CFX_AffineMatrix m_Matrix; |
| 81 }; | 82 }; |
| 82 typedef CFX_ArrayTemplate<_PDF_RenderItem> CPDF_RenderLayer; | 83 typedef CFX_ArrayTemplate<_PDF_RenderItem> CPDF_RenderLayer; |
| 83 class IPDF_ObjectRenderer | 84 class IPDF_ObjectRenderer |
| 84 { | 85 { |
| 85 public: | 86 public: |
| 86 static IPDF_ObjectRenderer* Create(int type); | 87 static IPDF_ObjectRenderer* Create(int type); |
| 87 virtual ~IPDF_ObjectRenderer() {} | 88 virtual ~IPDF_ObjectRenderer() {} |
| 88 virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObjec
t* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FX
DIB_BLEND_NORMAL) = 0; | 89 virtual FX_BOOL Start(CPDF_RenderStatus* pRenderStatus, const CPDF_PageObjec
t* pObj, const CFX_AffineMatrix* pObj2Device, FX_BOOL bStdCS, int blendType = FX
DIB_BLEND_NORMAL) = 0; |
| 89 virtual FX_BOOL Continue(IFX_Pause* pPause) = 0; | 90 virtual FX_BOOL Continue(IFX_Pause* pPause) = 0; |
| 90 FX_BOOL m_Result; | 91 FX_BOOL m_Result; |
| 91 }; | 92 }; |
| 92 class CPDF_RenderStatus | 93 class CPDF_RenderStatus |
| 93 { | 94 { |
| 94 public: | 95 public: |
| 95 CPDF_RenderStatus(); | 96 CPDF_RenderStatus(); |
| 96 ~CPDF_RenderStatus(); | 97 ~CPDF_RenderStatus(); |
| 97 FX_BOOL Initialize(class CPDF_RenderContext* pContext, C
FX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, | 98 FX_BOOL Initialize(class CPDF_RenderContext* pContext, C
FX_RenderDevice* pDevice, const CFX_AffineMatrix* pDeviceMatrix, |
| 98 const CPDF_PageObject* pStopObj, const CPDF_Rende
rStatus* pParentStatus, | 99 const CPDF_PageObject* pStopObj, const CPDF_Rende
rStatus* pParentStatus, |
| 99 const CPDF_GraphicStates* pInitialStates, const C
PDF_RenderOptions* pOptions, | 100 const CPDF_GraphicStates* pInitialStates, const C
PDF_RenderOptions* pOptions, |
| 100 int transparency, FX_BOOL bDropObjects, CPDF_Dict
ionary* pFormResource = NULL, | 101 int transparency, FX_BOOL bDropObjects, CPDF_Dict
ionary* pFormResource = NULL, |
| 101 FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Ch
ar = NULL, FX_ARGB fill_color = 0, | 102 FX_BOOL bStdCS = FALSE, CPDF_Type3Char* pType3Ch
ar = NULL, FX_ARGB fill_color = 0, |
| 102 FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FAL
SE); | 103 FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FAL
SE); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 int m_Transparency; | 175 int m_Transparency; |
| 175 int m_DitherBits; | 176 int m_DitherBits; |
| 176 FX_BOOL m_bDropObjects; | 177 FX_BOOL m_bDropObjects; |
| 177 FX_BOOL m_bStdCS; | 178 FX_BOOL m_bStdCS; |
| 178 FX_DWORD m_GroupFamily; | 179 FX_DWORD m_GroupFamily; |
| 179 FX_BOOL m_bLoadMask; | 180 FX_BOOL m_bLoadMask; |
| 180 CPDF_Type3Char * m_pType3Char; | 181 CPDF_Type3Char * m_pType3Char; |
| 181 FX_ARGB m_T3FillColor; | 182 FX_ARGB m_T3FillColor; |
| 182 int m_curBlend; | 183 int m_curBlend; |
| 183 }; | 184 }; |
| 184 class CPDF_ImageLoader | 185 class CPDF_ImageLoader |
| 185 { | 186 { |
| 186 public: | 187 public: |
| 187 CPDF_ImageLoader() | 188 CPDF_ImageLoader() |
| 188 { | 189 { |
| 189 m_pBitmap = NULL; | 190 m_pBitmap = NULL; |
| 190 m_pMask = NULL; | 191 m_pMask = NULL; |
| 191 m_MatteColor = 0; | 192 m_MatteColor = 0; |
| 192 m_bCached = FALSE; | 193 m_bCached = FALSE; |
| 193 m_nDownsampleWidth = 0; | 194 m_nDownsampleWidth = 0; |
| 194 m_nDownsampleHeight = 0; | 195 m_nDownsampleHeight = 0; |
| 195 } | 196 } |
| 196 | 197 |
| 197 FX_BOOL Load(const CPDF_ImageObject* pIm
age, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily
= 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL); | 198 FX_BOOL Load(const CPDF_ImageObject* pIm
age, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_DWORD GroupFamily
= 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatus = NULL); |
| 198 | 199 |
| 199 FX_BOOL StartLoadImage(const CPDF_ImageO
bject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStd
CS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStat
us* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHei
ght = 0); | 200 FX_BOOL StartLoadImage(const CPDF_ImageO
bject* pImage, CPDF_PageRenderCache* pCache, FX_LPVOID& LoadHandle, FX_BOOL bStd
CS = FALSE, FX_DWORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStat
us* pRenderStatus = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHei
ght = 0); |
| 200 FX_BOOL Continue(FX_LPVOID LoadHandle, I
FX_Pause* pPause); | 201 FX_BOOL Continue(FX_LPVOID LoadHandle, I
FX_Pause* pPause); |
| 201 ~CPDF_ImageLoader(); | 202 ~CPDF_ImageLoader(); |
| 202 CFX_DIBSource* m_pBitmap; | 203 CFX_DIBSource* m_pBitmap; |
| 203 CFX_DIBSource* m_pMask; | 204 CFX_DIBSource* m_pMask; |
| 204 FX_DWORD m_MatteColor; | 205 FX_DWORD m_MatteColor; |
| 205 FX_BOOL m_bCached; | 206 FX_BOOL m_bCached; |
| 206 protected: | 207 protected: |
| 207 FX_INT32 m_nDownsampleWidth; | 208 FX_INT32 m_nDownsampleWidth; |
| 208 FX_INT32 m_nDownsampleHeight; | 209 FX_INT32 m_nDownsampleHeight; |
| 209 }; | 210 }; |
| 210 class CPDF_ProgressiveImageLoaderHandle | 211 class CPDF_ProgressiveImageLoaderHandle |
| 211 { | 212 { |
| 212 public: | 213 public: |
| 213 CPDF_ProgressiveImageLoaderHandle(); | 214 CPDF_ProgressiveImageLoaderHandle(); |
| 214 ~CPDF_ProgressiveImageLoaderHandle(); | 215 ~CPDF_ProgressiveImageLoaderHandle(); |
| 215 | 216 |
| 216 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF
_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_D
WORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatu
s = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0); | 217 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, const CPDF
_ImageObject* pImage, CPDF_PageRenderCache* pCache, FX_BOOL bStdCS = FALSE, FX_D
WORD GroupFamily = 0, FX_BOOL bLoadMask = FALSE, CPDF_RenderStatus* pRenderStatu
s = NULL, FX_INT32 nDownsampleWidth = 0, FX_INT32 nDownsampleHeight = 0); |
| 217 FX_BOOL Continue(IFX_Pause* pPause); | 218 FX_BOOL Continue(IFX_Pause* pPause); |
| 218 protected: | 219 protected: |
| 219 CPDF_ImageLoader* m_pImageLoader; | 220 CPDF_ImageLoader* m_pImageLoader; |
| 220 CPDF_PageRenderCache* m_pCache; | 221 CPDF_PageRenderCache* m_pCache; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 FX_LPVOID m_LoadHandle; | 254 FX_LPVOID m_LoadHandle; |
| 254 FX_BOOL m_bStdCS; | 255 FX_BOOL m_bStdCS; |
| 255 int m_BlendType; | 256 int m_BlendType; |
| 256 FX_BOOL StartBitmapAlpha(); | 257 FX_BOOL StartBitmapAlpha(); |
| 257 FX_BOOL StartDIBSource(); | 258 FX_BOOL StartDIBSource(); |
| 258 FX_BOOL StartRenderDIBSource(); | 259 FX_BOOL StartRenderDIBSource(); |
| 259 FX_BOOL StartLoadDIBSource(); | 260 FX_BOOL StartLoadDIBSource(); |
| 260 FX_BOOL DrawMaskedImage(); | 261 FX_BOOL DrawMaskedImage(); |
| 261 FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2
Device); | 262 FX_BOOL DrawPatternImage(const CFX_Matrix* pObj2
Device); |
| 262 }; | 263 }; |
| 263 class CPDF_ScaledRenderBuffer | 264 class CPDF_ScaledRenderBuffer |
| 264 { | 265 { |
| 265 public: | 266 public: |
| 266 CPDF_ScaledRenderBuffer(); | 267 CPDF_ScaledRenderBuffer(); |
| 267 ~CPDF_ScaledRenderBuffer(); | 268 ~CPDF_ScaledRenderBuffer(); |
| 268 FX_BOOL Initialize(CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice, FX_RECT* pRect, | 269 FX_BOOL Initialize(CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice, FX_RECT* pRect, |
| 269 const CPDF_PageObject* pObj, const CPDF_Rende
rOptions *pOptions = NULL, int max_dpi = 0); | 270 const CPDF_PageObject* pObj, const CPDF_Rende
rOptions *pOptions = NULL, int max_dpi = 0); |
| 270 CFX_RenderDevice* GetDevice() | 271 CFX_RenderDevice* GetDevice() |
| 271 { | 272 { |
| 272 return m_pBitmapDevice ? m_pBitmapDevice : m_pDevice; | 273 return m_pBitmapDevice ? m_pBitmapDevice : m_pDevice; |
| 273 } | 274 } |
| 274 CFX_AffineMatrix* GetMatrix() | 275 CFX_AffineMatrix* GetMatrix() |
| 275 { | 276 { |
| 276 return &m_Matrix; | 277 return &m_Matrix; |
| 277 } | 278 } |
| 278 void OutputToDevice(); | 279 void OutputToDevice(); |
| 279 private: | 280 private: |
| 280 CFX_RenderDevice* m_pDevice; | 281 CFX_RenderDevice* m_pDevice; |
| 281 CPDF_RenderContext* m_pContext; | 282 CPDF_RenderContext* m_pContext; |
| 282 FX_RECT m_Rect; | 283 FX_RECT m_Rect; |
| 283 const CPDF_PageObject* m_pObject; | 284 const CPDF_PageObject* m_pObject; |
| 284 CFX_FxgeDevice* m_pBitmapDevice; | 285 CFX_FxgeDevice* m_pBitmapDevice; |
| 285 CFX_AffineMatrix m_Matrix; | 286 CFX_AffineMatrix m_Matrix; |
| 286 }; | 287 }; |
| 287 class ICodec_ScanlineDecoder; | 288 class ICodec_ScanlineDecoder; |
| 288 class CPDF_QuickStretcher | 289 class CPDF_QuickStretcher |
| 289 { | 290 { |
| 290 public: | 291 public: |
| 291 CPDF_QuickStretcher(); | 292 CPDF_QuickStretcher(); |
| 292 ~CPDF_QuickStretcher(); | 293 ~CPDF_QuickStretcher(); |
| 293 FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pIm
age2Device, const FX_RECT* pClipBox); | 294 FX_BOOL Start(CPDF_ImageObject* pImageObj, CFX_AffineMatrix* pIm
age2Device, const FX_RECT* pClipBox); |
| 294 FX_BOOL Continue(IFX_Pause* pPause); | 295 FX_BOOL Continue(IFX_Pause* pPause); |
| 295 CFX_DIBitmap* m_pBitmap; | 296 CFX_DIBitmap* m_pBitmap; |
| 296 int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop; | 297 int m_ResultLeft, m_ResultTop, m_ClipLeft, m_ClipTop; |
| 297 int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight
; | 298 int m_DestWidth, m_DestHeight, m_ResultWidth, m_ResultHeight
; |
| 298 int m_Bpp, m_SrcWidth, m_SrcHeight; | 299 int m_Bpp, m_SrcWidth, m_SrcHeight; |
| 299 FX_BOOL m_bFlipX, m_bFlipY; | 300 FX_BOOL m_bFlipX, m_bFlipY; |
| 300 CPDF_ColorSpace* m_pCS; | 301 CPDF_ColorSpace* m_pCS; |
| 301 ICodec_ScanlineDecoder* m_pDecoder; | 302 ICodec_ScanlineDecoder* m_pDecoder; |
| 302 CPDF_StreamAcc m_StreamAcc; | 303 CPDF_StreamAcc m_StreamAcc; |
| 303 int m_LineIndex; | 304 int m_LineIndex; |
| 304 }; | 305 }; |
| 305 class CPDF_DeviceBuffer | 306 class CPDF_DeviceBuffer |
| 306 { | 307 { |
| 307 public: | 308 public: |
| 308 CPDF_DeviceBuffer(); | 309 CPDF_DeviceBuffer(); |
| 309 ~CPDF_DeviceBuffer(); | 310 ~CPDF_DeviceBuffer(); |
| 310 FX_BOOL Initialize(CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice, FX_RECT* pRect, | 311 FX_BOOL Initialize(CPDF_RenderContext* pContext,
CFX_RenderDevice* pDevice, FX_RECT* pRect, |
| 311 const CPDF_PageObject* pObj, int max_dpi = 0)
; | 312 const CPDF_PageObject* pObj, int max_dpi = 0)
; |
| 312 void OutputToDevice(); | 313 void OutputToDevice(); |
| 313 CFX_DIBitmap* GetBitmap() const | 314 CFX_DIBitmap* GetBitmap() const |
| 314 { | 315 { |
| 315 return m_pBitmap; | 316 return m_pBitmap; |
| 316 } | 317 } |
| 317 const CFX_AffineMatrix* GetMatrix() const | 318 const CFX_AffineMatrix* GetMatrix() const |
| 318 { | 319 { |
| 319 return &m_Matrix; | 320 return &m_Matrix; |
| 320 } | 321 } |
| 321 private: | 322 private: |
| 322 CFX_RenderDevice* m_pDevice; | 323 CFX_RenderDevice* m_pDevice; |
| 323 CPDF_RenderContext* m_pContext; | 324 CPDF_RenderContext* m_pContext; |
| 324 FX_RECT m_Rect; | 325 FX_RECT m_Rect; |
| 325 const CPDF_PageObject* m_pObject; | 326 const CPDF_PageObject* m_pObject; |
| 326 CFX_DIBitmap* m_pBitmap; | 327 CFX_DIBitmap* m_pBitmap; |
| 327 CFX_AffineMatrix m_Matrix; | 328 CFX_AffineMatrix m_Matrix; |
| 328 }; | 329 }; |
| 329 class CPDF_ImageCache | 330 class CPDF_ImageCache |
| 330 { | 331 { |
| 331 public: | 332 public: |
| 332 CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream); | 333 CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream); |
| 333 ~CPDF_ImageCache(); | 334 ~CPDF_ImageCache(); |
| 334 void ClearImageData(); | 335 void ClearImageData(); |
| 335 void Reset(const CFX_DIBitmap* pBitmap); | 336 void Reset(const CFX_DIBitmap* pBitmap); |
| 336 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap,
CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, | 337 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap,
CFX_DIBSource*& pMask, FX_DWORD& MatteColor, CPDF_Dictionary* pPageResources, |
| 337 FX_BOOL bStdCS = FALSE, FX_DWORD GroupFa
mily = 0, FX_BOOL bLoadMask = FALSE, | 338 FX_BOOL bStdCS = FALSE, FX_DWORD GroupFa
mily = 0, FX_BOOL bLoadMask = FALSE, |
| 338 CPDF_RenderStatus* pRenderStatus = NULL,
FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); | 339 CPDF_RenderStatus* pRenderStatus = NULL,
FX_INT32 downsampleWidth = 0, FX_INT32 downsampleHeight = 0); |
| 339 FX_DWORD EstimateSize() const | 340 FX_DWORD EstimateSize() const |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 FX_DWORD m_nComponents; | 437 FX_DWORD m_nComponents; |
| 437 FX_DWORD m_GroupFamily; | 438 FX_DWORD m_GroupFamily; |
| 438 FX_BOOL m_bLoadMask; | 439 FX_BOOL m_bLoadMask; |
| 439 FX_BOOL m_bDefaultDecode; | 440 FX_BOOL m_bDefaultDecode; |
| 440 FX_BOOL m_bImageMask; | 441 FX_BOOL m_bImageMask; |
| 441 FX_BOOL m_bDoBpcCheck; | 442 FX_BOOL m_bDoBpcCheck; |
| 442 FX_BOOL m_bColorKey; | 443 FX_BOOL m_bColorKey; |
| 443 DIB_COMP_DATA* m_pCompData; | 444 DIB_COMP_DATA* m_pCompData; |
| 444 FX_LPBYTE m_pLineBuf; | 445 FX_LPBYTE m_pLineBuf; |
| 445 FX_LPBYTE m_pMaskedLine; | 446 FX_LPBYTE m_pMaskedLine; |
| 446 CFX_DIBitmap*» » m_pCachedBitmap; | 447 nonstd::unique_ptr<CFX_DIBitmap> m_pCachedBitmap; |
| 447 ICodec_ScanlineDecoder* m_pDecoder; | 448 ICodec_ScanlineDecoder* m_pDecoder; |
| 448 }; | 449 }; |
| 449 #define FPDF_HUGE_IMAGE_SIZE 60000000 | 450 #define FPDF_HUGE_IMAGE_SIZE 60000000 |
| 450 class CPDF_DIBTransferFunc : public CFX_FilteredDIB | 451 class CPDF_DIBTransferFunc : public CFX_FilteredDIB |
| 451 { | 452 { |
| 452 public: | 453 public: |
| 453 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); | 454 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); |
| 454 virtual FXDIB_Format GetDestFormat(); | 455 virtual FXDIB_Format GetDestFormat(); |
| 455 virtual FX_ARGB* GetDestPalette() | 456 virtual FX_ARGB* GetDestPalette() |
| 456 { | 457 { |
| 457 return NULL; | 458 return NULL; |
| 458 } | 459 } |
| 459 virtual void TranslateScanline(FX_LPBYTE dest_buf, FX
_LPCBYTE src_buf) const; | 460 virtual void TranslateScanline(FX_LPBYTE dest_buf, FX
_LPCBYTE src_buf) const; |
| 460 virtual void TranslateDownSamples(FX_LPBYTE dest_buf,
FX_LPCBYTE src_buf, int pixels, int Bpp) const; | 461 virtual void TranslateDownSamples(FX_LPBYTE dest_buf,
FX_LPCBYTE src_buf, int pixels, int Bpp) const; |
| 461 FX_LPCBYTE m_RampR; | 462 FX_LPCBYTE m_RampR; |
| 462 FX_LPCBYTE m_RampG; | 463 FX_LPCBYTE m_RampG; |
| 463 FX_LPCBYTE m_RampB; | 464 FX_LPCBYTE m_RampB; |
| 464 }; | 465 }; |
| 465 struct _CPDF_UniqueKeyGen { | 466 struct _CPDF_UniqueKeyGen { |
| 466 void Generate(int count, ...); | 467 void Generate(int count, ...); |
| 467 FX_CHAR m_Key[128]; | 468 FX_CHAR m_Key[128]; |
| 468 int m_KeyLen; | 469 int m_KeyLen; |
| 469 }; | 470 }; |
| 470 | 471 |
| 471 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 472 #endif // CORE_SRC_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
| OLD | NEW |