summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_imagerenderer.h
blob: 6a165b53e4688123f9ecb5ae8cb9f7fc10c1b5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// 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 <memory>

#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(CFX_RenderDevice* pDevice,
                     const RetainPtr<CFX_DIBSource>& pDIBSource,
                     FX_ARGB bitmap_argb,
                     int bitmap_alpha,
                     const CFX_Matrix* pImage2Device,
                     uint32_t flags);
  ~CXFA_ImageRenderer();

  bool Start();
  bool Continue();

 protected:
  void CompositeDIBitmap(const RetainPtr<CFX_DIBitmap>& 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<CFX_DIBSource> m_pDIBSource;
  RetainPtr<CFX_DIBitmap> m_pCloneConvert;
  int m_BitmapAlpha;
  FX_ARGB m_FillArgb;
  uint32_t m_Flags;
  std::unique_ptr<CFX_ImageTransformer> m_pTransformer;
  std::unique_ptr<CFX_ImageRenderer> m_DeviceHandle;
  int32_t m_BlendType = FXDIB_BLEND_NORMAL;
  bool m_Result = true;
  bool m_bPrint = false;
};

#endif  // XFA_FXFA_CXFA_IMAGERENDERER_H_