8
9
10
11
12
13
14
15
16
17
18
19
20
21
23#include "fxbarcode/pdf417/BC_PDF417Writer.h"
30#include "core/fxcrt/data_vector.h"
31#include "core/fxcrt/stl_util.h"
32#include "fxbarcode/BC_TwoDimWriter.h"
33#include "fxbarcode/common/BC_CommonBitMatrix.h"
34#include "fxbarcode/pdf417/BC_PDF417.h"
35#include "fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h"
42 if (level < 0 || level > 8) {
51 int32_t* pOutHeight) {
55 if (row >= 3 && row <= 90 && col >= 1 && col <= 30)
57 else if (col >= 1 && col <= 30)
59 else if (row >= 3 && row <= 90)
62 return DataVector<uint8_t>();
65 DataVector<uint8_t> matrixData = barcodeMatrix->toBitArray();
66 int32_t matrixWidth = barcodeMatrix->getWidth();
67 int32_t matrixHeight = barcodeMatrix->getHeight();
69 if (matrixWidth < matrixHeight) {
70 RotateArray(&matrixData, matrixHeight, matrixWidth);
71 std::swap(matrixWidth, matrixHeight);
73 *pOutWidth = matrixWidth;
74 *pOutHeight = matrixHeight;
78void CBC_PDF417Writer::RotateArray(DataVector<uint8_t>* bitarray,
81 DataVector<uint8_t> temp = *bitarray;
82 for (int32_t ii = 0; ii < height; ii++) {
83 int32_t inverseii = height - ii - 1;
84 for (int32_t jj = 0; jj < width; jj++) {
85 (*bitarray)[jj * height + inverseii] = temp[ii * width + jj];
~CBC_PDF417Writer() override
bool SetErrorCorrectionLevel(int32_t level) override
DataVector< uint8_t > Encode(WideStringView contents, int32_t *pOutWidth, int32_t *pOutHeight)
void setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows)
bool GenerateBarcodeLogic(WideStringView msg, int32_t errorCorrectionLevel)
CBC_BarcodeMatrix * getBarcodeMatrix()
int32_t error_correction_level() const
void set_error_correction_level(int32_t level)
CBC_TwoDimWriter(bool bFixedSize)