From 29b8ad0b130ec6ed4f72ebd0c0a4f9e6a5b03467 Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 14 Jun 2016 18:20:04 -0700 Subject: Make code compile with clang_use_chrome_plugin (part III) This change contains files in xfa/fxbarcode directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2067903002 --- xfa/fxbarcode/BC_Binarizer.h | 1 + xfa/fxbarcode/BC_BinaryBitmap.h | 1 + xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp | 7 +- xfa/fxbarcode/BC_BufferedImageLuminanceSource.h | 8 ++- xfa/fxbarcode/BC_DecoderResult.h | 1 + xfa/fxbarcode/BC_TwoDimWriter.cpp | 4 ++ xfa/fxbarcode/BC_TwoDimWriter.h | 5 +- xfa/fxbarcode/cbc_codabar.cpp | 4 ++ xfa/fxbarcode/cbc_codabar.h | 2 +- xfa/fxbarcode/cbc_code128.cpp | 4 ++ xfa/fxbarcode/cbc_code128.h | 2 +- xfa/fxbarcode/cbc_code39.cpp | 4 ++ xfa/fxbarcode/cbc_code39.h | 2 +- xfa/fxbarcode/cbc_datamatrix.cpp | 4 ++ xfa/fxbarcode/cbc_datamatrix.h | 2 +- xfa/fxbarcode/cbc_ean13.cpp | 4 ++ xfa/fxbarcode/cbc_ean13.h | 2 +- xfa/fxbarcode/cbc_ean8.cpp | 4 ++ xfa/fxbarcode/cbc_ean8.h | 2 +- xfa/fxbarcode/cbc_pdf417i.cpp | 4 ++ xfa/fxbarcode/cbc_pdf417i.h | 2 +- xfa/fxbarcode/cbc_qrcode.cpp | 4 ++ xfa/fxbarcode/cbc_qrcode.h | 2 +- xfa/fxbarcode/cbc_upca.cpp | 4 ++ xfa/fxbarcode/cbc_upca.h | 4 +- xfa/fxbarcode/common/BC_CommonBitArray.h | 5 +- xfa/fxbarcode/common/BC_CommonBitMatrix.h | 6 +- xfa/fxbarcode/common/BC_CommonBitSource.h | 3 +- xfa/fxbarcode/common/BC_CommonByteArray.h | 13 ++-- xfa/fxbarcode/common/BC_CommonByteMatrix.h | 1 + xfa/fxbarcode/common/BC_CommonCharacterSetECI.h | 4 +- xfa/fxbarcode/common/BC_CommonDecoderResult.h | 1 + xfa/fxbarcode/common/BC_CommonECI.h | 3 +- .../common/BC_CommonPerspectiveTransform.h | 1 + xfa/fxbarcode/common/BC_GlobalHistogramBinarizer.h | 9 ++- xfa/fxbarcode/common/BC_WhiteRectangleDetector.h | 5 +- xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h | 8 ++- xfa/fxbarcode/datamatrix/BC_Base256Encoder.h | 8 ++- xfa/fxbarcode/datamatrix/BC_C40Encoder.h | 10 ++- .../datamatrix/BC_DataMatrixBitMatrixParser.h | 1 + .../BC_DataMatrixDecodedBitStreamParser.h | 3 + xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.h | 2 + xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp | 8 +++ xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.h | 11 ++- xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp | 1 + xfa/fxbarcode/datamatrix/BC_DataMatrixReader.h | 10 ++- .../datamatrix/BC_DataMatrixSymbolInfo144.h | 4 +- xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp | 19 ++++++ xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h | 21 ++---- xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h | 15 +++-- xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h | 8 ++- xfa/fxbarcode/datamatrix/BC_Encoder.h | 2 + xfa/fxbarcode/datamatrix/BC_EncoderContext.h | 3 +- xfa/fxbarcode/datamatrix/BC_ErrorCorrection.h | 2 + xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h | 3 +- xfa/fxbarcode/datamatrix/BC_SymbolInfo.h | 3 +- xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h | 1 + xfa/fxbarcode/datamatrix/BC_TextEncoder.h | 9 ++- xfa/fxbarcode/datamatrix/BC_X12Encoder.h | 12 ++-- xfa/fxbarcode/oned/BC_OneDReader.cpp | 6 ++ xfa/fxbarcode/oned/BC_OneDReader.h | 17 ++--- xfa/fxbarcode/oned/BC_OneDimReader.h | 20 +++--- xfa/fxbarcode/oned/BC_OneDimWriter.cpp | 24 +++++++ xfa/fxbarcode/oned/BC_OneDimWriter.h | 67 +++++++++---------- xfa/fxbarcode/oned/BC_OnedCodaBarReader.h | 7 +- xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h | 31 ++++----- xfa/fxbarcode/oned/BC_OnedCode128Reader.h | 12 ++-- xfa/fxbarcode/oned/BC_OnedCode128Writer.h | 15 +++-- xfa/fxbarcode/oned/BC_OnedCode39Reader.h | 5 +- xfa/fxbarcode/oned/BC_OnedCode39Writer.h | 34 +++++----- xfa/fxbarcode/oned/BC_OnedEAN13Reader.h | 16 ++--- xfa/fxbarcode/oned/BC_OnedEAN13Writer.h | 19 +++--- xfa/fxbarcode/oned/BC_OnedEAN8Reader.h | 4 +- xfa/fxbarcode/oned/BC_OnedEAN8Writer.h | 26 ++++---- xfa/fxbarcode/oned/BC_OnedUPCAReader.h | 17 +++-- xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 6 ++ xfa/fxbarcode/oned/BC_OnedUPCAWriter.h | 19 +++--- xfa/fxbarcode/pdf417/BC_PDF417.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417Codeword.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417Common.h | 1 + .../pdf417/BC_PDF417DecodedBitStreamParser.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.h | 1 + .../BC_PDF417DetectionResultRowIndicatorColumn.h | 3 +- xfa/fxbarcode/pdf417/BC_PDF417Detector.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417Dimensions.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417ECModulusGF.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417Reader.h | 11 ++- xfa/fxbarcode/pdf417/BC_PDF417ResultMetadata.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h | 1 + xfa/fxbarcode/pdf417/BC_PDF417Writer.h | 8 ++- xfa/fxbarcode/qrcode/BC_QRAlignmentPattern.h | 10 ++- xfa/fxbarcode/qrcode/BC_QRCodeReader.h | 11 ++- xfa/fxbarcode/qrcode/BC_QRCodeWriter.h | 8 ++- xfa/fxbarcode/qrcode/BC_QRDataMask.cpp | 78 +++++++++++++++++----- xfa/fxbarcode/qrcode/BC_QRFinderPattern.h | 8 ++- 102 files changed, 524 insertions(+), 273 deletions(-) (limited to 'xfa') diff --git a/xfa/fxbarcode/BC_Binarizer.h b/xfa/fxbarcode/BC_Binarizer.h index 20be039211..8482c24f63 100644 --- a/xfa/fxbarcode/BC_Binarizer.h +++ b/xfa/fxbarcode/BC_Binarizer.h @@ -17,6 +17,7 @@ class CBC_Binarizer { public: CBC_Binarizer(CBC_LuminanceSource* source); virtual ~CBC_Binarizer(); + CBC_LuminanceSource* GetLuminanceSource(); virtual CBC_CommonBitMatrix* GetBlackMatrix(int32_t& e) = 0; virtual CBC_CommonBitArray* GetBlackRow(int32_t y, diff --git a/xfa/fxbarcode/BC_BinaryBitmap.h b/xfa/fxbarcode/BC_BinaryBitmap.h index 5f4dd874a9..445b5af32b 100644 --- a/xfa/fxbarcode/BC_BinaryBitmap.h +++ b/xfa/fxbarcode/BC_BinaryBitmap.h @@ -17,6 +17,7 @@ class CBC_BinaryBitmap { public: CBC_BinaryBitmap(CBC_Binarizer* binarizer); virtual ~CBC_BinaryBitmap(); + int32_t GetWidth(); int32_t GetHeight(); CBC_CommonBitMatrix* GetMatrix(int32_t& e); diff --git a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp index f822349972..7cdf957ce0 100644 --- a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp +++ b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp @@ -30,7 +30,8 @@ class CBC_Pause : public IFX_Pause { public: - virtual FX_BOOL NeedToPauseNow() { return TRUE; } + // IFX_Pause + FX_BOOL NeedToPauseNow() override; }; static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread) { @@ -154,3 +155,7 @@ CFX_ByteArray* CBC_BufferedImageLuminanceSource::GetMatrix() { } return matrix; } + +FX_BOOL CBC_Pause::NeedToPauseNow() { + return TRUE; +} diff --git a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.h b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.h index ca3aafb27d..da3682662d 100644 --- a/xfa/fxbarcode/BC_BufferedImageLuminanceSource.h +++ b/xfa/fxbarcode/BC_BufferedImageLuminanceSource.h @@ -16,10 +16,12 @@ class CBC_BufferedImageLuminanceSource : public CBC_LuminanceSource { public: explicit CBC_BufferedImageLuminanceSource(const CFX_WideString& filename); explicit CBC_BufferedImageLuminanceSource(CFX_DIBitmap* pBitmap); - virtual ~CBC_BufferedImageLuminanceSource(); + ~CBC_BufferedImageLuminanceSource() override; + + // CBC_LuminanceSource + CFX_ByteArray* GetRow(int32_t y, CFX_ByteArray& row, int32_t& e) override; + CFX_ByteArray* GetMatrix() override; - CFX_ByteArray* GetRow(int32_t y, CFX_ByteArray& row, int32_t& e); - CFX_ByteArray* GetMatrix(); virtual void Init(int32_t& e); private: diff --git a/xfa/fxbarcode/BC_DecoderResult.h b/xfa/fxbarcode/BC_DecoderResult.h index 81d7856633..e4170c8955 100644 --- a/xfa/fxbarcode/BC_DecoderResult.h +++ b/xfa/fxbarcode/BC_DecoderResult.h @@ -15,6 +15,7 @@ class CBC_DecoderResult { CFX_ByteString text, CFX_ByteString ecLevel); virtual ~CBC_DecoderResult(); + CFX_ByteArray* getRawBytes(); CFX_ByteString getText(); CFX_ByteString getECLevel(); diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp index fdad7e2a81..40b5519750 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp @@ -54,6 +54,10 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, } } +int32_t CBC_TwoDimWriter::GetErrorCorrectionLevel() { + return m_iCorrectLevel; +} + void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, int32_t& e) { if (m_bFixedSize) { diff --git a/xfa/fxbarcode/BC_TwoDimWriter.h b/xfa/fxbarcode/BC_TwoDimWriter.h index 625680413d..da2e6d9c4d 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.h +++ b/xfa/fxbarcode/BC_TwoDimWriter.h @@ -15,7 +15,8 @@ class CFX_RenderDevice; class CBC_TwoDimWriter : public CBC_Writer { public: CBC_TwoDimWriter(); - virtual ~CBC_TwoDimWriter(); + ~CBC_TwoDimWriter() override; + virtual void RenderResult(uint8_t* code, int32_t codeWidth, int32_t codeHeight, @@ -24,7 +25,7 @@ class CBC_TwoDimWriter : public CBC_Writer { virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix); virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0; - virtual int32_t GetErrorCorrectionLevel() { return m_iCorrectLevel; } + virtual int32_t GetErrorCorrectionLevel(); protected: int32_t m_iCorrectLevel; diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp index 4ed63ba7e2..c2fe2a4a16 100644 --- a/xfa/fxbarcode/cbc_codabar.cpp +++ b/xfa/fxbarcode/cbc_codabar.cpp @@ -105,6 +105,10 @@ FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_Codabar::GetType() { + return BC_CODABAR; +} + CFX_WideString CBC_Codabar::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_codabar.h b/xfa/fxbarcode/cbc_codabar.h index 9684b584a1..a0eb07f74b 100644 --- a/xfa/fxbarcode/cbc_codabar.h +++ b/xfa/fxbarcode/cbc_codabar.h @@ -30,7 +30,7 @@ class CBC_Codabar : public CBC_OneCode { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_CODABAR; } + BC_TYPE GetType() override; FX_BOOL SetStartChar(FX_CHAR start); FX_BOOL SetEndChar(FX_CHAR end); diff --git a/xfa/fxbarcode/cbc_code128.cpp b/xfa/fxbarcode/cbc_code128.cpp index c3614bee90..abae7a3594 100644 --- a/xfa/fxbarcode/cbc_code128.cpp +++ b/xfa/fxbarcode/cbc_code128.cpp @@ -86,6 +86,10 @@ FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_Code128::GetType() { + return BC_CODE128; +} + CFX_WideString CBC_Code128::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_code128.h b/xfa/fxbarcode/cbc_code128.h index c5aa8e19b1..ddb779daa9 100644 --- a/xfa/fxbarcode/cbc_code128.h +++ b/xfa/fxbarcode/cbc_code128.h @@ -30,7 +30,7 @@ class CBC_Code128 : public CBC_OneCode { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_CODE128; } + BC_TYPE GetType() override; FX_BOOL SetTextLocation(BC_TEXT_LOC loction); diff --git a/xfa/fxbarcode/cbc_code39.cpp b/xfa/fxbarcode/cbc_code39.cpp index 03e618e188..2b9852a074 100644 --- a/xfa/fxbarcode/cbc_code39.cpp +++ b/xfa/fxbarcode/cbc_code39.cpp @@ -90,6 +90,10 @@ FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_Code39::GetType() { + return BC_CODE39; +} + CFX_WideString CBC_Code39::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_code39.h b/xfa/fxbarcode/cbc_code39.h index d6dad7df31..673975ba91 100644 --- a/xfa/fxbarcode/cbc_code39.h +++ b/xfa/fxbarcode/cbc_code39.h @@ -32,7 +32,7 @@ class CBC_Code39 : public CBC_OneCode { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_CODE39; } + BC_TYPE GetType() override; FX_BOOL SetTextLocation(BC_TEXT_LOC location); FX_BOOL SetWideNarrowRatio(int32_t ratio); diff --git a/xfa/fxbarcode/cbc_datamatrix.cpp b/xfa/fxbarcode/cbc_datamatrix.cpp index 08b76830fd..5e37b54253 100644 --- a/xfa/fxbarcode/cbc_datamatrix.cpp +++ b/xfa/fxbarcode/cbc_datamatrix.cpp @@ -65,6 +65,10 @@ FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_DataMatrix::GetType() { + return BC_DATAMATRIX; +} + CFX_WideString CBC_DataMatrix::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_datamatrix.h b/xfa/fxbarcode/cbc_datamatrix.h index 7cd487567d..392fa55b4b 100644 --- a/xfa/fxbarcode/cbc_datamatrix.h +++ b/xfa/fxbarcode/cbc_datamatrix.h @@ -30,7 +30,7 @@ class CBC_DataMatrix : public CBC_CodeBase { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_DATAMATRIX; } + BC_TYPE GetType() override; }; #endif // XFA_FXBARCODE_CBC_DATAMATRIX_H_ diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp index 589af5b090..0725083a1d 100644 --- a/xfa/fxbarcode/cbc_ean13.cpp +++ b/xfa/fxbarcode/cbc_ean13.cpp @@ -92,6 +92,10 @@ FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_EAN13::GetType() { + return BC_EAN13; +} + CFX_WideString CBC_EAN13::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_ean13.h b/xfa/fxbarcode/cbc_ean13.h index 93abab27ff..afe2cd9781 100644 --- a/xfa/fxbarcode/cbc_ean13.h +++ b/xfa/fxbarcode/cbc_ean13.h @@ -30,7 +30,7 @@ class CBC_EAN13 : public CBC_OneCode { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_EAN13; } + BC_TYPE GetType() override; private: CFX_WideString Preprocess(const CFX_WideStringC& contents); diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp index 3f32d2274c..7280c3770e 100644 --- a/xfa/fxbarcode/cbc_ean8.cpp +++ b/xfa/fxbarcode/cbc_ean8.cpp @@ -91,6 +91,10 @@ FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_EAN8::GetType() { + return BC_EAN8; +} + CFX_WideString CBC_EAN8::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_ean8.h b/xfa/fxbarcode/cbc_ean8.h index d9cd0574da..dd948904fe 100644 --- a/xfa/fxbarcode/cbc_ean8.h +++ b/xfa/fxbarcode/cbc_ean8.h @@ -30,7 +30,7 @@ class CBC_EAN8 : public CBC_OneCode { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_EAN8; } + BC_TYPE GetType() override; private: CFX_WideString Preprocess(const CFX_WideStringC& contents); diff --git a/xfa/fxbarcode/cbc_pdf417i.cpp b/xfa/fxbarcode/cbc_pdf417i.cpp index 514cc01415..005be943fe 100644 --- a/xfa/fxbarcode/cbc_pdf417i.cpp +++ b/xfa/fxbarcode/cbc_pdf417i.cpp @@ -73,6 +73,10 @@ FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_PDF417I::GetType() { + return BC_PDF417; +} + CFX_WideString CBC_PDF417I::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_pdf417i.h b/xfa/fxbarcode/cbc_pdf417i.h index 0658ff7a53..4fdf2f0e14 100644 --- a/xfa/fxbarcode/cbc_pdf417i.h +++ b/xfa/fxbarcode/cbc_pdf417i.h @@ -30,7 +30,7 @@ class CBC_PDF417I : public CBC_CodeBase { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_PDF417; } + BC_TYPE GetType() override; FX_BOOL SetErrorCorrectionLevel(int32_t level); void SetTruncated(FX_BOOL truncated); diff --git a/xfa/fxbarcode/cbc_qrcode.cpp b/xfa/fxbarcode/cbc_qrcode.cpp index 9ea20a6820..1e0703caab 100644 --- a/xfa/fxbarcode/cbc_qrcode.cpp +++ b/xfa/fxbarcode/cbc_qrcode.cpp @@ -81,6 +81,10 @@ FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) { return TRUE; } +BC_TYPE CBC_QRCode::GetType() { + return BC_QR_CODE; +} + CFX_WideString CBC_QRCode::Decode(uint8_t* buf, int32_t width, int32_t height, diff --git a/xfa/fxbarcode/cbc_qrcode.h b/xfa/fxbarcode/cbc_qrcode.h index 4038164643..d14d872312 100644 --- a/xfa/fxbarcode/cbc_qrcode.h +++ b/xfa/fxbarcode/cbc_qrcode.h @@ -30,7 +30,7 @@ class CBC_QRCode : public CBC_CodeBase { const CFX_Matrix* matrix, int32_t& e) override; FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_QR_CODE; } + BC_TYPE GetType() override; FX_BOOL SetVersion(int32_t version); FX_BOOL SetErrorCorrectionLevel(int32_t level); diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp index 525612257a..ad0ec55003 100644 --- a/xfa/fxbarcode/cbc_upca.cpp +++ b/xfa/fxbarcode/cbc_upca.cpp @@ -113,3 +113,7 @@ CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap* pBitmap, int32_t& e) { BC_EXCEPTION_CHECK_ReturnValue(e, L""); return CFX_WideString::FromUTF8(str.AsStringC()); } + +BC_TYPE CBC_UPCA::GetType() { + return BC_UPCA; +} diff --git a/xfa/fxbarcode/cbc_upca.h b/xfa/fxbarcode/cbc_upca.h index a2e0658f39..cf45b89786 100644 --- a/xfa/fxbarcode/cbc_upca.h +++ b/xfa/fxbarcode/cbc_upca.h @@ -17,7 +17,7 @@ class CBC_UPCA : public CBC_OneCode { CBC_UPCA(); ~CBC_UPCA() override; - // CBC_OneCode: + // CBC_CodeBase FX_BOOL Encode(const CFX_WideStringC& contents, FX_BOOL isDevice, int32_t& e) override; @@ -30,7 +30,7 @@ class CBC_UPCA : public CBC_OneCode { int32_t height, int32_t& e) override; CFX_WideString Decode(CFX_DIBitmap* pBitmap, int32_t& e) override; - BC_TYPE GetType() override { return BC_UPCA; } + BC_TYPE GetType() override; private: CFX_WideString Preprocess(const CFX_WideStringC& contents); diff --git a/xfa/fxbarcode/common/BC_CommonBitArray.h b/xfa/fxbarcode/common/BC_CommonBitArray.h index 1c89500138..04cb96b752 100644 --- a/xfa/fxbarcode/common/BC_CommonBitArray.h +++ b/xfa/fxbarcode/common/BC_CommonBitArray.h @@ -11,10 +11,11 @@ class CBC_CommonBitArray { public: - CBC_CommonBitArray(CBC_CommonBitArray* array); - CBC_CommonBitArray(int32_t size); + explicit CBC_CommonBitArray(CBC_CommonBitArray* array); + explicit CBC_CommonBitArray(int32_t size); CBC_CommonBitArray(); virtual ~CBC_CommonBitArray(); + int32_t GetSize(); CFX_Int32Array& GetBits(); int32_t GetSizeInBytes(); diff --git a/xfa/fxbarcode/common/BC_CommonBitMatrix.h b/xfa/fxbarcode/common/BC_CommonBitMatrix.h index ebf7454dca..48a26b9f8c 100644 --- a/xfa/fxbarcode/common/BC_CommonBitMatrix.h +++ b/xfa/fxbarcode/common/BC_CommonBitMatrix.h @@ -15,6 +15,10 @@ class CBC_CommonBitMatrix { public: CBC_CommonBitMatrix(); virtual ~CBC_CommonBitMatrix(); + + virtual void Init(int32_t dimension); + virtual void Init(int32_t width, int32_t height); + FX_BOOL Get(int32_t x, int32_t y); void Set(int32_t x, int32_t y); void Flip(int32_t x, int32_t y); @@ -32,8 +36,6 @@ class CBC_CommonBitMatrix { int32_t GetHeight(); int32_t GetRowSize(); int32_t GetDimension(int32_t& e); - virtual void Init(int32_t dimension); - virtual void Init(int32_t width, int32_t height); int32_t* GetBits(); private: diff --git a/xfa/fxbarcode/common/BC_CommonBitSource.h b/xfa/fxbarcode/common/BC_CommonBitSource.h index f33e077c68..7c6736cba3 100644 --- a/xfa/fxbarcode/common/BC_CommonBitSource.h +++ b/xfa/fxbarcode/common/BC_CommonBitSource.h @@ -13,7 +13,8 @@ class CBC_CommonBitSource { public: CBC_CommonBitSource(CFX_ByteArray* bytes); - virtual ~CBC_CommonBitSource(); + ~CBC_CommonBitSource(); + int32_t ReadBits(int32_t numBits, int32_t& e); int32_t Available(); int32_t getByteOffset(); diff --git a/xfa/fxbarcode/common/BC_CommonByteArray.h b/xfa/fxbarcode/common/BC_CommonByteArray.h index eaf68d9f41..2570f81c0f 100644 --- a/xfa/fxbarcode/common/BC_CommonByteArray.h +++ b/xfa/fxbarcode/common/BC_CommonByteArray.h @@ -10,16 +10,12 @@ #include "core/fxcrt/include/fx_basic.h" class CBC_CommonByteArray { - private: - int32_t m_size; - int32_t m_index; - uint8_t* m_bytes; - public: CBC_CommonByteArray(); - CBC_CommonByteArray(int32_t size); + explicit CBC_CommonByteArray(int32_t size); CBC_CommonByteArray(uint8_t* byteArray, int32_t size); virtual ~CBC_CommonByteArray(); + int32_t At(int32_t index); void Set(int32_t index, int32_t value); int32_t Size(); @@ -28,6 +24,11 @@ class CBC_CommonByteArray { void Reserve(int32_t capacity); void Set(uint8_t* source, int32_t offset, int32_t count); void Set(CFX_ByteArray* source, int32_t offset, int32_t count); + + private: + int32_t m_size; + int32_t m_index; + uint8_t* m_bytes; }; #endif // XFA_FXBARCODE_COMMON_BC_COMMONBYTEARRAY_H_ diff --git a/xfa/fxbarcode/common/BC_CommonByteMatrix.h b/xfa/fxbarcode/common/BC_CommonByteMatrix.h index 74e1203481..9bc2a88e8a 100644 --- a/xfa/fxbarcode/common/BC_CommonByteMatrix.h +++ b/xfa/fxbarcode/common/BC_CommonByteMatrix.h @@ -15,6 +15,7 @@ class CBC_CommonByteMatrix { public: CBC_CommonByteMatrix(int32_t width, int32_t height); virtual ~CBC_CommonByteMatrix(); + int32_t GetHeight(); int32_t GetWidth(); uint8_t Get(int32_t x, int32_t y); diff --git a/xfa/fxbarcode/common/BC_CommonCharacterSetECI.h b/xfa/fxbarcode/common/BC_CommonCharacterSetECI.h index 5bd77e4fd1..a2fe0ed2fe 100644 --- a/xfa/fxbarcode/common/BC_CommonCharacterSetECI.h +++ b/xfa/fxbarcode/common/BC_CommonCharacterSetECI.h @@ -13,10 +13,10 @@ class CBC_CommonCharacterSetECI : public CBC_CommonECI { public: CBC_CommonCharacterSetECI(int32_t value, CFX_ByteString encodingName); - virtual ~CBC_CommonCharacterSetECI(); + ~CBC_CommonCharacterSetECI() override; + CFX_ByteString GetEncodingName(); static void AddCharacterSet(int32_t value, CFX_ByteString encodingName); - int32_t GetValue(); static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(int32_t value); static CBC_CommonCharacterSetECI* GetCharacterSetECIByName( const CFX_ByteString& name); diff --git a/xfa/fxbarcode/common/BC_CommonDecoderResult.h b/xfa/fxbarcode/common/BC_CommonDecoderResult.h index cec7431119..bcb65df9fa 100644 --- a/xfa/fxbarcode/common/BC_CommonDecoderResult.h +++ b/xfa/fxbarcode/common/BC_CommonDecoderResult.h @@ -16,6 +16,7 @@ class CBC_CommonDecoderResult { public: CBC_CommonDecoderResult(); virtual ~CBC_CommonDecoderResult(); + const CFX_ByteArray& GetRawBytes(); const CFX_ByteString& GetText(); const CFX_Int32Array& GetByteSegments(); diff --git a/xfa/fxbarcode/common/BC_CommonECI.h b/xfa/fxbarcode/common/BC_CommonECI.h index 20b3e76bb3..5bc4c1485c 100644 --- a/xfa/fxbarcode/common/BC_CommonECI.h +++ b/xfa/fxbarcode/common/BC_CommonECI.h @@ -14,7 +14,8 @@ class CBC_CommonECI { CBC_CommonECI(int32_t value); virtual ~CBC_CommonECI(); - int32_t GetValue(); + virtual int32_t GetValue(); + static CBC_CommonECI* GetEICByValue(int32_t value, int32_t& e); private: diff --git a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h b/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h index d701b7ec34..8a5fd26f22 100644 --- a/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h +++ b/xfa/fxbarcode/common/BC_CommonPerspectiveTransform.h @@ -21,6 +21,7 @@ class CBC_CommonPerspectiveTransform { FX_FLOAT a23, FX_FLOAT a33); virtual ~CBC_CommonPerspectiveTransform(); + static CBC_CommonPerspectiveTransform* QuadrilateralToQuadrilateral( FX_FLOAT x0, FX_FLOAT y0, diff --git a/xfa/fxbarcode/common/BC_GlobalHistogramBinarizer.h b/xfa/fxbarcode/common/BC_GlobalHistogramBinarizer.h index 01ac9a6c2a..786e8e0a53 100644 --- a/xfa/fxbarcode/common/BC_GlobalHistogramBinarizer.h +++ b/xfa/fxbarcode/common/BC_GlobalHistogramBinarizer.h @@ -17,13 +17,16 @@ class CBC_LuminanceSource; class CBC_GlobalHistogramBinarizer : public CBC_Binarizer { public: CBC_GlobalHistogramBinarizer(CBC_LuminanceSource* source); - virtual ~CBC_GlobalHistogramBinarizer(); + ~CBC_GlobalHistogramBinarizer() override; void InitArrays(int32_t luminanceSize); - CBC_CommonBitMatrix* GetBlackMatrix(int32_t& e); + + // CBC_Binarizer + CBC_CommonBitMatrix* GetBlackMatrix(int32_t& e) override; CBC_CommonBitArray* GetBlackRow(int32_t y, CBC_CommonBitArray* row, - int32_t& e); + int32_t& e) override; + static int32_t EstimateBlackPoint(CFX_Int32Array& buckets, int32_t& e); private: diff --git a/xfa/fxbarcode/common/BC_WhiteRectangleDetector.h b/xfa/fxbarcode/common/BC_WhiteRectangleDetector.h index f3ac77a9c0..427d7b85ca 100644 --- a/xfa/fxbarcode/common/BC_WhiteRectangleDetector.h +++ b/xfa/fxbarcode/common/BC_WhiteRectangleDetector.h @@ -14,18 +14,19 @@ class CBC_ResultPoint; class CBC_WhiteRectangleDetector { public: - CBC_WhiteRectangleDetector(CBC_CommonBitMatrix* image); + explicit CBC_WhiteRectangleDetector(CBC_CommonBitMatrix* image); CBC_WhiteRectangleDetector(CBC_CommonBitMatrix* image, int32_t initSize, int32_t x, int32_t y); virtual ~CBC_WhiteRectangleDetector(); + virtual void Init(int32_t& e); CFX_ArrayTemplate* Detect(int32_t& e); private: - int32_t Round(float d); + int32_t Round(FX_FLOAT d); CBC_ResultPoint* GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, diff --git a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h index 11be5e046a..40559b532d 100644 --- a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h @@ -14,9 +14,11 @@ class CBC_EncoderContext; class CBC_ASCIIEncoder : public CBC_Encoder { public: CBC_ASCIIEncoder(); - virtual ~CBC_ASCIIEncoder(); - int32_t getEncodingMode(); - void Encode(CBC_EncoderContext& context, int32_t& e); + ~CBC_ASCIIEncoder() override; + + // CBC_Encoder + int32_t getEncodingMode() override; + void Encode(CBC_EncoderContext& context, int32_t& e) override; private: static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, diff --git a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h index 64dbdc7ba4..c41c79db08 100644 --- a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h +++ b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h @@ -12,9 +12,11 @@ class CBC_Base256Encoder : public CBC_Encoder { public: CBC_Base256Encoder(); - virtual ~CBC_Base256Encoder(); - int32_t getEncodingMode(); - void Encode(CBC_EncoderContext& context, int32_t& e); + ~CBC_Base256Encoder() override; + + // CBC_Encoder + int32_t getEncodingMode() override; + void Encode(CBC_EncoderContext& context, int32_t& e) override; private: static FX_WCHAR randomize255State(FX_WCHAR ch, int32_t codewordPosition); diff --git a/xfa/fxbarcode/datamatrix/BC_C40Encoder.h b/xfa/fxbarcode/datamatrix/BC_C40Encoder.h index 9dcb1e5c5f..9737981f75 100644 --- a/xfa/fxbarcode/datamatrix/BC_C40Encoder.h +++ b/xfa/fxbarcode/datamatrix/BC_C40Encoder.h @@ -12,11 +12,15 @@ class CBC_C40Encoder : public CBC_Encoder { public: CBC_C40Encoder(); - virtual ~CBC_C40Encoder(); - virtual int32_t getEncodingMode(); - virtual void Encode(CBC_EncoderContext& context, int32_t& e); + ~CBC_C40Encoder() override; + + // CBC_Encoder + int32_t getEncodingMode() override; + void Encode(CBC_EncoderContext& context, int32_t& e) override; + static void writeNextTriplet(CBC_EncoderContext& context, CFX_WideString& buffer); + virtual void handleEOD(CBC_EncoderContext& context, CFX_WideString& buffer, int32_t& e); diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h index c8fc3346f1..63540041e3 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h @@ -16,6 +16,7 @@ class CBC_DataMatrixBitMatrixParser { public: CBC_DataMatrixBitMatrixParser(); virtual ~CBC_DataMatrixBitMatrixParser(); + CBC_DataMatrixVersion* GetVersion(); CFX_ByteArray* ReadCodewords(int32_t& e); FX_BOOL ReadModule(int32_t row, diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h index 415e27b166..4ff6776826 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h @@ -6,12 +6,15 @@ #ifndef XFA_FXBARCODE_DATAMATRIX_BC_DATAMATRIXDECODEDBITSTREAMPARSER_H_ #define XFA_FXBARCODE_DATAMATRIX_BC_DATAMATRIXDECODEDBITSTREAMPARSER_H_ + class CBC_CommonDecoderResult; class CBC_CommonBitSource; + class CBC_DataMatrixDecodedBitStreamParser { public: CBC_DataMatrixDecodedBitStreamParser(); virtual ~CBC_DataMatrixDecodedBitStreamParser(); + static CBC_CommonDecoderResult* Decode(CFX_ByteArray& bytes, int32_t& e); private: diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.h index c7af613f6d..38d3fe5bf7 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.h @@ -17,7 +17,9 @@ class CBC_DataMatrixDecoder { public: CBC_DataMatrixDecoder(); virtual ~CBC_DataMatrixDecoder(); + CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, int32_t& e); + virtual void Init(); private: diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp index a4ca4e228c..d34515310e 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp @@ -405,3 +405,11 @@ void CBC_DataMatrixDetector::OrderBestPatterns( (*patterns)[1] = topLeft; (*patterns)[2] = topRight; } + +CBC_ResultPointsAndTransitions::CBC_ResultPointsAndTransitions( + CBC_ResultPoint* from, + CBC_ResultPoint* to, + int32_t transitions) + : m_from(from), m_to(to), m_transitions(transitions) {} + +CBC_ResultPointsAndTransitions::~CBC_ResultPointsAndTransitions() {} diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.h index 8ef053b334..d06b051554 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixDetector.h @@ -19,12 +19,9 @@ class CBC_ResultPointsAndTransitions { public: CBC_ResultPointsAndTransitions(CBC_ResultPoint* from, CBC_ResultPoint* to, - int32_t transitions) { - m_from = from; - m_to = to; - m_transitions = transitions; - } - ~CBC_ResultPointsAndTransitions() {} + int32_t transitions); + ~CBC_ResultPointsAndTransitions(); + CBC_ResultPoint* GetFrom() const { return m_from; } CBC_ResultPoint* GetTo() const { return m_to; } int32_t GetTransitions() const { return m_transitions; } @@ -39,6 +36,7 @@ class CBC_DataMatrixDetector { public: CBC_DataMatrixDetector(CBC_CommonBitMatrix* image); virtual ~CBC_DataMatrixDetector(); + CBC_QRDetectorResult* Detect(int32_t& e); CBC_ResultPoint* CorrectTopRightRectangular(CBC_ResultPoint* bottomLeft, CBC_ResultPoint* bottomRight, @@ -67,6 +65,7 @@ class CBC_DataMatrixDetector { CBC_ResultPoint* key); int32_t Round(FX_FLOAT d); void OrderBestPatterns(CFX_ArrayTemplate* patterns); + virtual void Init(int32_t& e); private: diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp index 31d95b0cb7..7c1ba96a46 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.cpp @@ -57,6 +57,7 @@ CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap* image, BC_EXCEPTION_CHECK_ReturnValue(e, ""); return decodeResult->GetText(); } + CFX_ByteString CBC_DataMatrixReader::Decode(CBC_BinaryBitmap* image, int32_t& e) { CFX_ByteString bs = Decode(image, 0, e); diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.h index 21fc54eeb5..c7a0995dcb 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixReader.h @@ -15,9 +15,13 @@ class CBC_DataMatrixDecoder; class CBC_DataMatrixReader : public CBC_Reader { public: CBC_DataMatrixReader(); - virtual ~CBC_DataMatrixReader(); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int hints, int32_t& e); + ~CBC_DataMatrixReader() override; + + // CBC_Reader + CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, + int hints, + int32_t& e) override; virtual void Init(); diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h index 4d6cdc1291..2cd0cd0e6f 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h @@ -12,9 +12,9 @@ class CBC_DataMatrixSymbolInfo144 : public CBC_SymbolInfo { public: CBC_DataMatrixSymbolInfo144(); - virtual ~CBC_DataMatrixSymbolInfo144(); + ~CBC_DataMatrixSymbolInfo144() override; + int32_t getInterleavedBlockCount(); - int32_t getDataLengthForInterleavedBlock(int32_t index); }; #endif // XFA_FXBARCODE_DATAMATRIX_BC_DATAMATRIXSYMBOLINFO144_H_ diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp index d1dcc23e7b..29fb792ced 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp @@ -170,3 +170,22 @@ CBC_DataMatrixVersion* CBC_DataMatrixVersion::GetVersionForDimensions( e = BCExceptionNotFound; return nullptr; } + +ECB::ECB(int32_t count, int32_t dataCodewords) + : m_count(count), m_dataCodewords(dataCodewords) {} + +ECBlocks::ECBlocks(int32_t ecCodewords, ECB* ecBlocks) + : m_ecCodewords(ecCodewords) { + m_ecBlocksArray.Add(ecBlocks); +} + +ECBlocks::ECBlocks(int32_t ecCodewords, ECB* ecBlocks1, ECB* ecBlocks2) + : m_ecCodewords(ecCodewords) { + m_ecBlocksArray.Add(ecBlocks1); + m_ecBlocksArray.Add(ecBlocks2); +} + +ECBlocks::~ECBlocks() { + for (int32_t i = 0; i < m_ecBlocksArray.GetSize(); i++) + delete m_ecBlocksArray[i]; +} diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h index b4585d20bc..9bbf7f7b72 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixVersion.h @@ -13,8 +13,7 @@ class CBC_DataMatrixVersion; class ECB { public: - ECB(int32_t count, int32_t dataCodewords) - : m_count(count), m_dataCodewords(dataCodewords) {} + ECB(int32_t count, int32_t dataCodewords); int32_t GetCount() const { return m_count; } int32_t GetDataCodewords() const { return m_dataCodewords; } @@ -26,20 +25,9 @@ class ECB { class ECBlocks { public: - ECBlocks(int32_t ecCodewords, ECB* ecBlocks) : m_ecCodewords(ecCodewords) { - m_ecBlocksArray.Add(ecBlocks); - } - - ECBlocks(int32_t ecCodewords, ECB* ecBlocks1, ECB* ecBlocks2) - : m_ecCodewords(ecCodewords) { - m_ecBlocksArray.Add(ecBlocks1); - m_ecBlocksArray.Add(ecBlocks2); - } - - ~ECBlocks() { - for (int32_t i = 0; i < m_ecBlocksArray.GetSize(); i++) - delete m_ecBlocksArray[i]; - } + ECBlocks(int32_t ecCodewords, ECB* ecBlocks); + ECBlocks(int32_t ecCodewords, ECB* ecBlocks1, ECB* ecBlocks2); + ~ECBlocks(); int32_t GetECCodewords() { return m_ecCodewords; } const CFX_ArrayTemplate& GetECBlocks() { return m_ecBlocksArray; } @@ -58,6 +46,7 @@ class CBC_DataMatrixVersion { int32_t dataRegionSizeColumns, ECBlocks* ecBlocks); virtual ~CBC_DataMatrixVersion(); + static void Initialize(); static void Finalize(); int32_t GetVersionNumber(); diff --git a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h index 7c19a07c19..1196e46352 100644 --- a/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h +++ b/xfa/fxbarcode/datamatrix/BC_DataMatrixWriter.h @@ -16,12 +16,15 @@ class CBC_SymbolInfo; class CBC_DataMatrixWriter : public CBC_TwoDimWriter { public: CBC_DataMatrixWriter(); - virtual ~CBC_DataMatrixWriter(); - uint8_t* Encode(const CFX_WideString& contents, - int32_t& outWidth, - int32_t& outHeight, - int32_t& e); - FX_BOOL SetErrorCorrectionLevel(int32_t level); + ~CBC_DataMatrixWriter() override; + + virtual uint8_t* Encode(const CFX_WideString& contents, + int32_t& outWidth, + int32_t& outHeight, + int32_t& e); + + // CBC_TwoDimWriter + FX_BOOL SetErrorCorrectionLevel(int32_t level) override; private: static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, diff --git a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h index fd37ffb5b4..3eb762fe6d 100644 --- a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h @@ -12,9 +12,11 @@ class CBC_EdifactEncoder : public CBC_Encoder { public: CBC_EdifactEncoder(); - virtual ~CBC_EdifactEncoder(); - int32_t getEncodingMode(); - void Encode(CBC_EncoderContext& context, int32_t& e); + ~CBC_EdifactEncoder() override; + + // CBC_Encoder + int32_t getEncodingMode() override; + void Encode(CBC_EncoderContext& context, int32_t& e) override; private: static void handleEOD(CBC_EncoderContext& context, diff --git a/xfa/fxbarcode/datamatrix/BC_Encoder.h b/xfa/fxbarcode/datamatrix/BC_Encoder.h index 78dc6ac447..68a223fee1 100644 --- a/xfa/fxbarcode/datamatrix/BC_Encoder.h +++ b/xfa/fxbarcode/datamatrix/BC_Encoder.h @@ -10,10 +10,12 @@ #include "xfa/fxbarcode/utils.h" class CBC_EncoderContext; + class CBC_Encoder { public: CBC_Encoder(); virtual ~CBC_Encoder(); + virtual int32_t getEncodingMode() = 0; virtual void Encode(CBC_EncoderContext& context, int32_t& e) = 0; }; diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h index ddc6988dc3..0c1c8a6547 100644 --- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h +++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h @@ -17,7 +17,8 @@ class CBC_EncoderContext : public CBC_SymbolShapeHint { CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, int32_t& e); - virtual ~CBC_EncoderContext(); + ~CBC_EncoderContext() override; + void setSymbolShape(SymbolShapeHint shape); void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize); CFX_WideString getMessage(); diff --git a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.h b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.h index 1ed8c34a23..d3b9da8056 100644 --- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.h +++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.h @@ -8,10 +8,12 @@ #define XFA_FXBARCODE_DATAMATRIX_BC_ERRORCORRECTION_H_ class CBC_SymbolInfo; + class CBC_ErrorCorrection { public: CBC_ErrorCorrection(); virtual ~CBC_ErrorCorrection(); + static void Initialize(); static void Finalize(); static CFX_WideString encodeECC200(CFX_WideString codewords, diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h index 0aad4d4da5..550b601e53 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -19,7 +19,8 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint { public: CBC_HighLevelEncoder(); - virtual ~CBC_HighLevelEncoder(); + ~CBC_HighLevelEncoder() override; + CFX_ByteArray& getBytesForMessage(CFX_WideString msg); static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h index 64270dd9ac..96196da21c 100644 --- a/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h +++ b/xfa/fxbarcode/datamatrix/BC_SymbolInfo.h @@ -21,7 +21,8 @@ class CBC_SymbolInfo : public CBC_SymbolShapeHint { int32_t matrixWidth, int32_t matrixHeight, int32_t dataRegions); - virtual ~CBC_SymbolInfo(); + ~CBC_SymbolInfo() override; + static void Initialize(); static void Finalize(); static void overrideSymbolSet(CBC_SymbolInfo* override); diff --git a/xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h b/xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h index 5dfac0516f..7cd4c86931 100644 --- a/xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h +++ b/xfa/fxbarcode/datamatrix/BC_SymbolShapeHint.h @@ -11,6 +11,7 @@ class CBC_SymbolShapeHint { public: CBC_SymbolShapeHint(); virtual ~CBC_SymbolShapeHint(); + enum SymbolShapeHint { FORCE_NONE, FORCE_SQUARE, diff --git a/xfa/fxbarcode/datamatrix/BC_TextEncoder.h b/xfa/fxbarcode/datamatrix/BC_TextEncoder.h index 1f97f3f8c6..e6013b9508 100644 --- a/xfa/fxbarcode/datamatrix/BC_TextEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_TextEncoder.h @@ -8,12 +8,15 @@ #define XFA_FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_ class CBC_TextEncoder; + class CBC_TextEncoder : public CBC_C40Encoder { public: CBC_TextEncoder(); - virtual ~CBC_TextEncoder(); - int32_t getEncodingMode(); - int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e); + ~CBC_TextEncoder() override; + + // CBC_C40Encoder + int32_t getEncodingMode() override; + int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) override; }; #endif // XFA_FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_ diff --git a/xfa/fxbarcode/datamatrix/BC_X12Encoder.h b/xfa/fxbarcode/datamatrix/BC_X12Encoder.h index 5dccbb1d6f..52239ce529 100644 --- a/xfa/fxbarcode/datamatrix/BC_X12Encoder.h +++ b/xfa/fxbarcode/datamatrix/BC_X12Encoder.h @@ -12,13 +12,15 @@ class CBC_X12Encoder; class CBC_X12Encoder : public CBC_C40Encoder { public: CBC_X12Encoder(); - virtual ~CBC_X12Encoder(); - int32_t getEncodingMode(); - void Encode(CBC_EncoderContext& context, int32_t& e); + ~CBC_X12Encoder() override; + + // CBC_C40Encoder + int32_t getEncodingMode() override; + void Encode(CBC_EncoderContext& context, int32_t& e) override; void handleEOD(CBC_EncoderContext& context, CFX_WideString& buffer, - int32_t& e); - int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e); + int32_t& e) override; + int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) override; }; #endif // XFA_FXBARCODE_DATAMATRIX_BC_X12ENCODER_H_ diff --git a/xfa/fxbarcode/oned/BC_OneDReader.cpp b/xfa/fxbarcode/oned/BC_OneDReader.cpp index c66ec0bebd..53ff9a480c 100644 --- a/xfa/fxbarcode/oned/BC_OneDReader.cpp +++ b/xfa/fxbarcode/oned/BC_OneDReader.cpp @@ -43,6 +43,12 @@ CFX_ByteString CBC_OneDReader::Decode(CBC_BinaryBitmap* image, BC_EXCEPTION_CHECK_ReturnValue(e, ""); return strtemp; } +CFX_ByteString CBC_OneDReader::DecodeRow(int32_t rowNumber, + CBC_CommonBitArray* row, + int32_t hints, + int32_t& e) { + return ""; +} CFX_ByteString CBC_OneDReader::DeDecode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e) { diff --git a/xfa/fxbarcode/oned/BC_OneDReader.h b/xfa/fxbarcode/oned/BC_OneDReader.h index 2bab06e9b8..77e04777a4 100644 --- a/xfa/fxbarcode/oned/BC_OneDReader.h +++ b/xfa/fxbarcode/oned/BC_OneDReader.h @@ -15,17 +15,18 @@ class CBC_CommonBitArray; class CBC_OneDReader : public CBC_Reader { public: CBC_OneDReader(); - virtual ~CBC_OneDReader(); - virtual CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); - virtual CFX_ByteString Decode(CBC_BinaryBitmap* image, - int32_t hints, - int32_t& e); + ~CBC_OneDReader() override; + + // CBC_Reader + CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, + int32_t hints, + int32_t& e) override; + virtual CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, - int32_t& e) { - return ""; - } + int32_t& e); private: CFX_ByteString DeDecode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); diff --git a/xfa/fxbarcode/oned/BC_OneDimReader.h b/xfa/fxbarcode/oned/BC_OneDimReader.h index f572d6fd1e..bd46a189f4 100644 --- a/xfa/fxbarcode/oned/BC_OneDimReader.h +++ b/xfa/fxbarcode/oned/BC_OneDimReader.h @@ -26,17 +26,19 @@ class CBC_OneDimReader : public CBC_OneDReader { static const int32_t L_AND_G_PATTERNS[20][4]; CBC_OneDimReader(); - virtual ~CBC_OneDimReader(); + ~CBC_OneDimReader() override; + // CBC_OneDReader CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, - int32_t& e); - CFX_ByteString DecodeRow(int32_t rowNumber, - CBC_CommonBitArray* row, - CFX_Int32Array* startGuardRange, - int32_t hints, - int32_t& e); + int32_t& e) override; + + virtual CFX_ByteString DecodeRow(int32_t rowNumber, + CBC_CommonBitArray* row, + CFX_Int32Array* startGuardRange, + int32_t hints, + int32_t& e); protected: CFX_Int32Array* FindStartGuardPattern(CBC_CommonBitArray* row, int32_t& e); @@ -55,9 +57,7 @@ class CBC_OneDimReader : public CBC_OneDReader { virtual int32_t DecodeMiddle(CBC_CommonBitArray* row, CFX_Int32Array* startRange, CFX_ByteString& resultResult, - int32_t& e) { - return 0; - } + int32_t& e) = 0; virtual CFX_Int32Array* DecodeEnd(CBC_CommonBitArray* row, int32_t endStart, int32_t& e); diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp index eee2893dde..109fb8f992 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp @@ -101,6 +101,13 @@ uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString& contents, BC_EXCEPTION_CHECK_ReturnValue(e, nullptr); return ret; } + +uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString& contents, + int32_t& outLength, + int32_t& e) { + return nullptr; +} + int32_t CBC_OneDimWriter::AppendPattern(uint8_t* target, int32_t pos, const int32_t* pattern, @@ -123,6 +130,7 @@ int32_t CBC_OneDimWriter::AppendPattern(uint8_t* target, } return numAdded; } + void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, FXTEXT_CHARPOS* charPos, CFX_Font* cFont, @@ -361,6 +369,7 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, BC_EXCEPTION_CHECK_ReturnVoid(e); } } + void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, @@ -436,3 +445,18 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents, outputX += m_multiple; } } + +FX_BOOL CBC_OneDimWriter::CheckContentValidity( + const CFX_WideStringC& contents) { + return TRUE; +} + +CFX_WideString CBC_OneDimWriter::FilterContents( + const CFX_WideStringC& contents) { + return CFX_WideString(); +} + +CFX_WideString CBC_OneDimWriter::RenderTextContents( + const CFX_WideStringC& contents) { + return CFX_WideString(); +} diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h index a0a076217a..10eccf9eea 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h @@ -18,24 +18,22 @@ class CFX_RenderDevice; class CBC_OneDimWriter : public CBC_Writer { public: CBC_OneDimWriter(); - virtual ~CBC_OneDimWriter(); + ~CBC_OneDimWriter() override; - uint8_t* Encode(const CFX_ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t& e); - uint8_t* Encode(const CFX_ByteString& contents, - BCFORMAT format, - int32_t& outWidth, - int32_t& outHeight, - int32_t hints, - int32_t& e); + virtual uint8_t* Encode(const CFX_ByteString& contents, + BCFORMAT format, + int32_t& outWidth, + int32_t& outHeight, + int32_t& e); + virtual uint8_t* Encode(const CFX_ByteString& contents, + BCFORMAT format, + int32_t& outWidth, + int32_t& outHeight, + int32_t hints, + int32_t& e); virtual uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e) { - return nullptr; - } + int32_t& e); virtual void RenderResult(const CFX_WideStringC& contents, uint8_t* code, @@ -49,30 +47,24 @@ class CBC_OneDimWriter : public CBC_Writer { const CFX_Matrix* matrix, const CFX_WideStringC& contents, int32_t& e); - virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) { - return TRUE; - } - virtual CFX_WideString FilterContents(const CFX_WideStringC& contents) { - return CFX_WideString(); - } - virtual CFX_WideString RenderTextContents(const CFX_WideStringC& contents) { - return CFX_WideString(); - } + virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); + virtual CFX_WideString FilterContents(const CFX_WideStringC& contents); + virtual CFX_WideString RenderTextContents(const CFX_WideStringC& contents); virtual void SetPrintChecksum(FX_BOOL checksum); virtual void SetDataLength(int32_t length); virtual void SetCalcChecksum(int32_t state); virtual void SetFontSize(FX_FLOAT size); virtual void SetFontStyle(int32_t style); virtual void SetFontColor(FX_ARGB color); - virtual FX_BOOL SetFont(CFX_Font* cFont); + FX_BOOL SetFont(CFX_Font* cFont); protected: - void CalcTextInfo(const CFX_ByteString& text, - FXTEXT_CHARPOS* charPos, - CFX_Font* cFont, - FX_FLOAT geWidth, - int32_t fontSize, - FX_FLOAT& charsLen); + virtual void CalcTextInfo(const CFX_ByteString& text, + FXTEXT_CHARPOS* charPos, + CFX_Font* cFont, + FX_FLOAT geWidth, + int32_t fontSize, + FX_FLOAT& charsLen); virtual void ShowChars(const CFX_WideStringC& contents, CFX_DIBitmap* pOutBitmap, CFX_RenderDevice* device, @@ -95,12 +87,13 @@ class CBC_OneDimWriter : public CBC_Writer { FX_FLOAT locX, FX_FLOAT locY, int32_t barWidth); - int32_t AppendPattern(uint8_t* target, - int32_t pos, - const int32_t* pattern, - int32_t patternLength, - int32_t startColor, - int32_t& e); + virtual int32_t AppendPattern(uint8_t* target, + int32_t pos, + const int32_t* pattern, + int32_t patternLength, + int32_t startColor, + int32_t& e); + FX_WCHAR Upper(FX_WCHAR ch); FX_BOOL m_bPrintChecksum; diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarReader.h b/xfa/fxbarcode/oned/BC_OnedCodaBarReader.h index 8fd2177a04..ce902bff5e 100644 --- a/xfa/fxbarcode/oned/BC_OnedCodaBarReader.h +++ b/xfa/fxbarcode/oned/BC_OnedCodaBarReader.h @@ -16,11 +16,14 @@ class CBC_OneDReader; class CBC_OnedCodaBarReader : public CBC_OneDReader { public: CBC_OnedCodaBarReader(); - virtual ~CBC_OnedCodaBarReader(); + ~CBC_OnedCodaBarReader() override; + + // CBC_OneDReader CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, - int32_t& e); + int32_t& e) override; + CFX_Int32Array* FindAsteriskPattern(CBC_CommonBitArray* row, int32_t& e); FX_BOOL ArrayContains(const FX_CHAR array[], FX_CHAR key); FX_CHAR ToNarrowWidePattern(CFX_Int32Array* counter); diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h index d13601731b..99c6bfb039 100644 --- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h +++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h @@ -15,32 +15,33 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter { public: CBC_OnedCodaBarWriter(); - virtual ~CBC_OnedCodaBarWriter(); + ~CBC_OnedCodaBarWriter() override; + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); - - CFX_WideString encodedContents(const CFX_WideStringC& contents); - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); - FX_BOOL SetStartChar(FX_CHAR start); - FX_BOOL SetEndChar(FX_CHAR end); - void SetDataLength(int32_t length); - FX_BOOL SetTextLocation(BC_TEXT_LOC location); - FX_BOOL SetWideNarrowRatio(int32_t ratio); - FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent); + int32_t& e) override; + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; + void SetDataLength(int32_t length) override; + + virtual CFX_WideString encodedContents(const CFX_WideStringC& contents); + virtual FX_BOOL SetStartChar(FX_CHAR start); + virtual FX_BOOL SetEndChar(FX_CHAR end); + virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location); + virtual FX_BOOL SetWideNarrowRatio(int32_t ratio); + virtual FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent); private: static const FX_CHAR START_END_CHARS[]; @@ -50,7 +51,7 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter { uint8_t* code, int32_t codeLength, FX_BOOL isDevice, - int32_t& e); + int32_t& e) override; FX_CHAR m_chStart; FX_CHAR m_chEnd; diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Reader.h b/xfa/fxbarcode/oned/BC_OnedCode128Reader.h index df21d7a220..b63b054984 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode128Reader.h +++ b/xfa/fxbarcode/oned/BC_OnedCode128Reader.h @@ -14,11 +14,13 @@ class CBC_CommonBitArray; class CBC_OnedCode128Reader : public CBC_OneDReader { public: CBC_OnedCode128Reader(); - virtual ~CBC_OnedCode128Reader(); - virtual CFX_ByteString DecodeRow(int32_t rowNumber, - CBC_CommonBitArray* row, - int32_t hints, - int32_t& e); + ~CBC_OnedCode128Reader() override; + + // CBC_OneDReader + CFX_ByteString DecodeRow(int32_t rowNumber, + CBC_CommonBitArray* row, + int32_t hints, + int32_t& e) override; static const int32_t CODE_PATTERNS[107][7]; diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.h b/xfa/fxbarcode/oned/BC_OnedCode128Writer.h index b2530642af..7338b56952 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.h @@ -15,26 +15,29 @@ class CBC_OnedCode128Writer : public CBC_OneDimWriter { public: CBC_OnedCode128Writer(); explicit CBC_OnedCode128Writer(BC_TYPE type); - virtual ~CBC_OnedCode128Writer(); + ~CBC_OnedCode128Writer() override; + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e); + int32_t& e) override; + + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); FX_BOOL SetTextLocation(BC_TEXT_LOC location); + BC_TYPE GetType(); private: diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Reader.h b/xfa/fxbarcode/oned/BC_OnedCode39Reader.h index 0d4591f95b..0e1a728a47 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode39Reader.h +++ b/xfa/fxbarcode/oned/BC_OnedCode39Reader.h @@ -22,12 +22,13 @@ class CBC_OnedCode39Reader : public CBC_OneDReader { CBC_OnedCode39Reader(); explicit CBC_OnedCode39Reader(FX_BOOL usingCheckDigit); CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL extendedMode); - virtual ~CBC_OnedCode39Reader(); + ~CBC_OnedCode39Reader() override; + // CBC_OneDReader CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, - int32_t& e); + int32_t& e) override; private: CFX_Int32Array* FindAsteriskPattern(CBC_CommonBitArray* row, int32_t& e); diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h index f2c340b3fb..7dc314f968 100644 --- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h @@ -14,37 +14,41 @@ class CBC_OnedCode39Writer : public CBC_OneDimWriter { public: CBC_OnedCode39Writer(); explicit CBC_OnedCode39Writer(FX_BOOL extendedMode); - virtual ~CBC_OnedCode39Writer(); + ~CBC_OnedCode39Writer() override; + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e); + int32_t& e) override; void RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, - int32_t& e); - - CFX_WideString encodedContents(const CFX_WideStringC& contents, int32_t& e); - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - FX_BOOL CheckExtendedContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); - CFX_WideString FilterExtendedContents(const CFX_WideStringC& contents); - CFX_WideString RenderTextContents(const CFX_WideStringC& contents); - CFX_WideString RenderExtendedTextContents(const CFX_WideStringC& contents); - FX_BOOL SetTextLocation(BC_TEXT_LOC loction); - FX_BOOL SetWideNarrowRatio(int32_t ratio); + int32_t& e) override; + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; + CFX_WideString RenderTextContents(const CFX_WideStringC& contents) override; + + virtual CFX_WideString encodedContents(const CFX_WideStringC& contents, + int32_t& e); + virtual FX_BOOL CheckExtendedContentValidity(const CFX_WideStringC& contents); + virtual CFX_WideString FilterExtendedContents( + const CFX_WideStringC& contents); + virtual CFX_WideString RenderExtendedTextContents( + const CFX_WideStringC& contents); + virtual FX_BOOL SetTextLocation(BC_TEXT_LOC loction); + virtual FX_BOOL SetWideNarrowRatio(int32_t ratio); private: void ToIntArray(int32_t a, int32_t* toReturn); diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Reader.h b/xfa/fxbarcode/oned/BC_OnedEAN13Reader.h index 5656540250..ac53fd4f24 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN13Reader.h +++ b/xfa/fxbarcode/oned/BC_OnedEAN13Reader.h @@ -16,15 +16,10 @@ class CBC_OnedUPCAReader; class CBC_OnedEAN13Reader : public CBC_OneDimReader { public: - static const int32_t FIRST_DIGIT_ENCODINGS[10]; - CBC_OnedEAN13Reader(); - virtual ~CBC_OnedEAN13Reader(); + ~CBC_OnedEAN13Reader() override; - private: - void DetermineFirstDigit(CFX_ByteString& result, - int32_t lgPatternFound, - int32_t& e); + static const int32_t FIRST_DIGIT_ENCODINGS[10]; protected: friend class CBC_OnedUPCAReader; @@ -32,7 +27,12 @@ class CBC_OnedEAN13Reader : public CBC_OneDimReader { int32_t DecodeMiddle(CBC_CommonBitArray* row, CFX_Int32Array* startRange, CFX_ByteString& resultString, - int32_t& e); + int32_t& e) override; + + private: + void DetermineFirstDigit(CFX_ByteString& result, + int32_t lgPatternFound, + int32_t& e); }; #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN13READER_H_ diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h index 75debc2508..b2b85d20e9 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.h @@ -17,30 +17,31 @@ class CFX_RenderDevice; class CBC_OnedEAN13Writer : public CBC_OneDimWriter { public: CBC_OnedEAN13Writer(); - virtual ~CBC_OnedEAN13Writer(); + ~CBC_OnedEAN13Writer() override; + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e); - + int32_t& e) override; void RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, - int32_t& e); - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); + int32_t& e) override; + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; + int32_t CalcChecksum(const CFX_ByteString& contents); protected: @@ -50,7 +51,7 @@ class CBC_OnedEAN13Writer : public CBC_OneDimWriter { const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, - int32_t& e); + int32_t& e) override; private: int32_t m_codeWidth; diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Reader.h b/xfa/fxbarcode/oned/BC_OnedEAN8Reader.h index ab2d5e3178..756565dd8f 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Reader.h +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Reader.h @@ -14,13 +14,13 @@ class CBC_CommonBitArray; class CBC_OnedEAN8Reader : public CBC_OneDimReader { public: CBC_OnedEAN8Reader(); - virtual ~CBC_OnedEAN8Reader(); + ~CBC_OnedEAN8Reader() override; protected: int32_t DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array* startRange, CFX_ByteString& result, - int32_t& e); + int32_t& e) override; }; #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN8READER_H_ diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h index 706393eb03..dab1b25de0 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h +++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.h @@ -16,36 +16,35 @@ class CFX_DIBitmap; class CFX_RenderDevice; class CBC_OnedEAN8Writer : public CBC_OneDimWriter { - private: - int32_t m_codeWidth; - public: CBC_OnedEAN8Writer(); - virtual ~CBC_OnedEAN8Writer(); + ~CBC_OnedEAN8Writer() override; + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e); + int32_t& e) override; void RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, - int32_t& e); - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); - void SetDataLength(int32_t length); + int32_t& e) override; + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; + void SetDataLength(int32_t length) override; + FX_BOOL SetTextLocation(BC_TEXT_LOC location); int32_t CalcChecksum(const CFX_ByteString& contents); @@ -56,7 +55,10 @@ class CBC_OnedEAN8Writer : public CBC_OneDimWriter { const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, - int32_t& e); + int32_t& e) override; + + private: + int32_t m_codeWidth; }; #endif // XFA_FXBARCODE_ONED_BC_ONEDEAN8WRITER_H_ diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAReader.h b/xfa/fxbarcode/oned/BC_OnedUPCAReader.h index c073930c5b..28e03fc21f 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAReader.h +++ b/xfa/fxbarcode/oned/BC_OnedUPCAReader.h @@ -18,27 +18,32 @@ class CBC_OnedEAN13Reader; class CBC_OnedUPCAReader : public CBC_OneDimReader { public: CBC_OnedUPCAReader(); - virtual ~CBC_OnedUPCAReader(); + ~CBC_OnedUPCAReader() override; virtual void Init(); + // CBC_OneDimReader CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, - int32_t& e); + int32_t& e) override; CFX_ByteString DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, CFX_Int32Array* startGuardRange, int32_t hints, - int32_t& e); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); + int32_t& e) override; + + // CBC_OneDReader + CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, + int32_t hints, + int32_t& e) override; protected: int32_t DecodeMiddle(CBC_CommonBitArray* row, CFX_Int32Array* startRange, CFX_ByteString& resultString, - int32_t& e); + int32_t& e) override; CFX_ByteString MaybeReturnResult(CFX_ByteString& result, int32_t& e); private: diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 580e1a8444..2b06c8519b 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -105,6 +105,12 @@ uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents, return ret; } +uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents, + int32_t& outLength, + int32_t& e) { + return nullptr; +} + void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, CFX_DIBitmap* pOutBitmap, CFX_RenderDevice* device, diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h index 45d4eac620..8257dfa4b6 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.h @@ -19,34 +19,33 @@ class CFX_RenderDevice; class CBC_OnedUPCAWriter : public CBC_OneDimWriter { public: CBC_OnedUPCAWriter(); - virtual ~CBC_OnedUPCAWriter(); + ~CBC_OnedUPCAWriter() override; virtual void Init(); + // CBC_OneDimWriter uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, int32_t hints, - int32_t& e); + int32_t& e) override; uint8_t* Encode(const CFX_ByteString& contents, int32_t& outLength, - int32_t& e) { - return nullptr; - } + int32_t& e) override; void RenderResult(const CFX_WideStringC& contents, uint8_t* code, int32_t codeLength, FX_BOOL isDevice, - int32_t& e); - FX_BOOL CheckContentValidity(const CFX_WideStringC& contents); - CFX_WideString FilterContents(const CFX_WideStringC& contents); + int32_t& e) override; + FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) override; + CFX_WideString FilterContents(const CFX_WideStringC& contents) override; int32_t CalcChecksum(const CFX_ByteString& contents); protected: @@ -56,7 +55,7 @@ class CBC_OnedUPCAWriter : public CBC_OneDimWriter { const CFX_Matrix* matrix, int32_t barWidth, int32_t multiple, - int32_t& e); + int32_t& e) override; private: CBC_OnedEAN13Writer* m_subWriter; diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h index 2e46f80ce8..f2fb5cb89e 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417.h @@ -18,6 +18,7 @@ class CBC_PDF417 { CBC_PDF417(); CBC_PDF417(FX_BOOL compact); virtual ~CBC_PDF417(); + CBC_BarcodeMatrix* getBarcodeMatrix(); void generateBarcodeLogic(CFX_WideString msg, int32_t errorCorrectionLevel, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h index c86f714fbb..16da60f5cd 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h @@ -16,6 +16,7 @@ class CBC_BarcodeMatrix { CBC_BarcodeMatrix(); CBC_BarcodeMatrix(int32_t height, int32_t width); virtual ~CBC_BarcodeMatrix(); + void set(int32_t x, int32_t y, uint8_t value); void setMatrix(int32_t x, int32_t y, FX_BOOL black); void startRow(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h index 2b398f13f6..07072e5217 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h @@ -16,6 +16,7 @@ class CBC_BarcodeMetadata { int32_t rowCountLowerPart, int32_t errorCorrectionLevel); virtual ~CBC_BarcodeMetadata(); + int32_t getColumnCount(); int32_t getErrorCorrectionLevel(); int32_t getRowCount(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h index 80d931b587..9bf1b3cbce 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BarcodeRow.h @@ -13,6 +13,7 @@ class CBC_BarcodeRow { public: CBC_BarcodeRow(int32_t width); virtual ~CBC_BarcodeRow(); + void set(int32_t x, uint8_t value); void set(int32_t x, FX_BOOL black); void addBar(FX_BOOL black, int32_t width); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.h b/xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.h index 3ae0e107ab..69a43e0700 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.h @@ -22,6 +22,7 @@ class CBC_BoundingBox { int32_t& e); CBC_BoundingBox(CBC_BoundingBox* boundingBox); virtual ~CBC_BoundingBox(); + static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, int32_t& e); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h b/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h index d397485b1d..2423cab757 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Codeword.h @@ -13,6 +13,7 @@ class CBC_Codeword { public: CBC_Codeword(int32_t startX, int32_t endX, int32_t bucket, int32_t value); virtual ~CBC_Codeword(); + FX_BOOL hasValidRowNumber(); FX_BOOL isValidRowNumber(int32_t rowNumber); void setRowNumberAsRowIndicatorColumn(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h b/xfa/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h index 4c31b31ea2..ed0c235a9a 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h @@ -13,6 +13,7 @@ class CBC_PDF417CodewordDecoder { public: CBC_PDF417CodewordDecoder(); virtual ~CBC_PDF417CodewordDecoder(); + static void Initialize(); static void Finalize(); static int32_t getDecodedValue(CFX_Int32Array& moduleBitCount); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Common.h b/xfa/fxbarcode/pdf417/BC_PDF417Common.h index c72d66410e..490507285b 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Common.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Common.h @@ -13,6 +13,7 @@ class CBC_PDF417Common { public: CBC_PDF417Common(); virtual ~CBC_PDF417Common(); + static int32_t getBitCountSum(CFX_Int32Array& moduleBitCount); static int32_t getCodeword(uint32_t symbol); static const int32_t NUMBER_OF_CODEWORDS = 929; diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h b/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h index e08fb15427..e32103e27c 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h @@ -17,6 +17,7 @@ class CBC_DecodedBitStreamPaser { public: CBC_DecodedBitStreamPaser(); virtual ~CBC_DecodedBitStreamPaser(); + static void Initialize(); static void Finalize(); static CBC_CommonDecoderResult* decode(CFX_Int32Array& codewords, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.h b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.h index 1590ce227a..e5cad81b9f 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResult.h @@ -16,6 +16,7 @@ class CBC_DetectionResult { CBC_DetectionResult(CBC_BarcodeMetadata* barcodeMetadata, CBC_BoundingBox* boundingBox); virtual ~CBC_DetectionResult(); + CFX_ArrayTemplate& getDetectionResultColumns(); void setBoundingBox(CBC_BoundingBox* boundingBox); CBC_BoundingBox* getBoundingBox(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h index f914354124..23fbe74bc3 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h @@ -14,7 +14,8 @@ class CBC_DetectionResultRowIndicatorColumn : public CBC_DetectionResultColumn { public: CBC_DetectionResultRowIndicatorColumn(CBC_BoundingBox* boundingBox, FX_BOOL isLeft); - virtual ~CBC_DetectionResultRowIndicatorColumn(); + ~CBC_DetectionResultRowIndicatorColumn() override; + void setRowNumbers(); int32_t adjustCompleteIndicatorColumnRowNumbers( CBC_BarcodeMetadata barcodeMetadata); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Detector.h b/xfa/fxbarcode/pdf417/BC_PDF417Detector.h index c6fa6f6e7e..c7c21b2a22 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Detector.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Detector.h @@ -17,6 +17,7 @@ class CBC_Detector { public: CBC_Detector(); virtual ~CBC_Detector(); + static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, int32_t hints, FX_BOOL multiple, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Dimensions.h b/xfa/fxbarcode/pdf417/BC_PDF417Dimensions.h index 622ad236bc..dedbea3e58 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Dimensions.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Dimensions.h @@ -16,6 +16,7 @@ class CBC_Dimensions { int32_t minRows, int32_t maxRows); virtual ~CBC_Dimensions(); + int32_t getMinCols(); int32_t getMaxCols(); int32_t getMinRows(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h b/xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h index 95e691a60a..2503311c72 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h @@ -13,6 +13,7 @@ class CBC_PDF417ECErrorCorrection { public: CBC_PDF417ECErrorCorrection(); virtual ~CBC_PDF417ECErrorCorrection(); + static void Initialize(int32_t& e); static void Finalize(); static int32_t decode(CFX_Int32Array& received, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ECModulusGF.h b/xfa/fxbarcode/pdf417/BC_PDF417ECModulusGF.h index 094e00164d..3614f5355d 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417ECModulusGF.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417ECModulusGF.h @@ -12,6 +12,7 @@ class CBC_PDF417ECModulusGF { public: CBC_PDF417ECModulusGF(int32_t modulus, int32_t generator, int32_t& e); virtual ~CBC_PDF417ECModulusGF(); + static void Initialize(int32_t& e); static void Finalize(); CBC_PDF417ECModulusPoly* getZero(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h b/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h index b97638660f..20717b118b 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h @@ -15,6 +15,7 @@ class CBC_PDF417ErrorCorrection { public: CBC_PDF417ErrorCorrection(); virtual ~CBC_PDF417ErrorCorrection(); + static int32_t getErrorCorrectionCodewordCount(int32_t errorCorrectionLevel, int32_t& e); static int32_t getRecommendedMinimumErrorCorrectionLevel(int32_t n, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Reader.h b/xfa/fxbarcode/pdf417/BC_PDF417Reader.h index 73499b9cdf..193d7efdee 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Reader.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Reader.h @@ -17,13 +17,18 @@ class CBC_ResultPoint; class CBC_PDF417Reader : public CBC_Reader { public: CBC_PDF417Reader(); - virtual ~CBC_PDF417Reader(); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); + ~CBC_PDF417Reader() override; + + // CBC_Reader + CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, + int32_t hints, + int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, FX_BOOL multiple, int32_t hints, int32_t& e); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); private: static int32_t getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ResultMetadata.h b/xfa/fxbarcode/pdf417/BC_PDF417ResultMetadata.h index 924f25f1c4..92f4ea4966 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417ResultMetadata.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417ResultMetadata.h @@ -13,6 +13,7 @@ class CBC_PDF417ResultMetadata { public: CBC_PDF417ResultMetadata(); virtual ~CBC_PDF417ResultMetadata(); + int32_t getSegmentIndex(); void setSegmentIndex(int32_t segmentIndex); CFX_ByteString getFileId(); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h b/xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h index aa99d5a0d4..d136630003 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h @@ -22,6 +22,7 @@ class CBC_PDF417ScanningDecoder { public: CBC_PDF417ScanningDecoder(); virtual ~CBC_PDF417ScanningDecoder(); + static void Initialize(); static void Finalize(); static CBC_CommonDecoderResult* decode(CBC_CommonBitMatrix* image, diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h index 7f7195948c..e16c51474e 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417Writer.h @@ -14,12 +14,16 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter { public: CBC_PDF417Writer(); - virtual ~CBC_PDF417Writer(); + ~CBC_PDF417Writer() override; + uint8_t* Encode(const CFX_WideString& contents, int32_t& outWidth, int32_t& outHeight, int32_t& e); - FX_BOOL SetErrorCorrectionLevel(int32_t level); + + // CBC_TwoDimWriter + FX_BOOL SetErrorCorrectionLevel(int32_t level) override; + void SetTruncated(FX_BOOL truncated); private: diff --git a/xfa/fxbarcode/qrcode/BC_QRAlignmentPattern.h b/xfa/fxbarcode/qrcode/BC_QRAlignmentPattern.h index 9a4e80c2b2..7006b72c9c 100644 --- a/xfa/fxbarcode/qrcode/BC_QRAlignmentPattern.h +++ b/xfa/fxbarcode/qrcode/BC_QRAlignmentPattern.h @@ -15,10 +15,14 @@ class CBC_QRAlignmentPattern : public CBC_ResultPoint { CBC_QRAlignmentPattern(FX_FLOAT posX, FX_FLOAT posY, FX_FLOAT estimateModuleSize); - virtual ~CBC_QRAlignmentPattern(); + ~CBC_QRAlignmentPattern() override; + + // CBC_ResultPoint + FX_FLOAT GetX() override; + FX_FLOAT GetY() override; + FX_BOOL AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLOAT j); - FX_FLOAT GetX(); - FX_FLOAT GetY(); + CBC_QRAlignmentPattern* Clone(); }; diff --git a/xfa/fxbarcode/qrcode/BC_QRCodeReader.h b/xfa/fxbarcode/qrcode/BC_QRCodeReader.h index c11ccd1f26..b3a72b4d18 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCodeReader.h +++ b/xfa/fxbarcode/qrcode/BC_QRCodeReader.h @@ -22,7 +22,8 @@ class CBC_QRCodeReader : public CBC_Reader { public: CBC_QRCodeReader(); - virtual ~CBC_QRCodeReader(); + ~CBC_QRCodeReader() override; + CFX_ByteString Decode(CFX_DIBitmap* pBitmap, int32_t hints, int32_t byteModeDecode, @@ -32,8 +33,12 @@ class CBC_QRCodeReader : public CBC_Reader { int32_t byteModeDecode, int32_t& e); static void ReleaseAll(); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); - CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); + + // CBC_Reader + CFX_ByteString Decode(CBC_BinaryBitmap* image, + int32_t hints, + int32_t& e) override; + CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; virtual void Init(); }; diff --git a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h index c68c6c0a3f..6562107f10 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h +++ b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.h @@ -13,7 +13,8 @@ class CBC_TwoDimWriter; class CBC_QRCodeWriter : public CBC_TwoDimWriter { public: CBC_QRCodeWriter(); - virtual ~CBC_QRCodeWriter(); + ~CBC_QRCodeWriter() override; + uint8_t* Encode(const CFX_WideString& contents, int32_t ecLevel, int32_t& outWidth, @@ -31,7 +32,10 @@ class CBC_QRCodeWriter : public CBC_TwoDimWriter { int32_t& outHeight, int32_t& e); FX_BOOL SetVersion(int32_t version); - FX_BOOL SetErrorCorrectionLevel(int32_t level); + + // CBC_TwoDimWriter + FX_BOOL SetErrorCorrectionLevel(int32_t level) override; + static void ReleaseAll(); private: diff --git a/xfa/fxbarcode/qrcode/BC_QRDataMask.cpp b/xfa/fxbarcode/qrcode/BC_QRDataMask.cpp index 9b5e3ca014..e21b5d2d37 100644 --- a/xfa/fxbarcode/qrcode/BC_QRDataMask.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRDataMask.cpp @@ -67,46 +67,52 @@ CBC_QRDataMask* CBC_QRDataMask::ForReference(int32_t reference, int32_t& e) { class DataMask000 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { return ((x + y) % 2) == 0; } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask001 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { return (x % 2) == 0; } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask010 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { return y % 3 == 0; } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask011 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { return (x + y) % 3 == 0; } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask100 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { - return (((x >> 1) + (y / 3)) % 2) == 0; - } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask101 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { - size_t temp = x * y; - return (temp % 2) + (temp % 3) == 0; - } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask110 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { - size_t temp = x * y; - return (((temp % 2) + (temp % 3)) % 2) == 0; - } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + class DataMask111 : public CBC_QRDataMask { public: - FX_BOOL IsMasked(int32_t x, int32_t y) { - return ((((x + y) % 2) + ((x * y) % 3)) % 2) == 0; - } + // CBC_QRDataMask + FX_BOOL IsMasked(int32_t x, int32_t y) override; }; + int32_t CBC_QRDataMask::BuildDataMasks() { DATA_MASKS->Add(new DataMask000); DATA_MASKS->Add(new DataMask001); @@ -118,5 +124,41 @@ int32_t CBC_QRDataMask::BuildDataMasks() { DATA_MASKS->Add(new DataMask111); return DATA_MASKS->GetSize(); } + CBC_QRDataMask::CBC_QRDataMask() {} + CBC_QRDataMask::~CBC_QRDataMask() {} + +FX_BOOL DataMask000::IsMasked(int32_t x, int32_t y) { + return ((x + y) % 2) == 0; +} + +FX_BOOL DataMask001::IsMasked(int32_t x, int32_t y) { + return (x % 2) == 0; +} + +FX_BOOL DataMask010::IsMasked(int32_t x, int32_t y) { + return y % 3 == 0; +} + +FX_BOOL DataMask011::IsMasked(int32_t x, int32_t y) { + return (x + y) % 3 == 0; +} + +FX_BOOL DataMask100::IsMasked(int32_t x, int32_t y) { + return (((x >> 1) + (y / 3)) % 2) == 0; +} + +FX_BOOL DataMask101::IsMasked(int32_t x, int32_t y) { + size_t temp = x * y; + return (temp % 2) + (temp % 3) == 0; +} + +FX_BOOL DataMask110::IsMasked(int32_t x, int32_t y) { + size_t temp = x * y; + return (((temp % 2) + (temp % 3)) % 2) == 0; +} + +FX_BOOL DataMask111::IsMasked(int32_t x, int32_t y) { + return ((((x + y) % 2) + ((x * y) % 3)) % 2) == 0; +} diff --git a/xfa/fxbarcode/qrcode/BC_QRFinderPattern.h b/xfa/fxbarcode/qrcode/BC_QRFinderPattern.h index 0dc2f3cfcb..f02a229121 100644 --- a/xfa/fxbarcode/qrcode/BC_QRFinderPattern.h +++ b/xfa/fxbarcode/qrcode/BC_QRFinderPattern.h @@ -16,11 +16,13 @@ class CBC_QRFinderPattern : public CBC_ResultPoint { public: CBC_QRFinderPattern(FX_FLOAT x, FX_FLOAT posY, FX_FLOAT estimatedModuleSize); - virtual ~CBC_QRFinderPattern(); + ~CBC_QRFinderPattern() override; + + // CBC_ResultPoint + FX_FLOAT GetX() override; + FX_FLOAT GetY() override; int32_t GetCount() const; - FX_FLOAT GetX(); - FX_FLOAT GetY(); FX_FLOAT GetEstimatedModuleSize(); void IncrementCount(); FX_BOOL AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLOAT j); -- cgit v1.2.3