| 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_PDF417BARCODEMATRIX_H_ |
| 8 | #define FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_ |
| Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
| Tom Sepez | 0804b3f | 2017-05-01 14:06:10 -0700 | [diff] [blame] | 10 | #include <memory> |
| Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 11 | #include <vector> |
| 12 | |
| Tom Sepez | 3627b50 | 2020-04-16 19:36:20 +0000 | [diff] [blame] | 13 | #include "core/fxcrt/fx_memory_wrappers.h" |
| 14 | |
| Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 15 | class CBC_BarcodeRow; |
| tsepez | aef780d | 2016-04-28 14:56:27 -0700 | [diff] [blame] | 16 | |
| Tom Sepez | 6a43b5c | 2019-07-26 16:35:10 +0000 | [diff] [blame] | 17 | class CBC_BarcodeMatrix final { |
| Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 18 | public: |
| Henrique Nakashima | 8ce49f8 | 2018-08-23 19:53:08 +0000 | [diff] [blame] | 19 | CBC_BarcodeMatrix(size_t width, size_t height); |
| Tom Sepez | 6a43b5c | 2019-07-26 16:35:10 +0000 | [diff] [blame] | 20 | ~CBC_BarcodeMatrix(); |
| weili | 29b8ad0 | 2016-06-14 18:20:04 -0700 | [diff] [blame] | 21 | |
| Henrique Nakashima | 98982a8 | 2018-08-22 22:26:06 +0000 | [diff] [blame] | 22 | CBC_BarcodeRow* getRow(size_t row) const { return m_matrix[row].get(); } |
| Henrique Nakashima | 81e0830 | 2018-08-22 21:28:36 +0000 | [diff] [blame] | 23 | size_t getWidth() const { return m_width; } |
| 24 | size_t getHeight() const { return m_height; } |
| Tom Sepez | 3627b50 | 2020-04-16 19:36:20 +0000 | [diff] [blame] | 25 | std::vector<uint8_t, FxAllocAllocator<uint8_t>> toBitArray(); |
| Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 26 | |
| 27 | private: |
| Tom Sepez | 0804b3f | 2017-05-01 14:06:10 -0700 | [diff] [blame] | 28 | std::vector<std::unique_ptr<CBC_BarcodeRow>> m_matrix; |
| Henrique Nakashima | 81e0830 | 2018-08-22 21:28:36 +0000 | [diff] [blame] | 29 | size_t m_width; |
| 30 | size_t m_height; |
| Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 31 | }; |
| 32 | |
| Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 33 | #endif // FXBARCODE_PDF417_BC_PDF417BARCODEMATRIX_H_ |