blob: 17ecac9f5c155af90841ef2562f261f7a8cb303f [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_DATAMATRIX_BC_DEFAULTPLACEMENT_H_
8#define FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_
Dan Sinclair1770c022016-03-14 14:14:16 -04009
Tom Sepez8b6186f2017-03-28 12:06:45 -070010#include <vector>
11
Dan Sinclairbcd1e702017-08-31 13:19:18 -040012#include "core/fxcrt/fx_string.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040013
14class 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 Sepez8b6186f2017-03-28 12:06:45 -070023 std::vector<uint8_t>& getBits();
tsepezd19e9122016-11-02 15:43:18 -070024 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 Sinclair1770c022016-03-14 14:14:16 -040027 void place();
28
29 private:
30 CFX_WideString m_codewords;
31 int32_t m_numrows;
32 int32_t m_numcols;
Tom Sepez8b6186f2017-03-28 12:06:45 -070033 std::vector<uint8_t> m_bits;
Dan Sinclair1770c022016-03-14 14:14:16 -040034 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 Sinclaire7786682017-03-29 15:18:41 -040042#endif // FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_