1 // Copyright 2016 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FPDFAPI_RENDER_CPDF_IMAGELOADER_H_ 8 #define CORE_FPDFAPI_RENDER_CPDF_IMAGELOADER_H_ 9 10 #include "core/fxcrt/retain_ptr.h" 11 #include "core/fxcrt/unowned_ptr.h" 12 13 class CFX_DIBBase; 14 class CPDF_ImageObject; 15 class CPDF_PageRenderCache; 16 class CPDF_RenderStatus; 17 class CPDF_TransferFunc; 18 class PauseIndicatorIface; 19 20 class CPDF_ImageLoader { 21 public: 22 CPDF_ImageLoader(); 23 ~CPDF_ImageLoader(); 24 25 bool Start(CPDF_ImageObject* pImage, 26 CPDF_PageRenderCache* pCache, 27 bool bStdCS, 28 uint32_t GroupFamily, 29 bool bLoadMask, 30 CPDF_RenderStatus* pRenderStatus); 31 bool Continue(PauseIndicatorIface* pPause, CPDF_RenderStatus* pRenderStatus); 32 33 RetainPtr<CFX_DIBBase> TranslateImage( 34 const RetainPtr<CPDF_TransferFunc>& pTransferFunc); 35 GetBitmap()36 const RetainPtr<CFX_DIBBase>& GetBitmap() const { return m_pBitmap; } GetMask()37 const RetainPtr<CFX_DIBBase>& GetMask() const { return m_pMask; } MatteColor()38 uint32_t MatteColor() const { return m_MatteColor; } 39 40 private: 41 void HandleFailure(); 42 43 uint32_t m_MatteColor = 0; 44 bool m_bCached = false; 45 RetainPtr<CFX_DIBBase> m_pBitmap; 46 RetainPtr<CFX_DIBBase> m_pMask; 47 UnownedPtr<CPDF_PageRenderCache> m_pCache; 48 UnownedPtr<CPDF_ImageObject> m_pImageObject; 49 }; 50 51 #endif // CORE_FPDFAPI_RENDER_CPDF_IMAGELOADER_H_ 52