Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 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 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 7 | #ifndef FXBARCODE_BC_TWODIMWRITER_H_ |
| 8 | #define FXBARCODE_BC_TWODIMWRITER_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 10 | #include <memory> |
| 11 | |
Nicolas Pena | 37cc5fb | 2017-04-04 12:12:49 -0400 | [diff] [blame] | 12 | #include "core/fxcrt/fx_coordinates.h" |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 13 | #include "fxbarcode/BC_Writer.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 14 | |
| 15 | class CBC_CommonBitMatrix; |
thestig | 25fa42f | 2016-05-25 21:39:46 -0700 | [diff] [blame] | 16 | class CFX_RenderDevice; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 17 | |
| 18 | class CBC_TwoDimWriter : public CBC_Writer { |
| 19 | public: |
| 20 | CBC_TwoDimWriter(); |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 21 | ~CBC_TwoDimWriter() override; |
| 22 | |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 23 | virtual bool RenderResult(uint8_t* code, |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 24 | int32_t codeWidth, |
Lei Zhang | 1badb85 | 2017-04-20 15:58:56 -0700 | [diff] [blame] | 25 | int32_t codeHeight); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 26 | virtual void RenderDeviceResult(CFX_RenderDevice* device, |
| 27 | const CFX_Matrix* matrix); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 28 | virtual bool SetErrorCorrectionLevel(int32_t level) = 0; |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 29 | int32_t GetErrorCorrectionLevel() const; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 30 | |
| 31 | protected: |
| 32 | int32_t m_iCorrectLevel; |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 33 | bool m_bFixedSize; |
weili | e76203d | 2016-08-09 13:45:03 -0700 | [diff] [blame] | 34 | std::unique_ptr<CBC_CommonBitMatrix> m_output; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 35 | }; |
| 36 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 37 | #endif // FXBARCODE_BC_TWODIMWRITER_H_ |