• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 The PDFium Authors
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 <stdint.h>
11 
12 #include "core/fxcrt/retain_ptr.h"
13 #include "core/fxcrt/span.h"
14 #include "core/fxge/dib/scanlinecomposer_iface.h"
15 
16 class CFX_DIBitmap;
17 
18 class CFX_BitmapStorer final : public ScanlineComposerIface {
19  public:
20   CFX_BitmapStorer();
21   ~CFX_BitmapStorer() override;
22 
23   // ScanlineComposerIface:
24   void ComposeScanline(int line, pdfium::span<const uint8_t> scanline) override;
25   bool SetInfo(int width,
26                int height,
27                FXDIB_Format src_format,
28                DataVector<uint32_t> src_palette) 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