summaryrefslogtreecommitdiff
path: root/fxbarcode/datamatrix/BC_SymbolInfo.h
blob: 36ed01d7e48bab12c52b63b00f8b25f73b86f069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_
#define FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_

#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
#include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"

class CBC_Dimension;

class CBC_SymbolInfo : public CBC_SymbolShapeHint {
 public:
  CBC_SymbolInfo(bool rectangular,
                 int32_t dataCapacity,
                 int32_t errorCodewords,
                 int32_t matrixWidth,
                 int32_t matrixHeight,
                 int32_t dataRegions);
  ~CBC_SymbolInfo() override;

  static void Initialize();
  static void Finalize();
  static void overrideSymbolSet(CBC_SymbolInfo* override);
  static CBC_SymbolInfo* lookup(int32_t dataCodewords, int32_t& e);
  static CBC_SymbolInfo* lookup(int32_t dataCodewords,
                                SymbolShapeHint shape,
                                int32_t& e);
  static CBC_SymbolInfo* lookup(int32_t dataCodewords,
                                bool allowRectangular,
                                bool fail,
                                int32_t& e);
  static CBC_SymbolInfo* lookup(int32_t dataCodewords,
                                SymbolShapeHint shape,
                                bool fail,
                                int32_t& e);
  static CBC_SymbolInfo* lookup(int32_t dataCodewords,
                                SymbolShapeHint shape,
                                CBC_Dimension* minSize,
                                CBC_Dimension* maxSize,
                                bool fail,
                                int32_t& e);
  int32_t getHorizontalDataRegions(int32_t& e);
  int32_t getVerticalDataRegions(int32_t& e);
  int32_t getSymbolDataWidth(int32_t& e);
  int32_t getSymbolDataHeight(int32_t& e);
  int32_t getSymbolWidth(int32_t& e);
  int32_t getSymbolHeight(int32_t& e);
  int32_t getCodewordCount();
  int32_t getInterleavedBlockCount();
  int32_t getDataLengthForInterleavedBlock(int32_t index);
  int32_t getErrorLengthForInterleavedBlock(int32_t index);

  int32_t m_dataCapacity;
  int32_t m_errorCodewords;
  int32_t m_matrixWidth;
  int32_t m_matrixHeight;
  int32_t m_rsBlockData;
  int32_t m_rsBlockError;

 private:
  CBC_SymbolInfo(bool rectangular,
                 int32_t dataCapacity,
                 int32_t errorCodewords,
                 int32_t matrixWidth,
                 int32_t matrixHeight,
                 int32_t dataRegions,
                 int32_t rsBlockData,
                 int32_t rsBlockError);

  bool m_rectangular;
  int32_t m_dataRegions;
};

#endif  // FXBARCODE_DATAMATRIX_BC_SYMBOLINFO_H_