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_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
8 #define CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 8 #define CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, | 91 CFX_DIBSource* TranslateImage(const CFX_DIBSource* pSrc, |
92 FX_BOOL bAutoDropSrc); | 92 FX_BOOL bAutoDropSrc); |
93 | 93 |
94 CPDF_Document* const m_pPDFDoc; | 94 CPDF_Document* const m_pPDFDoc; |
95 FX_BOOL m_bIdentity; | 95 FX_BOOL m_bIdentity; |
96 uint8_t m_Samples[256 * 3]; | 96 uint8_t m_Samples[256 * 3]; |
97 }; | 97 }; |
98 | 98 |
99 class CPDF_DocRenderData { | 99 class CPDF_DocRenderData { |
100 public: | 100 public: |
101 CPDF_DocRenderData(CPDF_Document* pPDFDoc = NULL); | 101 CPDF_DocRenderData(CPDF_Document* pPDFDoc = nullptr); |
102 ~CPDF_DocRenderData(); | 102 ~CPDF_DocRenderData(); |
103 CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont); | 103 CPDF_Type3Cache* GetCachedType3(CPDF_Type3Font* pFont); |
104 CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj); | 104 CPDF_TransferFunc* GetTransferFunc(CPDF_Object* pObj); |
105 CFX_FontCache* GetFontCache() { return m_pFontCache; } | 105 CFX_FontCache* GetFontCache() { return m_pFontCache; } |
106 void Clear(FX_BOOL bRelease = FALSE); | 106 void Clear(FX_BOOL bRelease = FALSE); |
107 void ReleaseCachedType3(CPDF_Type3Font* pFont); | 107 void ReleaseCachedType3(CPDF_Type3Font* pFont); |
108 void ReleaseTransferFunc(CPDF_Object* pObj); | 108 void ReleaseTransferFunc(CPDF_Object* pObj); |
109 | 109 |
110 private: | 110 private: |
111 using CPDF_Type3CacheMap = | 111 using CPDF_Type3CacheMap = |
(...skipping 14 matching lines...) Expand all Loading... |
126 | 126 |
127 FX_BOOL Initialize(class CPDF_RenderContext* pContext, | 127 FX_BOOL Initialize(class CPDF_RenderContext* pContext, |
128 CFX_RenderDevice* pDevice, | 128 CFX_RenderDevice* pDevice, |
129 const CFX_Matrix* pDeviceMatrix, | 129 const CFX_Matrix* pDeviceMatrix, |
130 const CPDF_PageObject* pStopObj, | 130 const CPDF_PageObject* pStopObj, |
131 const CPDF_RenderStatus* pParentStatus, | 131 const CPDF_RenderStatus* pParentStatus, |
132 const CPDF_GraphicStates* pInitialStates, | 132 const CPDF_GraphicStates* pInitialStates, |
133 const CPDF_RenderOptions* pOptions, | 133 const CPDF_RenderOptions* pOptions, |
134 int transparency, | 134 int transparency, |
135 FX_BOOL bDropObjects, | 135 FX_BOOL bDropObjects, |
136 CPDF_Dictionary* pFormResource = NULL, | 136 CPDF_Dictionary* pFormResource = nullptr, |
137 FX_BOOL bStdCS = FALSE, | 137 FX_BOOL bStdCS = FALSE, |
138 CPDF_Type3Char* pType3Char = NULL, | 138 CPDF_Type3Char* pType3Char = nullptr, |
139 FX_ARGB fill_color = 0, | 139 FX_ARGB fill_color = 0, |
140 uint32_t GroupFamily = 0, | 140 uint32_t GroupFamily = 0, |
141 FX_BOOL bLoadMask = FALSE); | 141 FX_BOOL bLoadMask = FALSE); |
142 void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder, | 142 void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder, |
143 const CFX_Matrix* pObj2Device); | 143 const CFX_Matrix* pObj2Device); |
144 void RenderSingleObject(const CPDF_PageObject* pObj, | 144 void RenderSingleObject(const CPDF_PageObject* pObj, |
145 const CFX_Matrix* pObj2Device); | 145 const CFX_Matrix* pObj2Device); |
146 FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, | 146 FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, |
147 const CFX_Matrix* pObj2Device, | 147 const CFX_Matrix* pObj2Device, |
148 IFX_Pause* pPause); | 148 IFX_Pause* pPause); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 m_nDownsampleWidth(0), | 284 m_nDownsampleWidth(0), |
285 m_nDownsampleHeight(0) {} | 285 m_nDownsampleHeight(0) {} |
286 ~CPDF_ImageLoader(); | 286 ~CPDF_ImageLoader(); |
287 | 287 |
288 FX_BOOL Start(const CPDF_ImageObject* pImage, | 288 FX_BOOL Start(const CPDF_ImageObject* pImage, |
289 CPDF_PageRenderCache* pCache, | 289 CPDF_PageRenderCache* pCache, |
290 CPDF_ImageLoaderHandle*& LoadHandle, | 290 CPDF_ImageLoaderHandle*& LoadHandle, |
291 FX_BOOL bStdCS = FALSE, | 291 FX_BOOL bStdCS = FALSE, |
292 uint32_t GroupFamily = 0, | 292 uint32_t GroupFamily = 0, |
293 FX_BOOL bLoadMask = FALSE, | 293 FX_BOOL bLoadMask = FALSE, |
294 CPDF_RenderStatus* pRenderStatus = NULL, | 294 CPDF_RenderStatus* pRenderStatus = nullptr, |
295 int32_t nDownsampleWidth = 0, | 295 int32_t nDownsampleWidth = 0, |
296 int32_t nDownsampleHeight = 0); | 296 int32_t nDownsampleHeight = 0); |
297 FX_BOOL Continue(CPDF_ImageLoaderHandle* LoadHandle, IFX_Pause* pPause); | 297 FX_BOOL Continue(CPDF_ImageLoaderHandle* LoadHandle, IFX_Pause* pPause); |
298 | 298 |
299 CFX_DIBSource* m_pBitmap; | 299 CFX_DIBSource* m_pBitmap; |
300 CFX_DIBSource* m_pMask; | 300 CFX_DIBSource* m_pMask; |
301 uint32_t m_MatteColor; | 301 uint32_t m_MatteColor; |
302 FX_BOOL m_bCached; | 302 FX_BOOL m_bCached; |
303 | 303 |
304 protected: | 304 protected: |
305 int32_t m_nDownsampleWidth; | 305 int32_t m_nDownsampleWidth; |
306 int32_t m_nDownsampleHeight; | 306 int32_t m_nDownsampleHeight; |
307 }; | 307 }; |
308 class CPDF_ImageLoaderHandle { | 308 class CPDF_ImageLoaderHandle { |
309 public: | 309 public: |
310 CPDF_ImageLoaderHandle(); | 310 CPDF_ImageLoaderHandle(); |
311 ~CPDF_ImageLoaderHandle(); | 311 ~CPDF_ImageLoaderHandle(); |
312 | 312 |
313 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, | 313 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, |
314 const CPDF_ImageObject* pImage, | 314 const CPDF_ImageObject* pImage, |
315 CPDF_PageRenderCache* pCache, | 315 CPDF_PageRenderCache* pCache, |
316 FX_BOOL bStdCS = FALSE, | 316 FX_BOOL bStdCS = FALSE, |
317 uint32_t GroupFamily = 0, | 317 uint32_t GroupFamily = 0, |
318 FX_BOOL bLoadMask = FALSE, | 318 FX_BOOL bLoadMask = FALSE, |
319 CPDF_RenderStatus* pRenderStatus = NULL, | 319 CPDF_RenderStatus* pRenderStatus = nullptr, |
320 int32_t nDownsampleWidth = 0, | 320 int32_t nDownsampleWidth = 0, |
321 int32_t nDownsampleHeight = 0); | 321 int32_t nDownsampleHeight = 0); |
322 FX_BOOL Continue(IFX_Pause* pPause); | 322 FX_BOOL Continue(IFX_Pause* pPause); |
323 | 323 |
324 protected: | 324 protected: |
325 CPDF_ImageLoader* m_pImageLoader; | 325 CPDF_ImageLoader* m_pImageLoader; |
326 CPDF_PageRenderCache* m_pCache; | 326 CPDF_PageRenderCache* m_pCache; |
327 CPDF_ImageObject* m_pImage; | 327 CPDF_ImageObject* m_pImage; |
328 int32_t m_nDownsampleWidth; | 328 int32_t m_nDownsampleWidth; |
329 int32_t m_nDownsampleHeight; | 329 int32_t m_nDownsampleHeight; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 class CPDF_ScaledRenderBuffer { | 383 class CPDF_ScaledRenderBuffer { |
384 public: | 384 public: |
385 CPDF_ScaledRenderBuffer(); | 385 CPDF_ScaledRenderBuffer(); |
386 ~CPDF_ScaledRenderBuffer(); | 386 ~CPDF_ScaledRenderBuffer(); |
387 | 387 |
388 FX_BOOL Initialize(CPDF_RenderContext* pContext, | 388 FX_BOOL Initialize(CPDF_RenderContext* pContext, |
389 CFX_RenderDevice* pDevice, | 389 CFX_RenderDevice* pDevice, |
390 const FX_RECT& pRect, | 390 const FX_RECT& pRect, |
391 const CPDF_PageObject* pObj, | 391 const CPDF_PageObject* pObj, |
392 const CPDF_RenderOptions* pOptions = NULL, | 392 const CPDF_RenderOptions* pOptions = nullptr, |
393 int max_dpi = 0); | 393 int max_dpi = 0); |
394 CFX_RenderDevice* GetDevice() { | 394 CFX_RenderDevice* GetDevice() { |
395 return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice; | 395 return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice; |
396 } | 396 } |
397 CFX_Matrix* GetMatrix() { return &m_Matrix; } | 397 CFX_Matrix* GetMatrix() { return &m_Matrix; } |
398 void OutputToDevice(); | 398 void OutputToDevice(); |
399 | 399 |
400 private: | 400 private: |
401 CFX_RenderDevice* m_pDevice; | 401 CFX_RenderDevice* m_pDevice; |
402 CPDF_RenderContext* m_pContext; | 402 CPDF_RenderContext* m_pContext; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 ~CPDF_ImageCacheEntry(); | 434 ~CPDF_ImageCacheEntry(); |
435 | 435 |
436 void Reset(const CFX_DIBitmap* pBitmap); | 436 void Reset(const CFX_DIBitmap* pBitmap); |
437 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, | 437 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, |
438 CFX_DIBSource*& pMask, | 438 CFX_DIBSource*& pMask, |
439 uint32_t& MatteColor, | 439 uint32_t& MatteColor, |
440 CPDF_Dictionary* pPageResources, | 440 CPDF_Dictionary* pPageResources, |
441 FX_BOOL bStdCS = FALSE, | 441 FX_BOOL bStdCS = FALSE, |
442 uint32_t GroupFamily = 0, | 442 uint32_t GroupFamily = 0, |
443 FX_BOOL bLoadMask = FALSE, | 443 FX_BOOL bLoadMask = FALSE, |
444 CPDF_RenderStatus* pRenderStatus = NULL, | 444 CPDF_RenderStatus* pRenderStatus = nullptr, |
445 int32_t downsampleWidth = 0, | 445 int32_t downsampleWidth = 0, |
446 int32_t downsampleHeight = 0); | 446 int32_t downsampleHeight = 0); |
447 uint32_t EstimateSize() const { return m_dwCacheSize; } | 447 uint32_t EstimateSize() const { return m_dwCacheSize; } |
448 uint32_t GetTimeCount() const { return m_dwTimeCount; } | 448 uint32_t GetTimeCount() const { return m_dwTimeCount; } |
449 CPDF_Stream* GetStream() const { return m_pStream; } | 449 CPDF_Stream* GetStream() const { return m_pStream; } |
450 void SetTimeCount(uint32_t dwTimeCount) { m_dwTimeCount = dwTimeCount; } | 450 void SetTimeCount(uint32_t dwTimeCount) { m_dwTimeCount = dwTimeCount; } |
451 int m_dwTimeCount; | 451 int m_dwTimeCount; |
452 | 452 |
453 public: | 453 public: |
454 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, | 454 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, |
455 CPDF_Dictionary* pPageResources, | 455 CPDF_Dictionary* pPageResources, |
456 FX_BOOL bStdCS = FALSE, | 456 FX_BOOL bStdCS = FALSE, |
457 uint32_t GroupFamily = 0, | 457 uint32_t GroupFamily = 0, |
458 FX_BOOL bLoadMask = FALSE, | 458 FX_BOOL bLoadMask = FALSE, |
459 CPDF_RenderStatus* pRenderStatus = NULL, | 459 CPDF_RenderStatus* pRenderStatus = nullptr, |
460 int32_t downsampleWidth = 0, | 460 int32_t downsampleWidth = 0, |
461 int32_t downsampleHeight = 0); | 461 int32_t downsampleHeight = 0); |
462 int Continue(IFX_Pause* pPause); | 462 int Continue(IFX_Pause* pPause); |
463 CFX_DIBSource* DetachBitmap(); | 463 CFX_DIBSource* DetachBitmap(); |
464 CFX_DIBSource* DetachMask(); | 464 CFX_DIBSource* DetachMask(); |
465 CFX_DIBSource* m_pCurBitmap; | 465 CFX_DIBSource* m_pCurBitmap; |
466 CFX_DIBSource* m_pCurMask; | 466 CFX_DIBSource* m_pCurMask; |
467 uint32_t m_MatteColor; | 467 uint32_t m_MatteColor; |
468 CPDF_RenderStatus* m_pRenderStatus; | 468 CPDF_RenderStatus* m_pRenderStatus; |
469 | 469 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 }; | 603 }; |
604 | 604 |
605 #define FPDF_HUGE_IMAGE_SIZE 60000000 | 605 #define FPDF_HUGE_IMAGE_SIZE 60000000 |
606 class CPDF_DIBTransferFunc : public CFX_FilteredDIB { | 606 class CPDF_DIBTransferFunc : public CFX_FilteredDIB { |
607 public: | 607 public: |
608 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); | 608 CPDF_DIBTransferFunc(const CPDF_TransferFunc* pTransferFunc); |
609 ~CPDF_DIBTransferFunc() override; | 609 ~CPDF_DIBTransferFunc() override; |
610 | 610 |
611 // CFX_FilteredDIB | 611 // CFX_FilteredDIB |
612 FXDIB_Format GetDestFormat() override; | 612 FXDIB_Format GetDestFormat() override; |
613 FX_ARGB* GetDestPalette() override { return NULL; } | 613 FX_ARGB* GetDestPalette() override { return nullptr; } |
614 void TranslateScanline(uint8_t* dest_buf, | 614 void TranslateScanline(uint8_t* dest_buf, |
615 const uint8_t* src_buf) const override; | 615 const uint8_t* src_buf) const override; |
616 void TranslateDownSamples(uint8_t* dest_buf, | 616 void TranslateDownSamples(uint8_t* dest_buf, |
617 const uint8_t* src_buf, | 617 const uint8_t* src_buf, |
618 int pixels, | 618 int pixels, |
619 int Bpp) const override; | 619 int Bpp) const override; |
620 | 620 |
621 const uint8_t* m_RampR; | 621 const uint8_t* m_RampR; |
622 const uint8_t* m_RampG; | 622 const uint8_t* m_RampG; |
623 const uint8_t* m_RampB; | 623 const uint8_t* m_RampB; |
624 }; | 624 }; |
625 | 625 |
626 #endif // CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 626 #endif // CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
OLD | NEW |