Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
BC_QRCoder.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef FXBARCODE_QRCODE_BC_QRCODER_H_
8#define FXBARCODE_QRCODE_BC_QRCODER_H_
9
10#include <memory>
11
12#include "core/fxcrt/unowned_ptr.h"
13
15class CBC_CommonByteMatrix;
16
17class CBC_QRCoder final {
18 public:
19 static constexpr int32_t kNumMaskPatterns = 8;
20
23
24 static bool IsValidMaskPattern(int32_t maskPattern);
25
27 int32_t GetVersion() const;
28 int32_t GetMatrixWidth() const;
29 int32_t GetMaskPattern() const;
30 int32_t GetNumTotalBytes() const;
31 int32_t GetNumDataBytes() const;
32 int32_t GetNumRSBlocks() const;
34
35 bool IsValid() const;
36
38 void SetVersion(int32_t version);
39 void SetMatrixWidth(int32_t width);
40 void SetMaskPattern(int32_t pattern);
41 void SetNumDataBytes(int32_t bytes);
42 void SetNumTotalBytes(int32_t value);
43 void SetNumECBytes(int32_t value);
44 void SetNumRSBlocks(int32_t block);
45 void SetMatrix(std::unique_ptr<CBC_CommonByteMatrix> pMatrix);
46
47 private:
49 int32_t m_version = -1;
50 int32_t m_matrixWidth = -1;
51 int32_t m_maskPattern = -1;
52 int32_t m_numTotalBytes = -1;
53 int32_t m_numDataBytes = -1;
54 int32_t m_numECBytes = -1;
55 int32_t m_numRSBlocks = -1;
56 std::unique_ptr<CBC_CommonByteMatrix> m_matrix;
57};
58
59#endif // FXBARCODE_QRCODE_BC_QRCODER_H_
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
Definition BC_QRCoder.h:19
void SetMaskPattern(int32_t pattern)
int32_t GetMaskPattern() const
void SetNumDataBytes(int32_t bytes)
bool IsValid() const
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)