| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 class CPDF_Type3Glyphs { | 50 class CPDF_Type3Glyphs { |
| 51 public: | 51 public: |
| 52 CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {} | 52 CPDF_Type3Glyphs() : m_TopBlueCount(0), m_BottomBlueCount(0) {} |
| 53 ~CPDF_Type3Glyphs(); | 53 ~CPDF_Type3Glyphs(); |
| 54 void AdjustBlue(FX_FLOAT top, | 54 void AdjustBlue(FX_FLOAT top, |
| 55 FX_FLOAT bottom, | 55 FX_FLOAT bottom, |
| 56 int& top_line, | 56 int& top_line, |
| 57 int& bottom_line); | 57 int& bottom_line); |
| 58 | 58 |
| 59 std::map<FX_DWORD, CFX_GlyphBitmap*> m_GlyphMap; | 59 std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap; |
| 60 int m_TopBlue[TYPE3_MAX_BLUES]; | 60 int m_TopBlue[TYPE3_MAX_BLUES]; |
| 61 int m_BottomBlue[TYPE3_MAX_BLUES]; | 61 int m_BottomBlue[TYPE3_MAX_BLUES]; |
| 62 int m_TopBlueCount; | 62 int m_TopBlueCount; |
| 63 int m_BottomBlueCount; | 63 int m_BottomBlueCount; |
| 64 }; | 64 }; |
| 65 class CPDF_Type3Cache { | 65 class CPDF_Type3Cache { |
| 66 public: | 66 public: |
| 67 explicit CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {} | 67 explicit CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {} |
| 68 ~CPDF_Type3Cache(); | 68 ~CPDF_Type3Cache(); |
| 69 | 69 |
| 70 CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode, | 70 CFX_GlyphBitmap* LoadGlyph(uint32_t charcode, |
| 71 const CFX_Matrix* pMatrix, | 71 const CFX_Matrix* pMatrix, |
| 72 FX_FLOAT retinaScaleX = 1.0f, | 72 FX_FLOAT retinaScaleX = 1.0f, |
| 73 FX_FLOAT retinaScaleY = 1.0f); | 73 FX_FLOAT retinaScaleY = 1.0f); |
| 74 | 74 |
| 75 protected: | 75 protected: |
| 76 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, | 76 CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize, |
| 77 FX_DWORD charcode, | 77 uint32_t charcode, |
| 78 const CFX_Matrix* pMatrix, | 78 const CFX_Matrix* pMatrix, |
| 79 FX_FLOAT retinaScaleX = 1.0f, | 79 FX_FLOAT retinaScaleX = 1.0f, |
| 80 FX_FLOAT retinaScaleY = 1.0f); | 80 FX_FLOAT retinaScaleY = 1.0f); |
| 81 CPDF_Type3Font* const m_pFont; | 81 CPDF_Type3Font* const m_pFont; |
| 82 std::map<CFX_ByteString, CPDF_Type3Glyphs*> m_SizeMap; | 82 std::map<CFX_ByteString, CPDF_Type3Glyphs*> m_SizeMap; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 class CPDF_TransferFunc { | 85 class CPDF_TransferFunc { |
| 86 public: | 86 public: |
| 87 explicit CPDF_TransferFunc(CPDF_Document* pDoc); | 87 explicit CPDF_TransferFunc(CPDF_Document* pDoc); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 const CPDF_PageObject* pStopObj, | 141 const CPDF_PageObject* pStopObj, |
| 142 const CPDF_RenderStatus* pParentStatus, | 142 const CPDF_RenderStatus* pParentStatus, |
| 143 const CPDF_GraphicStates* pInitialStates, | 143 const CPDF_GraphicStates* pInitialStates, |
| 144 const CPDF_RenderOptions* pOptions, | 144 const CPDF_RenderOptions* pOptions, |
| 145 int transparency, | 145 int transparency, |
| 146 FX_BOOL bDropObjects, | 146 FX_BOOL bDropObjects, |
| 147 CPDF_Dictionary* pFormResource = NULL, | 147 CPDF_Dictionary* pFormResource = NULL, |
| 148 FX_BOOL bStdCS = FALSE, | 148 FX_BOOL bStdCS = FALSE, |
| 149 CPDF_Type3Char* pType3Char = NULL, | 149 CPDF_Type3Char* pType3Char = NULL, |
| 150 FX_ARGB fill_color = 0, | 150 FX_ARGB fill_color = 0, |
| 151 FX_DWORD GroupFamily = 0, | 151 uint32_t GroupFamily = 0, |
| 152 FX_BOOL bLoadMask = FALSE); | 152 FX_BOOL bLoadMask = FALSE); |
| 153 void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder, | 153 void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder, |
| 154 const CFX_Matrix* pObj2Device); | 154 const CFX_Matrix* pObj2Device); |
| 155 void RenderSingleObject(const CPDF_PageObject* pObj, | 155 void RenderSingleObject(const CPDF_PageObject* pObj, |
| 156 const CFX_Matrix* pObj2Device); | 156 const CFX_Matrix* pObj2Device); |
| 157 FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, | 157 FX_BOOL ContinueSingleObject(const CPDF_PageObject* pObj, |
| 158 const CFX_Matrix* pObj2Device, | 158 const CFX_Matrix* pObj2Device, |
| 159 IFX_Pause* pPause); | 159 IFX_Pause* pPause); |
| 160 CPDF_RenderContext* GetContext() { return m_pContext; } | 160 CPDF_RenderContext* GetContext() { return m_pContext; } |
| 161 | 161 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 const CFX_Matrix* pObj2Device); | 202 const CFX_Matrix* pObj2Device); |
| 203 FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, | 203 FX_BOOL OutputBitmapAlpha(CPDF_ImageObject* pImageObj, |
| 204 const CFX_Matrix* pImage2Device); | 204 const CFX_Matrix* pImage2Device); |
| 205 FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, | 205 FX_BOOL OutputImage(CPDF_ImageObject* pImageObj, |
| 206 const CFX_Matrix* pImage2Device); | 206 const CFX_Matrix* pImage2Device); |
| 207 FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, | 207 FX_BOOL OutputDIBSource(const CFX_DIBSource* pOutputBitmap, |
| 208 FX_ARGB fill_argb, | 208 FX_ARGB fill_argb, |
| 209 int bitmap_alpha, | 209 int bitmap_alpha, |
| 210 const CFX_Matrix* pImage2Device, | 210 const CFX_Matrix* pImage2Device, |
| 211 CPDF_ImageCacheEntry* pImageCache, | 211 CPDF_ImageCacheEntry* pImageCache, |
| 212 FX_DWORD flags); | 212 uint32_t flags); |
| 213 void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, | 213 void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap, |
| 214 int left, | 214 int left, |
| 215 int top, | 215 int top, |
| 216 FX_ARGB mask_argb, | 216 FX_ARGB mask_argb, |
| 217 int bitmap_alpha, | 217 int bitmap_alpha, |
| 218 int blend_mode, | 218 int blend_mode, |
| 219 int bIsolated); | 219 int bIsolated); |
| 220 FX_BOOL ProcessShading(const CPDF_ShadingObject* pShadingObj, | 220 FX_BOOL ProcessShading(const CPDF_ShadingObject* pShadingObj, |
| 221 const CFX_Matrix* pObj2Device); | 221 const CFX_Matrix* pObj2Device); |
| 222 void DrawShading(CPDF_ShadingPattern* pPattern, | 222 void DrawShading(CPDF_ShadingPattern* pPattern, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 const CPDF_PageObject* m_pCurObj; | 274 const CPDF_PageObject* m_pCurObj; |
| 275 const CPDF_PageObject* m_pStopObj; | 275 const CPDF_PageObject* m_pStopObj; |
| 276 CPDF_GraphicStates m_InitialStates; | 276 CPDF_GraphicStates m_InitialStates; |
| 277 int m_HalftoneLimit; | 277 int m_HalftoneLimit; |
| 278 std::unique_ptr<IPDF_ObjectRenderer> m_pObjectRenderer; | 278 std::unique_ptr<IPDF_ObjectRenderer> m_pObjectRenderer; |
| 279 FX_BOOL m_bPrint; | 279 FX_BOOL m_bPrint; |
| 280 int m_Transparency; | 280 int m_Transparency; |
| 281 int m_DitherBits; | 281 int m_DitherBits; |
| 282 FX_BOOL m_bDropObjects; | 282 FX_BOOL m_bDropObjects; |
| 283 FX_BOOL m_bStdCS; | 283 FX_BOOL m_bStdCS; |
| 284 FX_DWORD m_GroupFamily; | 284 uint32_t m_GroupFamily; |
| 285 FX_BOOL m_bLoadMask; | 285 FX_BOOL m_bLoadMask; |
| 286 CPDF_Type3Char* m_pType3Char; | 286 CPDF_Type3Char* m_pType3Char; |
| 287 FX_ARGB m_T3FillColor; | 287 FX_ARGB m_T3FillColor; |
| 288 int m_curBlend; | 288 int m_curBlend; |
| 289 }; | 289 }; |
| 290 class CPDF_ImageLoader { | 290 class CPDF_ImageLoader { |
| 291 public: | 291 public: |
| 292 CPDF_ImageLoader() | 292 CPDF_ImageLoader() |
| 293 : m_pBitmap(nullptr), | 293 : m_pBitmap(nullptr), |
| 294 m_pMask(nullptr), | 294 m_pMask(nullptr), |
| 295 m_MatteColor(0), | 295 m_MatteColor(0), |
| 296 m_bCached(FALSE), | 296 m_bCached(FALSE), |
| 297 m_nDownsampleWidth(0), | 297 m_nDownsampleWidth(0), |
| 298 m_nDownsampleHeight(0) {} | 298 m_nDownsampleHeight(0) {} |
| 299 ~CPDF_ImageLoader(); | 299 ~CPDF_ImageLoader(); |
| 300 | 300 |
| 301 FX_BOOL Start(const CPDF_ImageObject* pImage, | 301 FX_BOOL Start(const CPDF_ImageObject* pImage, |
| 302 CPDF_PageRenderCache* pCache, | 302 CPDF_PageRenderCache* pCache, |
| 303 CPDF_ImageLoaderHandle*& LoadHandle, | 303 CPDF_ImageLoaderHandle*& LoadHandle, |
| 304 FX_BOOL bStdCS = FALSE, | 304 FX_BOOL bStdCS = FALSE, |
| 305 FX_DWORD GroupFamily = 0, | 305 uint32_t GroupFamily = 0, |
| 306 FX_BOOL bLoadMask = FALSE, | 306 FX_BOOL bLoadMask = FALSE, |
| 307 CPDF_RenderStatus* pRenderStatus = NULL, | 307 CPDF_RenderStatus* pRenderStatus = NULL, |
| 308 int32_t nDownsampleWidth = 0, | 308 int32_t nDownsampleWidth = 0, |
| 309 int32_t nDownsampleHeight = 0); | 309 int32_t nDownsampleHeight = 0); |
| 310 FX_BOOL Continue(CPDF_ImageLoaderHandle* LoadHandle, IFX_Pause* pPause); | 310 FX_BOOL Continue(CPDF_ImageLoaderHandle* LoadHandle, IFX_Pause* pPause); |
| 311 | 311 |
| 312 CFX_DIBSource* m_pBitmap; | 312 CFX_DIBSource* m_pBitmap; |
| 313 CFX_DIBSource* m_pMask; | 313 CFX_DIBSource* m_pMask; |
| 314 FX_DWORD m_MatteColor; | 314 uint32_t m_MatteColor; |
| 315 FX_BOOL m_bCached; | 315 FX_BOOL m_bCached; |
| 316 | 316 |
| 317 protected: | 317 protected: |
| 318 int32_t m_nDownsampleWidth; | 318 int32_t m_nDownsampleWidth; |
| 319 int32_t m_nDownsampleHeight; | 319 int32_t m_nDownsampleHeight; |
| 320 }; | 320 }; |
| 321 class CPDF_ImageLoaderHandle { | 321 class CPDF_ImageLoaderHandle { |
| 322 public: | 322 public: |
| 323 CPDF_ImageLoaderHandle(); | 323 CPDF_ImageLoaderHandle(); |
| 324 ~CPDF_ImageLoaderHandle(); | 324 ~CPDF_ImageLoaderHandle(); |
| 325 | 325 |
| 326 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, | 326 FX_BOOL Start(CPDF_ImageLoader* pImageLoader, |
| 327 const CPDF_ImageObject* pImage, | 327 const CPDF_ImageObject* pImage, |
| 328 CPDF_PageRenderCache* pCache, | 328 CPDF_PageRenderCache* pCache, |
| 329 FX_BOOL bStdCS = FALSE, | 329 FX_BOOL bStdCS = FALSE, |
| 330 FX_DWORD GroupFamily = 0, | 330 uint32_t GroupFamily = 0, |
| 331 FX_BOOL bLoadMask = FALSE, | 331 FX_BOOL bLoadMask = FALSE, |
| 332 CPDF_RenderStatus* pRenderStatus = NULL, | 332 CPDF_RenderStatus* pRenderStatus = NULL, |
| 333 int32_t nDownsampleWidth = 0, | 333 int32_t nDownsampleWidth = 0, |
| 334 int32_t nDownsampleHeight = 0); | 334 int32_t nDownsampleHeight = 0); |
| 335 FX_BOOL Continue(IFX_Pause* pPause); | 335 FX_BOOL Continue(IFX_Pause* pPause); |
| 336 | 336 |
| 337 protected: | 337 protected: |
| 338 CPDF_ImageLoader* m_pImageLoader; | 338 CPDF_ImageLoader* m_pImageLoader; |
| 339 CPDF_PageRenderCache* m_pCache; | 339 CPDF_PageRenderCache* m_pCache; |
| 340 CPDF_ImageObject* m_pImage; | 340 CPDF_ImageObject* m_pImage; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 353 const CFX_Matrix* pObj2Device, | 353 const CFX_Matrix* pObj2Device, |
| 354 FX_BOOL bStdCS, | 354 FX_BOOL bStdCS, |
| 355 int blendType = FXDIB_BLEND_NORMAL) override; | 355 int blendType = FXDIB_BLEND_NORMAL) override; |
| 356 FX_BOOL Continue(IFX_Pause* pPause) override; | 356 FX_BOOL Continue(IFX_Pause* pPause) override; |
| 357 | 357 |
| 358 FX_BOOL Start(CPDF_RenderStatus* pStatus, | 358 FX_BOOL Start(CPDF_RenderStatus* pStatus, |
| 359 const CFX_DIBSource* pDIBSource, | 359 const CFX_DIBSource* pDIBSource, |
| 360 FX_ARGB bitmap_argb, | 360 FX_ARGB bitmap_argb, |
| 361 int bitmap_alpha, | 361 int bitmap_alpha, |
| 362 const CFX_Matrix* pImage2Device, | 362 const CFX_Matrix* pImage2Device, |
| 363 FX_DWORD flags, | 363 uint32_t flags, |
| 364 FX_BOOL bStdCS, | 364 FX_BOOL bStdCS, |
| 365 int blendType = FXDIB_BLEND_NORMAL); | 365 int blendType = FXDIB_BLEND_NORMAL); |
| 366 | 366 |
| 367 protected: | 367 protected: |
| 368 CPDF_RenderStatus* m_pRenderStatus; | 368 CPDF_RenderStatus* m_pRenderStatus; |
| 369 const CPDF_ImageObject* m_pImageObject; | 369 const CPDF_ImageObject* m_pImageObject; |
| 370 int m_Status; | 370 int m_Status; |
| 371 const CFX_Matrix* m_pObj2Device; | 371 const CFX_Matrix* m_pObj2Device; |
| 372 CFX_Matrix m_ImageMatrix; | 372 CFX_Matrix m_ImageMatrix; |
| 373 CPDF_ImageLoader m_Loader; | 373 CPDF_ImageLoader m_Loader; |
| 374 const CFX_DIBSource* m_pDIBSource; | 374 const CFX_DIBSource* m_pDIBSource; |
| 375 CFX_DIBitmap* m_pClone; | 375 CFX_DIBitmap* m_pClone; |
| 376 int m_BitmapAlpha; | 376 int m_BitmapAlpha; |
| 377 FX_BOOL m_bPatternColor; | 377 FX_BOOL m_bPatternColor; |
| 378 CPDF_Pattern* m_pPattern; | 378 CPDF_Pattern* m_pPattern; |
| 379 FX_ARGB m_FillArgb; | 379 FX_ARGB m_FillArgb; |
| 380 FX_DWORD m_Flags; | 380 uint32_t m_Flags; |
| 381 CFX_ImageTransformer* m_pTransformer; | 381 CFX_ImageTransformer* m_pTransformer; |
| 382 void* m_DeviceHandle; | 382 void* m_DeviceHandle; |
| 383 CPDF_ImageLoaderHandle* m_LoadHandle; | 383 CPDF_ImageLoaderHandle* m_LoadHandle; |
| 384 FX_BOOL m_bStdCS; | 384 FX_BOOL m_bStdCS; |
| 385 int m_BlendType; | 385 int m_BlendType; |
| 386 FX_BOOL StartBitmapAlpha(); | 386 FX_BOOL StartBitmapAlpha(); |
| 387 FX_BOOL StartDIBSource(); | 387 FX_BOOL StartDIBSource(); |
| 388 FX_BOOL StartRenderDIBSource(); | 388 FX_BOOL StartRenderDIBSource(); |
| 389 FX_BOOL StartLoadDIBSource(); | 389 FX_BOOL StartLoadDIBSource(); |
| 390 FX_BOOL DrawMaskedImage(); | 390 FX_BOOL DrawMaskedImage(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 }; | 440 }; |
| 441 | 441 |
| 442 class CPDF_ImageCacheEntry { | 442 class CPDF_ImageCacheEntry { |
| 443 public: | 443 public: |
| 444 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream); | 444 CPDF_ImageCacheEntry(CPDF_Document* pDoc, CPDF_Stream* pStream); |
| 445 ~CPDF_ImageCacheEntry(); | 445 ~CPDF_ImageCacheEntry(); |
| 446 void ClearImageData(); | 446 void ClearImageData(); |
| 447 void Reset(const CFX_DIBitmap* pBitmap); | 447 void Reset(const CFX_DIBitmap* pBitmap); |
| 448 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, | 448 FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap, |
| 449 CFX_DIBSource*& pMask, | 449 CFX_DIBSource*& pMask, |
| 450 FX_DWORD& MatteColor, | 450 uint32_t& MatteColor, |
| 451 CPDF_Dictionary* pPageResources, | 451 CPDF_Dictionary* pPageResources, |
| 452 FX_BOOL bStdCS = FALSE, | 452 FX_BOOL bStdCS = FALSE, |
| 453 FX_DWORD GroupFamily = 0, | 453 uint32_t GroupFamily = 0, |
| 454 FX_BOOL bLoadMask = FALSE, | 454 FX_BOOL bLoadMask = FALSE, |
| 455 CPDF_RenderStatus* pRenderStatus = NULL, | 455 CPDF_RenderStatus* pRenderStatus = NULL, |
| 456 int32_t downsampleWidth = 0, | 456 int32_t downsampleWidth = 0, |
| 457 int32_t downsampleHeight = 0); | 457 int32_t downsampleHeight = 0); |
| 458 FX_DWORD EstimateSize() const { return m_dwCacheSize; } | 458 uint32_t EstimateSize() const { return m_dwCacheSize; } |
| 459 FX_DWORD GetTimeCount() const { return m_dwTimeCount; } | 459 uint32_t GetTimeCount() const { return m_dwTimeCount; } |
| 460 CPDF_Stream* GetStream() const { return m_pStream; } | 460 CPDF_Stream* GetStream() const { return m_pStream; } |
| 461 void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; } | 461 void SetTimeCount(uint32_t dwTimeCount) { m_dwTimeCount = dwTimeCount; } |
| 462 int m_dwTimeCount; | 462 int m_dwTimeCount; |
| 463 | 463 |
| 464 public: | 464 public: |
| 465 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, | 465 int StartGetCachedBitmap(CPDF_Dictionary* pFormResources, |
| 466 CPDF_Dictionary* pPageResources, | 466 CPDF_Dictionary* pPageResources, |
| 467 FX_BOOL bStdCS = FALSE, | 467 FX_BOOL bStdCS = FALSE, |
| 468 FX_DWORD GroupFamily = 0, | 468 uint32_t GroupFamily = 0, |
| 469 FX_BOOL bLoadMask = FALSE, | 469 FX_BOOL bLoadMask = FALSE, |
| 470 CPDF_RenderStatus* pRenderStatus = NULL, | 470 CPDF_RenderStatus* pRenderStatus = NULL, |
| 471 int32_t downsampleWidth = 0, | 471 int32_t downsampleWidth = 0, |
| 472 int32_t downsampleHeight = 0); | 472 int32_t downsampleHeight = 0); |
| 473 int Continue(IFX_Pause* pPause); | 473 int Continue(IFX_Pause* pPause); |
| 474 CFX_DIBSource* DetachBitmap(); | 474 CFX_DIBSource* DetachBitmap(); |
| 475 CFX_DIBSource* DetachMask(); | 475 CFX_DIBSource* DetachMask(); |
| 476 CFX_DIBSource* m_pCurBitmap; | 476 CFX_DIBSource* m_pCurBitmap; |
| 477 CFX_DIBSource* m_pCurMask; | 477 CFX_DIBSource* m_pCurMask; |
| 478 FX_DWORD m_MatteColor; | 478 uint32_t m_MatteColor; |
| 479 CPDF_RenderStatus* m_pRenderStatus; | 479 CPDF_RenderStatus* m_pRenderStatus; |
| 480 | 480 |
| 481 protected: | 481 protected: |
| 482 void ContinueGetCachedBitmap(); | 482 void ContinueGetCachedBitmap(); |
| 483 | 483 |
| 484 CPDF_Document* m_pDocument; | 484 CPDF_Document* m_pDocument; |
| 485 CPDF_Stream* m_pStream; | 485 CPDF_Stream* m_pStream; |
| 486 CFX_DIBSource* m_pCachedBitmap; | 486 CFX_DIBSource* m_pCachedBitmap; |
| 487 CFX_DIBSource* m_pCachedMask; | 487 CFX_DIBSource* m_pCachedMask; |
| 488 FX_DWORD m_dwCacheSize; | 488 uint32_t m_dwCacheSize; |
| 489 void CalcSize(); | 489 void CalcSize(); |
| 490 }; | 490 }; |
| 491 typedef struct { | 491 typedef struct { |
| 492 FX_FLOAT m_DecodeMin; | 492 FX_FLOAT m_DecodeMin; |
| 493 FX_FLOAT m_DecodeStep; | 493 FX_FLOAT m_DecodeStep; |
| 494 int m_ColorKeyMin; | 494 int m_ColorKeyMin; |
| 495 int m_ColorKeyMax; | 495 int m_ColorKeyMax; |
| 496 } DIB_COMP_DATA; | 496 } DIB_COMP_DATA; |
| 497 | 497 |
| 498 class CPDF_DIBSource : public CFX_DIBSource { | 498 class CPDF_DIBSource : public CFX_DIBSource { |
| 499 public: | 499 public: |
| 500 CPDF_DIBSource(); | 500 CPDF_DIBSource(); |
| 501 ~CPDF_DIBSource() override; | 501 ~CPDF_DIBSource() override; |
| 502 | 502 |
| 503 FX_BOOL Load(CPDF_Document* pDoc, | 503 FX_BOOL Load(CPDF_Document* pDoc, |
| 504 const CPDF_Stream* pStream, | 504 const CPDF_Stream* pStream, |
| 505 CPDF_DIBSource** ppMask, | 505 CPDF_DIBSource** ppMask, |
| 506 FX_DWORD* pMatteColor, | 506 uint32_t* pMatteColor, |
| 507 CPDF_Dictionary* pFormResources, | 507 CPDF_Dictionary* pFormResources, |
| 508 CPDF_Dictionary* pPageResources, | 508 CPDF_Dictionary* pPageResources, |
| 509 FX_BOOL bStdCS = FALSE, | 509 FX_BOOL bStdCS = FALSE, |
| 510 FX_DWORD GroupFamily = 0, | 510 uint32_t GroupFamily = 0, |
| 511 FX_BOOL bLoadMask = FALSE); | 511 FX_BOOL bLoadMask = FALSE); |
| 512 | 512 |
| 513 // CFX_DIBSource | 513 // CFX_DIBSource |
| 514 FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const override; | 514 FX_BOOL SkipToScanline(int line, IFX_Pause* pPause) const override; |
| 515 uint8_t* GetBuffer() const override; | 515 uint8_t* GetBuffer() const override; |
| 516 const uint8_t* GetScanline(int line) const override; | 516 const uint8_t* GetScanline(int line) const override; |
| 517 void DownSampleScanline(int line, | 517 void DownSampleScanline(int line, |
| 518 uint8_t* dest_scan, | 518 uint8_t* dest_scan, |
| 519 int dest_bpp, | 519 int dest_bpp, |
| 520 int dest_width, | 520 int dest_width, |
| 521 FX_BOOL bFlipX, | 521 FX_BOOL bFlipX, |
| 522 int clip_left, | 522 int clip_left, |
| 523 int clip_width) const override; | 523 int clip_width) const override; |
| 524 void SetDownSampleSize(int dest_width, int dest_height) override; | 524 void SetDownSampleSize(int dest_width, int dest_height) override; |
| 525 | 525 |
| 526 CFX_DIBitmap* GetBitmap() const; | 526 CFX_DIBitmap* GetBitmap() const; |
| 527 void ReleaseBitmap(CFX_DIBitmap* pBitmap) const; | 527 void ReleaseBitmap(CFX_DIBitmap* pBitmap) const; |
| 528 void ClearImageData(); | 528 void ClearImageData(); |
| 529 FX_DWORD GetMatteColor() const { return m_MatteColor; } | 529 uint32_t GetMatteColor() const { return m_MatteColor; } |
| 530 | 530 |
| 531 int StartLoadDIBSource(CPDF_Document* pDoc, | 531 int StartLoadDIBSource(CPDF_Document* pDoc, |
| 532 const CPDF_Stream* pStream, | 532 const CPDF_Stream* pStream, |
| 533 FX_BOOL bHasMask, | 533 FX_BOOL bHasMask, |
| 534 CPDF_Dictionary* pFormResources, | 534 CPDF_Dictionary* pFormResources, |
| 535 CPDF_Dictionary* pPageResources, | 535 CPDF_Dictionary* pPageResources, |
| 536 FX_BOOL bStdCS = FALSE, | 536 FX_BOOL bStdCS = FALSE, |
| 537 FX_DWORD GroupFamily = 0, | 537 uint32_t GroupFamily = 0, |
| 538 FX_BOOL bLoadMask = FALSE); | 538 FX_BOOL bLoadMask = FALSE); |
| 539 int ContinueLoadDIBSource(IFX_Pause* pPause); | 539 int ContinueLoadDIBSource(IFX_Pause* pPause); |
| 540 int StratLoadMask(); | 540 int StratLoadMask(); |
| 541 int StartLoadMaskDIB(); | 541 int StartLoadMaskDIB(); |
| 542 int ContinueLoadMaskDIB(IFX_Pause* pPause); | 542 int ContinueLoadMaskDIB(IFX_Pause* pPause); |
| 543 int ContinueToLoadMask(); | 543 int ContinueToLoadMask(); |
| 544 CPDF_DIBSource* DetachMask(); | 544 CPDF_DIBSource* DetachMask(); |
| 545 | 545 |
| 546 private: | 546 private: |
| 547 bool LoadColorInfo(const CPDF_Dictionary* pFormResources, | 547 bool LoadColorInfo(const CPDF_Dictionary* pFormResources, |
| 548 const CPDF_Dictionary* pPageResources); | 548 const CPDF_Dictionary* pPageResources); |
| 549 DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, | 549 DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode, |
| 550 FX_BOOL& bColorKey); | 550 FX_BOOL& bColorKey); |
| 551 CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor); | 551 CPDF_DIBSource* LoadMask(uint32_t& MatteColor); |
| 552 CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask); | 552 CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask); |
| 553 void LoadJpxBitmap(); | 553 void LoadJpxBitmap(); |
| 554 void LoadPalette(); | 554 void LoadPalette(); |
| 555 int CreateDecoder(); | 555 int CreateDecoder(); |
| 556 void TranslateScanline24bpp(uint8_t* dest_scan, | 556 void TranslateScanline24bpp(uint8_t* dest_scan, |
| 557 const uint8_t* src_scan) const; | 557 const uint8_t* src_scan) const; |
| 558 void ValidateDictParam(); | 558 void ValidateDictParam(); |
| 559 void DownSampleScanline1Bit(int orig_Bpp, | 559 void DownSampleScanline1Bit(int orig_Bpp, |
| 560 int dest_Bpp, | 560 int dest_Bpp, |
| 561 FX_DWORD src_width, | 561 uint32_t src_width, |
| 562 const uint8_t* pSrcLine, | 562 const uint8_t* pSrcLine, |
| 563 uint8_t* dest_scan, | 563 uint8_t* dest_scan, |
| 564 int dest_width, | 564 int dest_width, |
| 565 FX_BOOL bFlipX, | 565 FX_BOOL bFlipX, |
| 566 int clip_left, | 566 int clip_left, |
| 567 int clip_width) const; | 567 int clip_width) const; |
| 568 void DownSampleScanline8Bit(int orig_Bpp, | 568 void DownSampleScanline8Bit(int orig_Bpp, |
| 569 int dest_Bpp, | 569 int dest_Bpp, |
| 570 FX_DWORD src_width, | 570 uint32_t src_width, |
| 571 const uint8_t* pSrcLine, | 571 const uint8_t* pSrcLine, |
| 572 uint8_t* dest_scan, | 572 uint8_t* dest_scan, |
| 573 int dest_width, | 573 int dest_width, |
| 574 FX_BOOL bFlipX, | 574 FX_BOOL bFlipX, |
| 575 int clip_left, | 575 int clip_left, |
| 576 int clip_width) const; | 576 int clip_width) const; |
| 577 void DownSampleScanline32Bit(int orig_Bpp, | 577 void DownSampleScanline32Bit(int orig_Bpp, |
| 578 int dest_Bpp, | 578 int dest_Bpp, |
| 579 FX_DWORD src_width, | 579 uint32_t src_width, |
| 580 const uint8_t* pSrcLine, | 580 const uint8_t* pSrcLine, |
| 581 uint8_t* dest_scan, | 581 uint8_t* dest_scan, |
| 582 int dest_width, | 582 int dest_width, |
| 583 FX_BOOL bFlipX, | 583 FX_BOOL bFlipX, |
| 584 int clip_left, | 584 int clip_left, |
| 585 int clip_width) const; | 585 int clip_width) const; |
| 586 FX_BOOL TransMask() const; | 586 FX_BOOL TransMask() const; |
| 587 | 587 |
| 588 CPDF_Document* m_pDocument; | 588 CPDF_Document* m_pDocument; |
| 589 const CPDF_Stream* m_pStream; | 589 const CPDF_Stream* m_pStream; |
| 590 std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc; | 590 std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc; |
| 591 const CPDF_Dictionary* m_pDict; | 591 const CPDF_Dictionary* m_pDict; |
| 592 CPDF_ColorSpace* m_pColorSpace; | 592 CPDF_ColorSpace* m_pColorSpace; |
| 593 FX_DWORD m_Family; | 593 uint32_t m_Family; |
| 594 FX_DWORD m_bpc; | 594 uint32_t m_bpc; |
| 595 FX_DWORD m_bpc_orig; | 595 uint32_t m_bpc_orig; |
| 596 FX_DWORD m_nComponents; | 596 uint32_t m_nComponents; |
| 597 FX_DWORD m_GroupFamily; | 597 uint32_t m_GroupFamily; |
| 598 FX_DWORD m_MatteColor; | 598 uint32_t m_MatteColor; |
| 599 FX_BOOL m_bLoadMask; | 599 FX_BOOL m_bLoadMask; |
| 600 FX_BOOL m_bDefaultDecode; | 600 FX_BOOL m_bDefaultDecode; |
| 601 FX_BOOL m_bImageMask; | 601 FX_BOOL m_bImageMask; |
| 602 FX_BOOL m_bDoBpcCheck; | 602 FX_BOOL m_bDoBpcCheck; |
| 603 FX_BOOL m_bColorKey; | 603 FX_BOOL m_bColorKey; |
| 604 FX_BOOL m_bHasMask; | 604 FX_BOOL m_bHasMask; |
| 605 FX_BOOL m_bStdCS; | 605 FX_BOOL m_bStdCS; |
| 606 DIB_COMP_DATA* m_pCompData; | 606 DIB_COMP_DATA* m_pCompData; |
| 607 uint8_t* m_pLineBuf; | 607 uint8_t* m_pLineBuf; |
| 608 uint8_t* m_pMaskedLine; | 608 uint8_t* m_pMaskedLine; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 636 const uint8_t* m_RampB; | 636 const uint8_t* m_RampB; |
| 637 }; | 637 }; |
| 638 | 638 |
| 639 struct _CPDF_UniqueKeyGen { | 639 struct _CPDF_UniqueKeyGen { |
| 640 void Generate(int count, ...); | 640 void Generate(int count, ...); |
| 641 FX_CHAR m_Key[128]; | 641 FX_CHAR m_Key[128]; |
| 642 int m_KeyLen; | 642 int m_KeyLen; |
| 643 }; | 643 }; |
| 644 | 644 |
| 645 #endif // CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ | 645 #endif // CORE_FPDFAPI_FPDF_RENDER_RENDER_INT_H_ |
| OLD | NEW |