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_PDF417.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_PDF417_BC_PDF417_H_
8#define FXBARCODE_PDF417_BC_PDF417_H_
9
10#include <memory>
11#include <vector>
12
13#include "core/fxcrt/widestring.h"
14
15class CBC_BarcodeRow;
16class CBC_BarcodeMatrix;
17
19 public:
22
23 CBC_BarcodeMatrix* getBarcodeMatrix();
24 bool GenerateBarcodeLogic(WideStringView msg, int32_t errorCorrectionLevel);
25 void setDimensions(int32_t maxCols,
26 int32_t minCols,
27 int32_t maxRows,
28 int32_t minRows);
29
30 private:
31 static const int32_t START_PATTERN = 0x1fea8;
32 static const int32_t STOP_PATTERN = 0x3fa29;
33 static constexpr float PREFERRED_RATIO = 3.0f;
34 static constexpr float DEFAULT_MODULE_WIDTH = 0.357f;
35 static constexpr float HEIGHT = 2.0f;
36
37 static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c);
38 static int32_t getNumberOfPadCodewords(int32_t m,
39 int32_t k,
40 int32_t c,
41 int32_t r);
42 static void encodeChar(int32_t pattern, int32_t len, CBC_BarcodeRow* logic);
43 void encodeLowLevel(WideString fullCodewords,
44 int32_t c,
45 int32_t r,
46 int32_t errorCorrectionLevel,
47 CBC_BarcodeMatrix* logic);
48 std::vector<int32_t> determineDimensions(
49 size_t sourceCodeWords,
50 int32_t errorCorrectionCodeWords) const;
51
52 std::unique_ptr<CBC_BarcodeMatrix> m_barcodeMatrix;
53 int32_t m_minCols = 1;
54 int32_t m_maxCols = 30;
55 int32_t m_minRows = 3;
56 int32_t m_maxRows = 90;
57};
58
59#endif // FXBARCODE_PDF417_BC_PDF417_H_
static int32_t GetErrorCorrectionCodewordCount(int32_t errorCorrectionLevel)
void setDimensions(int32_t maxCols, int32_t minCols, int32_t maxRows, int32_t minRows)
bool GenerateBarcodeLogic(WideStringView msg, int32_t errorCorrectionLevel)
CBC_BarcodeMatrix * getBarcodeMatrix()
WideString & operator+=(wchar_t ch)
CharType operator[](const size_t index) const
Definition widestring.h:146
WideString(const WideString &other)