8
9
10
11
12
13
14
15
16
17
18
19
20
21
23#include "fxbarcode/datamatrix/BC_SymbolInfo.h"
27#include "fxbarcode/common/BC_CommonBitMatrix.h"
28#include "fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h"
29#include "fxbarcode/datamatrix/BC_Encoder.h"
30#include "third_party/base/notreached.h"
34constexpr size_t kSymbolsCount = 30;
37 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
38 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
39 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
40 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
43 {3, 5, 3, 5, 8, 8, 1}, {5, 7, 5, 7, 10, 10, 1},
44 {5, 7, 5, 7, 16, 6, 1}, {8, 10, 8, 10, 12, 12, 1},
45 {10, 11, 10, 11, 14, 6, 2}, {12, 12, 12, 12, 14, 14, 1},
46 {16, 14, 16, 14, 24, 10, 1}, {18, 14, 18, 14, 16, 16, 1},
47 {22, 18, 22, 18, 18, 18, 1}, {22, 18, 22, 18, 16, 10, 2},
48 {30, 20, 30, 20, 20, 20, 1}, {32, 24, 32, 24, 16, 14, 2},
49 {36, 24, 36, 24, 22, 22, 1}, {44, 28, 44, 28, 24, 24, 1},
50 {49, 28, 49, 28, 22, 14, 2}, {62, 36, 62, 36, 14, 14, 4},
51 {86, 42, 86, 42, 16, 16, 4}, {114, 48, 114, 48, 18, 18, 4},
52 {144, 56, 144, 56, 20, 20, 4}, {174, 68, 174, 68, 22, 22, 4},
53 {204, 84, 102, 42, 24, 24, 4}, {280, 112, 140, 56, 14, 14, 16},
54 {368, 144, 92, 36, 16, 16, 16}, {456, 192, 114, 48, 18, 18, 16},
55 {576, 224, 144, 56, 20, 20, 16}, {696, 272, 174, 68, 22, 22, 16},
56 {816, 336, 136, 56, 24, 24, 16}, {1050, 408, 175, 68, 18, 18, 36},
57 {1304, 496, 163, 62, 20, 20, 36}};
59constexpr size_t kSymbolDataSize = std::size(kSymbolData);
60static_assert(kSymbolDataSize + 1 == kSymbolsCount,
"Wrong kSymbolDataSize");
66 for (size_t i = 0; i < kSymbolDataSize; ++i)
68 g_symbols[kSymbolDataSize] =
new CBC_DataMatrixSymbolInfo144
();
73 for (size_t i = 0; i < kSymbolsCount; ++i) {
75 g_symbols[i] =
nullptr;
84 bool allow_rectangular) {
85 for (size_t i = 0; i < kSymbolsCount; ++i) {
87 if (symbol->is_rectangular() && !allow_rectangular)
90 if (data_codewords <= symbol->data_capacity())
97 switch (data_->data_regions) {
109 NOTREACHED_NORETURN();
114 switch (data_->data_regions) {
126 NOTREACHED_NORETURN();
131 return GetHorizontalDataRegions() * data_->matrix_width;
135 return GetVerticalDataRegions() * data_->matrix_height;
147 return data_->data_capacity / data_->rs_block_data;
151 return data_->rs_block_data;
155 return data_->rs_block_error;
CBC_DataMatrixSymbolInfo144()
int32_t GetSymbolDataHeight() const
int32_t GetSymbolWidth() const
virtual ~CBC_SymbolInfo()
int32_t GetSymbolHeight() const
size_t GetDataLengthForInterleavedBlock() const
size_t GetErrorLengthForInterleavedBlock() const
int32_t GetSymbolDataWidth() const
virtual size_t GetInterleavedBlockCount() const
CBC_SymbolInfo(const Data *data)