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_PDF417_BC_PDF417WRITER_H_ |
| 8 | #define FXBARCODE_PDF417_BC_PDF417WRITER_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
Tom Sepez | df2f16a | 2021-07-27 21:41:48 +0000 | [diff] [blame] | 10 | #include <stddef.h> |
| 11 | |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 12 | #include <vector> |
| 13 | |
Tom Sepez | 3627b50 | 2020-04-16 19:36:20 +0000 | [diff] [blame] | 14 | #include "core/fxcrt/fx_memory_wrappers.h" |
Tom Sepez | 1e151c6 | 2021-11-22 23:46:09 +0000 | [diff] [blame] | 15 | #include "core/fxcrt/widestring.h" |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 16 | #include "fxbarcode/BC_TwoDimWriter.h" |
Dan Sinclair | a98600a | 2016-03-21 15:15:56 -0400 | [diff] [blame] | 17 | |
Tom Sepez | 5586545 | 2018-08-27 20:18:04 +0000 | [diff] [blame] | 18 | class CBC_PDF417Writer final : public CBC_TwoDimWriter { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 19 | public: |
| 20 | CBC_PDF417Writer(); |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 21 | ~CBC_PDF417Writer() override; |
| 22 | |
Tom Sepez | 3627b50 | 2020-04-16 19:36:20 +0000 | [diff] [blame] | 23 | std::vector<uint8_t, FxAllocAllocator<uint8_t>> |
| 24 | Encode(WideStringView contents, int32_t* pOutWidth, int32_t* pOutHeight); |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 25 | |
| 26 | // CBC_TwoDimWriter |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 27 | bool SetErrorCorrectionLevel(int32_t level) override; |
weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 28 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 29 | private: |
Tom Sepez | 3627b50 | 2020-04-16 19:36:20 +0000 | [diff] [blame] | 30 | void RotateArray(std::vector<uint8_t, FxAllocAllocator<uint8_t>>* bitarray, |
tsepez | 82aa396 | 2017-01-20 12:59:50 -0800 | [diff] [blame] | 31 | int32_t width, |
| 32 | int32_t height); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 33 | }; |
| 34 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 35 | #endif // FXBARCODE_PDF417_BC_PDF417WRITER_H_ |