#include "fxbarcode/qrcode/BC_QRCoderMatrixUtil.h"
#include <array>
#include <iterator>
#include "core/fxcrt/check.h"
#include "core/fxcrt/check_op.h"
#include "fxbarcode/common/BC_CommonByteMatrix.h"
#include "fxbarcode/qrcode/BC_QRCoder.h"
#include "fxbarcode/qrcode/BC_QRCoderBitVector.h"
#include "fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h"
#include "fxbarcode/qrcode/BC_QRCoderMaskUtil.h"
namespace {
PositionDetectionPatternRow;
constexpr std::array<const PositionDetectionPatternRow, 7>
kPositionDetectionPatternTable = …;
PositionAdjustmentPatternRow;
constexpr std::array<const PositionAdjustmentPatternRow, 5>
kPositionAdjustmentPatternTable = …;
constexpr size_t kNumCoordinate = …;
PositionCoordinatePatternRow;
constexpr std::array<const PositionCoordinatePatternRow, 39>
kPositionCoordinatePatternTable = …;
struct TypeInfoCoordinate { … };
const std::array<const TypeInfoCoordinate, 15> kTypeInfoCoordinates = …;
constexpr int32_t VERSION_INFO_POLY = …;
constexpr int32_t TYPE_INFO_POLY = …;
constexpr int32_t TYPE_INFO_MASK_PATTERN = …;
bool IsEmpty(int32_t value) { … }
bool IsValidValue(int32_t value) { … }
int32_t FindMSBSet(int32_t value) { … }
bool EmbedDataBits(CBC_QRCoderBitVector* dataBits,
int32_t maskPattern,
CBC_CommonByteMatrix* matrix) { … }
int32_t CalculateBCHCode(int32_t value, int32_t poly) { … }
bool MakeTypeInfoBits(const CBC_QRCoderErrorCorrectionLevel* ecLevel,
int32_t maskPattern,
CBC_QRCoderBitVector* bits) { … }
void MakeVersionInfoBits(int32_t version, CBC_QRCoderBitVector* bits) { … }
bool EmbedTypeInfo(const CBC_QRCoderErrorCorrectionLevel* ecLevel,
int32_t maskPattern,
CBC_CommonByteMatrix* matrix) { … }
void MaybeEmbedVersionInfo(int32_t version, CBC_CommonByteMatrix* matrix) { … }
bool EmbedTimingPatterns(CBC_CommonByteMatrix* matrix) { … }
bool EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix) { … }
bool EmbedHorizontalSeparationPattern(int32_t xStart,
int32_t yStart,
CBC_CommonByteMatrix* matrix) { … }
bool EmbedVerticalSeparationPattern(int32_t xStart,
int32_t yStart,
CBC_CommonByteMatrix* matrix) { … }
bool EmbedPositionAdjustmentPattern(int32_t xStart,
int32_t yStart,
CBC_CommonByteMatrix* matrix) { … }
bool EmbedPositionDetectionPattern(int32_t xStart,
int32_t yStart,
CBC_CommonByteMatrix* matrix) { … }
bool EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix) { … }
bool MaybeEmbedPositionAdjustmentPatterns(int32_t version,
CBC_CommonByteMatrix* matrix) { … }
bool EmbedBasicPatterns(int32_t version, CBC_CommonByteMatrix* matrix) { … }
}
bool CBC_QRCoderMatrixUtil::BuildMatrix(
CBC_QRCoderBitVector* dataBits,
const CBC_QRCoderErrorCorrectionLevel* ecLevel,
int32_t version,
int32_t maskPattern,
CBC_CommonByteMatrix* matrix) { … }