8
9
10
11
12
13
14
15
16
17
18
19
20
21
25#include "fxbarcode/common/BC_CommonByteMatrix.h"
26#include "fxbarcode/qrcode/BC_QRCoder.h"
27#include "fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h"
28#include "fxbarcode/qrcode/BC_QRCoderMode.h"
29#include "third_party/base/numerics/safe_conversions.h"
52 return m_numTotalBytes;
56 return m_numDataBytes;
64 return std::move(m_matrix);
68 return m_ecLevel && m_version != -1 && m_matrixWidth != -1 &&
69 m_maskPattern != -1 && m_numTotalBytes != -1 && m_numDataBytes != -1 &&
70 m_numECBytes != -1 && m_numRSBlocks != -1 &&
71 IsValidMaskPattern(m_maskPattern) &&
72 m_numTotalBytes == m_numDataBytes + m_numECBytes && m_matrix &&
74 pdfium::base::checked_cast<int32_t>(m_matrix->GetWidth()) &&
75 m_matrix->GetWidth() == m_matrix->GetHeight();
87 m_matrixWidth = width;
91 m_maskPattern = pattern;
95 m_numDataBytes = bytes;
99 m_numTotalBytes = value;
103 m_numRSBlocks = block;
107 m_numECBytes = value;
114void CBC_QRCoder::
SetMatrix(std::unique_ptr<CBC_CommonByteMatrix> pMatrix) {
115 m_matrix = std::move(pMatrix);
void SetMatrixWidth(int32_t width)
int32_t GetNumRSBlocks() const
void SetMatrix(std::unique_ptr< CBC_CommonByteMatrix > pMatrix)
int32_t GetNumTotalBytes() const
void SetNumECBytes(int32_t value)
void SetECLevel(const CBC_QRCoderErrorCorrectionLevel *ecLevel)
void SetNumRSBlocks(int32_t block)
const CBC_QRCoderErrorCorrectionLevel * GetECLevel() const
int32_t GetMatrixWidth() const
int32_t GetNumDataBytes() const
static constexpr int32_t kNumMaskPatterns
void SetMaskPattern(int32_t pattern)
int32_t GetMaskPattern() const
void SetNumDataBytes(int32_t bytes)
void SetNumTotalBytes(int32_t value)
static bool IsValidMaskPattern(int32_t maskPattern)
std::unique_ptr< CBC_CommonByteMatrix > TakeMatrix()
int32_t GetVersion() const
void SetVersion(int32_t version)