OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXBARCODE_BC_TWODIMWRITER_H_ | 7 #ifndef XFA_FXBARCODE_BC_TWODIMWRITER_H_ |
8 #define XFA_FXBARCODE_BC_TWODIMWRITER_H_ | 8 #define XFA_FXBARCODE_BC_TWODIMWRITER_H_ |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "xfa/fxbarcode/BC_Writer.h" | 12 #include "xfa/fxbarcode/BC_Writer.h" |
11 | 13 |
12 class CBC_CommonBitMatrix; | 14 class CBC_CommonBitMatrix; |
13 class CFX_RenderDevice; | 15 class CFX_RenderDevice; |
14 | 16 |
15 class CBC_TwoDimWriter : public CBC_Writer { | 17 class CBC_TwoDimWriter : public CBC_Writer { |
16 public: | 18 public: |
17 CBC_TwoDimWriter(); | 19 CBC_TwoDimWriter(); |
18 ~CBC_TwoDimWriter() override; | 20 ~CBC_TwoDimWriter() override; |
19 | 21 |
20 virtual void RenderResult(uint8_t* code, | 22 virtual void RenderResult(uint8_t* code, |
21 int32_t codeWidth, | 23 int32_t codeWidth, |
22 int32_t codeHeight, | 24 int32_t codeHeight, |
23 int32_t& e); | 25 int32_t& e); |
24 virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, int32_t& e); | 26 virtual void RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, int32_t& e); |
25 virtual void RenderDeviceResult(CFX_RenderDevice* device, | 27 virtual void RenderDeviceResult(CFX_RenderDevice* device, |
26 const CFX_Matrix* matrix); | 28 const CFX_Matrix* matrix); |
27 virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0; | 29 virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0; |
28 virtual int32_t GetErrorCorrectionLevel(); | 30 |
| 31 int32_t GetErrorCorrectionLevel() const; |
29 | 32 |
30 protected: | 33 protected: |
31 int32_t m_iCorrectLevel; | 34 int32_t m_iCorrectLevel; |
32 FX_BOOL m_bFixedSize; | 35 FX_BOOL m_bFixedSize; |
33 CBC_CommonBitMatrix* m_output; | 36 std::unique_ptr<CBC_CommonBitMatrix> m_output; |
34 }; | 37 }; |
35 | 38 |
36 #endif // XFA_FXBARCODE_BC_TWODIMWRITER_H_ | 39 #endif // XFA_FXBARCODE_BC_TWODIMWRITER_H_ |
OLD | NEW |