1 // Copyright 2017 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_FXGE_DIB_CFX_IMAGERENDERER_H_ 8 #define CORE_FXGE_DIB_CFX_IMAGERENDERER_H_ 9 10 #include <memory> 11 12 #include "core/fxcrt/fx_coordinates.h" 13 #include "core/fxcrt/retain_ptr.h" 14 #include "core/fxcrt/unowned_ptr.h" 15 #include "core/fxge/dib/cfx_bitmapcomposer.h" 16 #include "core/fxge/dib/cfx_dibitmap.h" 17 #include "core/fxge/dib/cfx_dibsource.h" 18 #include "core/fxge/fx_dib.h" 19 #include "third_party/base/stl_util.h" 20 21 class CFX_ImageTransformer; 22 class CFX_ImageStretcher; 23 24 class CFX_ImageRenderer { 25 public: 26 CFX_ImageRenderer(const RetainPtr<CFX_DIBitmap>& pDevice, 27 const CFX_ClipRgn* pClipRgn, 28 const RetainPtr<CFX_DIBSource>& pSource, 29 int bitmap_alpha, 30 uint32_t mask_color, 31 const CFX_Matrix* pMatrix, 32 uint32_t dib_flags, 33 bool bRgbByteOrder); 34 ~CFX_ImageRenderer(); 35 36 bool Continue(IFX_PauseIndicator* pPause); 37 38 private: 39 const RetainPtr<CFX_DIBitmap> m_pDevice; 40 const UnownedPtr<const CFX_ClipRgn> m_pClipRgn; 41 const CFX_Matrix m_Matrix; 42 const int m_BitmapAlpha; 43 const int m_BlendType; 44 const bool m_bRgbByteOrder; 45 uint32_t m_MaskColor; 46 std::unique_ptr<CFX_ImageTransformer> m_pTransformer; 47 std::unique_ptr<CFX_ImageStretcher> m_Stretcher; 48 CFX_BitmapComposer m_Composer; 49 int m_Status; 50 FX_RECT m_ClipBox; 51 int m_AlphaFlag; 52 }; 53 54 #endif // CORE_FXGE_DIB_CFX_IMAGERENDERER_H_ 55