Home | History | Annotate | Download | only in datamatrix
      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 
      7 #ifndef FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_
      8 #define FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_
      9 
     10 #include <vector>
     11 
     12 #include "core/fxcrt/fx_string.h"
     13 
     14 class CBC_DefaultPlacement {
     15  public:
     16   CBC_DefaultPlacement(WideString codewords, int32_t numcols, int32_t numrows);
     17   virtual ~CBC_DefaultPlacement();
     18 
     19   int32_t getNumrows();
     20   int32_t getNumcols();
     21   std::vector<uint8_t>& getBits();
     22   bool getBit(int32_t col, int32_t row);
     23   void setBit(int32_t col, int32_t row, bool bit);
     24   bool hasBit(int32_t col, int32_t row);
     25   void place();
     26 
     27  private:
     28   WideString m_codewords;
     29   int32_t m_numrows;
     30   int32_t m_numcols;
     31   std::vector<uint8_t> m_bits;
     32   void module(int32_t row, int32_t col, int32_t pos, int32_t bit);
     33   void utah(int32_t row, int32_t col, int32_t pos);
     34   void corner1(int32_t pos);
     35   void corner2(int32_t pos);
     36   void corner3(int32_t pos);
     37   void corner4(int32_t pos);
     38 };
     39 
     40 #endif  // FXBARCODE_DATAMATRIX_BC_DEFAULTPLACEMENT_H_
     41