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_DATAMATRIX_BC_DEFAULTPLACEMENT_H_ |
| 8 | #define FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_ |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 9 | |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 10 | #include <vector> |
| 11 | |
Dan Sinclair | bcd1e70 | 2017-08-31 13:19:18 -0400 | [diff] [blame] | 12 | #include "core/fxcrt/fx_string.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 13 | |
| 14 | class CBC_DefaultPlacement { |
| 15 | public: |
| 16 | CBC_DefaultPlacement(CFX_WideString codewords, |
| 17 | int32_t numcols, |
| 18 | int32_t numrows); |
| 19 | virtual ~CBC_DefaultPlacement(); |
| 20 | |
| 21 | int32_t getNumrows(); |
| 22 | int32_t getNumcols(); |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 23 | std::vector<uint8_t>& getBits(); |
tsepez | d19e912 | 2016-11-02 15:43:18 -0700 | [diff] [blame] | 24 | bool getBit(int32_t col, int32_t row); |
| 25 | void setBit(int32_t col, int32_t row, bool bit); |
| 26 | bool hasBit(int32_t col, int32_t row); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 27 | void place(); |
| 28 | |
| 29 | private: |
| 30 | CFX_WideString m_codewords; |
| 31 | int32_t m_numrows; |
| 32 | int32_t m_numcols; |
Tom Sepez | 8b6186f | 2017-03-28 12:06:45 -0700 | [diff] [blame] | 33 | std::vector<uint8_t> m_bits; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 34 | void module(int32_t row, int32_t col, int32_t pos, int32_t bit); |
| 35 | void utah(int32_t row, int32_t col, int32_t pos); |
| 36 | void corner1(int32_t pos); |
| 37 | void corner2(int32_t pos); |
| 38 | void corner3(int32_t pos); |
| 39 | void corner4(int32_t pos); |
| 40 | }; |
| 41 | |
Dan Sinclair | e778668 | 2017-03-29 15:18:41 -0400 | [diff] [blame] | 42 | #endif // FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_ |