• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 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 FXBARCODE_BC_TWODIMWRITER_H_
8 #define FXBARCODE_BC_TWODIMWRITER_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/fx_coordinates.h"
13 #include "fxbarcode/BC_Writer.h"
14 
15 class CBC_CommonBitMatrix;
16 class CFX_RenderDevice;
17 
18 class CBC_TwoDimWriter : public CBC_Writer {
19  public:
20   CBC_TwoDimWriter();
21   ~CBC_TwoDimWriter() override;
22 
23   virtual bool RenderResult(uint8_t* code,
24                             int32_t codeWidth,
25                             int32_t codeHeight);
26   virtual void RenderDeviceResult(CFX_RenderDevice* device,
27                                   const CFX_Matrix* matrix);
28   virtual bool SetErrorCorrectionLevel(int32_t level) = 0;
29   int32_t GetErrorCorrectionLevel() const;
30 
31  protected:
32   int32_t m_iCorrectLevel;
33   bool m_bFixedSize;
34   std::unique_ptr<CBC_CommonBitMatrix> m_output;
35 };
36 
37 #endif  // FXBARCODE_BC_TWODIMWRITER_H_
38