diff options
Diffstat (limited to 'xfa/fxbarcode/datamatrix')
23 files changed, 108 insertions, 56 deletions
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<CBC_ResultPoint*>* 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<ECB*>& 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_ |