8
9
10
11
12
13
14
15
16
17
18
19
20
21
23#include "fxbarcode/datamatrix/BC_DataMatrixWriter.h"
29#include "core/fxcrt/data_vector.h"
30#include "fxbarcode/BC_TwoDimWriter.h"
31#include "fxbarcode/BC_Writer.h"
32#include "fxbarcode/common/BC_CommonBitMatrix.h"
33#include "fxbarcode/common/BC_CommonByteMatrix.h"
34#include "fxbarcode/datamatrix/BC_ASCIIEncoder.h"
35#include "fxbarcode/datamatrix/BC_Base256Encoder.h"
36#include "fxbarcode/datamatrix/BC_C40Encoder.h"
37#include "fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h"
38#include "fxbarcode/datamatrix/BC_DefaultPlacement.h"
39#include "fxbarcode/datamatrix/BC_EdifactEncoder.h"
40#include "fxbarcode/datamatrix/BC_Encoder.h"
41#include "fxbarcode/datamatrix/BC_EncoderContext.h"
42#include "fxbarcode/datamatrix/BC_ErrorCorrection.h"
43#include "fxbarcode/datamatrix/BC_HighLevelEncoder.h"
44#include "fxbarcode/datamatrix/BC_SymbolInfo.h"
45#include "fxbarcode/datamatrix/BC_TextEncoder.h"
46#include "fxbarcode/datamatrix/BC_X12Encoder.h"
47#include "third_party/base/check.h"
51std::unique_ptr<CBC_CommonByteMatrix> EncodeLowLevel(
52 CBC_DefaultPlacement* placement,
63 auto matrix =
std::make_unique<CBC_CommonByteMatrix>(width, height);
65 for (int32_t y = 0; y < symbolHeight; y++) {
69 for (int32_t x = 0; x < width; x++) {
70 matrix->Set(matrixX, matrixY, x % 2 == 0);
76 for (int32_t x = 0; x < symbolWidth; x++) {
78 matrix->Set(matrixX, matrixY,
true);
81 matrix->Set(matrixX, matrixY, placement
->GetBit(x
, y
));
84 matrix->Set(matrixX, matrixY, y % 2 == 0);
91 for (int32_t x = 0; x < width; x++) {
92 matrix->Set(matrixX, matrixY,
true);
114 int32_t* pOutHeight) {
117 return DataVector<uint8_t>();
120 CBC_SymbolInfo::Lookup(encoded.GetLength(),
false);
122 return DataVector<uint8_t>();
124 WideString codewords =
127 return DataVector<uint8_t>();
135 std::make_unique<CBC_DefaultPlacement>(codewords, width, height);
136 auto bytematrix = EncodeLowLevel(placement.get(), pSymbolInfo);
139 *pOutWidth = bytematrix->GetWidth();
140 *pOutHeight = bytematrix->GetHeight();
141 return bytematrix->TakeArray();
bool SetErrorCorrectionLevel(int32_t level) override
~CBC_DataMatrixWriter() override
DataVector< uint8_t > Encode(const WideString &contents, int32_t *pOutWidth, int32_t *pOutHeight)
bool GetBit(int32_t col, int32_t row) const
static WideString EncodeECC200(const WideString &codewords, const CBC_SymbolInfo *symbolInfo)
static WideString EncodeHighLevel(const WideString &msg)
int32_t GetSymbolDataHeight() const
int32_t GetSymbolWidth() const
int32_t GetSymbolHeight() const
int32_t matrix_height() const
int32_t GetSymbolDataWidth() const
int32_t matrix_width() const
void set_error_correction_level(int32_t level)
CBC_TwoDimWriter(bool bFixedSize)