summaryrefslogtreecommitdiff
path: root/fxbarcode/qrcode/BC_QRCoderVersion.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-06 14:23:26 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-06 23:30:04 +0000
commit8a24b25ee0b08128b28dfae0ee86b8348a51b40b (patch)
treea1dcaba3bddca1316bb9ba8fb9e2c0e0b1242301 /fxbarcode/qrcode/BC_QRCoderVersion.h
parentc758d9dd3f94c2dee89e7fdd50195af08f7e456c (diff)
downloadpdfium-8a24b25ee0b08128b28dfae0ee86b8348a51b40b.tar.xz
Clean up CBC_QRCoderVersion and friends.
Change-Id: Iff738c99fb4fe38d35515c280057b489624d734f Reviewed-on: https://pdfium-review.googlesource.com/3752 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/qrcode/BC_QRCoderVersion.h')
-rw-r--r--fxbarcode/qrcode/BC_QRCoderVersion.h38
1 files changed, 15 insertions, 23 deletions
diff --git a/fxbarcode/qrcode/BC_QRCoderVersion.h b/fxbarcode/qrcode/BC_QRCoderVersion.h
index b6dad2299d..0c9509b457 100644
--- a/fxbarcode/qrcode/BC_QRCoderVersion.h
+++ b/fxbarcode/qrcode/BC_QRCoderVersion.h
@@ -7,46 +7,38 @@
#ifndef FXBARCODE_QRCODE_BC_QRCODERVERSION_H_
#define FXBARCODE_QRCODE_BC_QRCODERVERSION_H_
+#include <memory>
#include <vector>
#include "core/fxcrt/fx_basic.h"
+#include "fxbarcode/qrcode/BC_QRCoderECBlocks.h"
-class CBC_CommonBitMatrix;
-class CBC_QRCoderECBlocks;
class CBC_QRCoderErrorCorrectionLevel;
class CBC_QRCoderVersion {
public:
+ static constexpr int32_t kMaxVersion = 40;
+
+ CBC_QRCoderVersion(int32_t versionNumber,
+ const CBC_QRCoderECBlockData data[4]);
~CBC_QRCoderVersion();
+
static void Initialize();
static void Finalize();
- static CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber);
+ static const CBC_QRCoderVersion* GetVersionForNumber(int32_t versionNumber);
static void Destroy();
- int32_t GetVersionNumber();
- int32_t GetTotalCodeWords();
- int32_t GetDimensionForVersion();
- CBC_CommonBitMatrix* BuildFunctionPattern(int32_t& e);
- std::vector<int32_t>* GetAlignmentPatternCenters();
- CBC_QRCoderECBlocks* GetECBlocksForLevel(
- CBC_QRCoderErrorCorrectionLevel* ecLevel);
+ int32_t GetVersionNumber() const;
+ int32_t GetTotalCodeWords() const;
+ int32_t GetDimensionForVersion() const;
+ const CBC_QRCoderECBlocks* GetECBlocksForLevel(
+ const CBC_QRCoderErrorCorrectionLevel& ecLevel) const;
private:
- CBC_QRCoderVersion();
- CBC_QRCoderVersion(int32_t versionNumber,
- CBC_QRCoderECBlocks* ecBlocks1,
- CBC_QRCoderECBlocks* ecBlocks2,
- CBC_QRCoderECBlocks* ecBlocks3,
- CBC_QRCoderECBlocks* ecBlocks4);
-
- static const int32_t VERSION_DECODE_INFO[34];
- static std::vector<CBC_QRCoderVersion*>* VERSION;
-
- int32_t m_versionNumber;
+ const int32_t m_versionNumber;
int32_t m_totalCodeWords;
- std::vector<int32_t> m_alignmentPatternCenters;
- std::vector<CBC_QRCoderECBlocks*> m_ecBlocksArray;
+ std::unique_ptr<CBC_QRCoderECBlocks> m_ecBlocksArray[4];
};
#endif // FXBARCODE_QRCODE_BC_QRCODERVERSION_H_