K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2014 The PDFium Authors |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 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_WRITER_H_ |
| 8 | #define FXBARCODE_BC_WRITER_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
Tom Sepez | cefb38d | 2020-10-20 19:08:33 +0000 | [diff] [blame] | 10 | #include "core/fxge/dib/fx_dib.h" |
Lei Zhang | 222db47 | 2018-09-17 18:54:07 +0000 | [diff] [blame] | 11 | #include "fxbarcode/BC_Library.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 12 | |
| 13 | class CBC_Writer { |
| 14 | public: |
| 15 | CBC_Writer(); |
| 16 | virtual ~CBC_Writer(); |
Tom Sepez | 559dcbb | 2022-03-25 04:12:33 +0000 | [diff] [blame] | 17 | |
Tom Sepez | 559dcbb | 2022-03-25 04:12:33 +0000 | [diff] [blame] | 18 | bool SetModuleHeight(int32_t moduleHeight); |
| 19 | bool SetModuleWidth(int32_t moduleWidth); |
Tom Sepez | 1f8b5df | 2022-03-25 23:07:54 +0000 | [diff] [blame] | 20 | void SetHeight(int32_t height); |
| 21 | void SetWidth(int32_t width); |
Tom Sepez | 559dcbb | 2022-03-25 04:12:33 +0000 | [diff] [blame] | 22 | |
Tom Sepez | 83f0a43 | 2021-08-24 21:09:33 +0000 | [diff] [blame] | 23 | virtual void SetTextLocation(BC_TEXT_LOC location); |
Lei Zhang | 4c3b4aa | 2018-09-17 22:22:36 +0000 | [diff] [blame] | 24 | virtual bool SetWideNarrowRatio(int8_t ratio); |
| 25 | virtual bool SetStartChar(char start); |
| 26 | virtual bool SetEndChar(char end); |
| 27 | virtual bool SetErrorCorrectionLevel(int32_t level); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 28 | |
| 29 | protected: |
Tom Sepez | ea8d8d8 | 2019-11-08 20:31:35 +0000 | [diff] [blame] | 30 | static const FX_ARGB kBarColor = 0xff000000; |
| 31 | static const FX_ARGB kBackgroundColor = 0xffffffff; |
| 32 | |
Tom Sepez | 1adeee0 | 2025-04-02 12:38:52 -0700 | [diff] [blame] | 33 | int32_t module_height_ = 1; |
| 34 | int32_t module_width_ = 1; |
| 35 | int32_t height_ = 320; |
| 36 | int32_t width_ = 640; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 37 | }; |
| 38 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 39 | #endif // FXBARCODE_BC_WRITER_H_ |