blob: e554805fcf108799b4dacc989b7fa323d0f5c63a [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// 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 Sinclaire7786682017-03-29 15:18:41 -04007#ifndef FXBARCODE_BC_TWODIMWRITER_H_
8#define FXBARCODE_BC_TWODIMWRITER_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
weilie76203d2016-08-09 13:45:03 -070010#include <memory>
11
Nicolas Pena37cc5fb2017-04-04 12:12:49 -040012#include "core/fxcrt/fx_coordinates.h"
Dan Sinclaire7786682017-03-29 15:18:41 -040013#include "fxbarcode/BC_Writer.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040014
15class CBC_CommonBitMatrix;
thestig25fa42f2016-05-25 21:39:46 -070016class CFX_RenderDevice;
Dan Sinclair1770c022016-03-14 14:14:16 -040017
18class CBC_TwoDimWriter : public CBC_Writer {
19 public:
20 CBC_TwoDimWriter();
weili29b8ad02016-06-14 18:20:04 -070021 ~CBC_TwoDimWriter() override;
22
Lei Zhang1badb852017-04-20 15:58:56 -070023 virtual bool RenderResult(uint8_t* code,
Dan Sinclair1770c022016-03-14 14:14:16 -040024 int32_t codeWidth,
Lei Zhang1badb852017-04-20 15:58:56 -070025 int32_t codeHeight);
Dan Sinclair1770c022016-03-14 14:14:16 -040026 virtual void RenderDeviceResult(CFX_RenderDevice* device,
27 const CFX_Matrix* matrix);
tsepezd19e9122016-11-02 15:43:18 -070028 virtual bool SetErrorCorrectionLevel(int32_t level) = 0;
weilie76203d2016-08-09 13:45:03 -070029 int32_t GetErrorCorrectionLevel() const;
Dan Sinclair1770c022016-03-14 14:14:16 -040030
31 protected:
32 int32_t m_iCorrectLevel;
tsepezd19e9122016-11-02 15:43:18 -070033 bool m_bFixedSize;
weilie76203d2016-08-09 13:45:03 -070034 std::unique_ptr<CBC_CommonBitMatrix> m_output;
Dan Sinclair1770c022016-03-14 14:14:16 -040035};
36
Dan Sinclaire7786682017-03-29 15:18:41 -040037#endif // FXBARCODE_BC_TWODIMWRITER_H_