• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_BITMAPSTORER_H_
8 #define CORE_FXGE_DIB_CFX_BITMAPSTORER_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 #include "core/fxcrt/retain_ptr.h"
12 #include "core/fxge/dib/scanlinecomposer_iface.h"
13 
14 class CFX_DIBitmap;
15 
16 class CFX_BitmapStorer final : public ScanlineComposerIface {
17  public:
18   CFX_BitmapStorer();
19   ~CFX_BitmapStorer() override;
20 
21   // ScanlineComposerIface
22   void ComposeScanline(int line,
23                        const uint8_t* scanline,
24                        const uint8_t* scan_extra_alpha) override;
25   bool SetInfo(int width,
26                int height,
27                FXDIB_Format src_format,
28                uint32_t* pSrcPalette) override;
29 
GetBitmap()30   RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; }
31   RetainPtr<CFX_DIBitmap> Detach();
32   void Replace(RetainPtr<CFX_DIBitmap>&& pBitmap);
33 
34  private:
35   RetainPtr<CFX_DIBitmap> m_pBitmap;
36 };
37 
38 #endif  // CORE_FXGE_DIB_CFX_BITMAPSTORER_H_
39