// Copyright 2018 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef XFA_FXFA_CXFA_IMAGERENDERER_H_ #define XFA_FXFA_CXFA_IMAGERENDERER_H_ #include #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" class CFX_RenderDevice; class CFX_DIBSource; class CFX_DIBitmap; class CFX_ImageTransformer; class CFX_ImageRenderer; class CXFA_ImageRenderer { public: CXFA_ImageRenderer(); ~CXFA_ImageRenderer(); bool Start(CFX_RenderDevice* pDevice, const RetainPtr& pDIBSource, FX_ARGB bitmap_argb, int bitmap_alpha, const CFX_Matrix* pImage2Device, uint32_t flags, int blendType = FXDIB_BLEND_NORMAL); bool Continue(); protected: bool StartDIBSource(); void CompositeDIBitmap(const RetainPtr& pDIBitmap, int left, int top, FX_ARGB mask_argb, int bitmap_alpha, int blend_mode, int iTransparency); CFX_RenderDevice* m_pDevice; int m_Status = 0; CFX_Matrix m_ImageMatrix; RetainPtr m_pDIBSource; RetainPtr m_pCloneConvert; int m_BitmapAlpha = 255; FX_ARGB m_FillArgb = 0; uint32_t m_Flags = 0; std::unique_ptr m_pTransformer; std::unique_ptr m_DeviceHandle; int32_t m_BlendType = FXDIB_BLEND_NORMAL; bool m_Result = true; bool m_bPrint = false; }; #endif // XFA_FXFA_CXFA_IMAGERENDERER_H_