summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fxbarcode/src/include')
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h22
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Base256Encoder.h21
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Binarizer.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h33
-rw-r--r--xfa/src/fxbarcode/src/include/BC_C40Encoder.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonBitArray.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h38
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonBitSource.h23
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonByteArray.h30
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h33
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonECI.h21
-rw-r--r--xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h39
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h33
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h26
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h43
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h78
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h19
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h101
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h30
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DecoderResult.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Dimension.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h23
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Encoder.h19
-rw-r--r--xfa/src/fxbarcode/src/include/BC_EncoderContext.h48
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h28
-rw-r--r--xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h60
-rw-r--r--xfa/src/fxbarcode/src/include/BC_LuminanceSource.h34
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OneDReader.h34
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OneDimReader.h39
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OneDimWriter.h70
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h30
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h38
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h40
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h37
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h37
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h31
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h20
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h30
-rw-r--r--xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h31
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417.h45
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h27
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h22
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h43
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h34
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h27
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Common.h31
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h22
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h49
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h48
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h31
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h28
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Detector.h43
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h22
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h26
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h37
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h34
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h21
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h48
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Reader.h26
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h61
-rw-r--r--xfa/src/fxbarcode/src/include/BC_PDF417Writer.h26
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h31
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCodeReader.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h28
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoder.h55
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h23
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderECB.h21
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h60
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h32
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h50
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderMode.h40
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h42
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRDataBlock.h27
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRDataMask.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRDetector.h41
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h23
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h29
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h45
-rw-r--r--xfa/src/fxbarcode/src/include/BC_QRGridSampler.h33
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Reader.h19
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ReedSolomon.h25
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h33
-rw-r--r--xfa/src/fxbarcode/src/include/BC_ResultPoint.h24
-rw-r--r--xfa/src/fxbarcode/src/include/BC_SymbolInfo.h53
-rw-r--r--xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h21
-rw-r--r--xfa/src/fxbarcode/src/include/BC_TextEncoder.h18
-rw-r--r--xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h44
-rw-r--r--xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h22
-rw-r--r--xfa/src/fxbarcode/src/include/BC_UtilRSS.h23
-rw-r--r--xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h38
-rw-r--r--xfa/src/fxbarcode/src/include/BC_Writer.h35
-rw-r--r--xfa/src/fxbarcode/src/include/BC_X12Encoder.h21
-rw-r--r--xfa/src/fxbarcode/src/include/utils.h219
118 files changed, 4072 insertions, 0 deletions
diff --git a/xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h b/xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h
new file mode 100644
index 0000000000..9a48b8762f
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h
@@ -0,0 +1,22 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ASCIIENCODER_H_
+#define _BC_ASCIIENCODER_H_
+class CBC_Encoder;
+class CBC_EncoderContext;
+class CBC_ASCIIEncoder;
+class CBC_ASCIIEncoder : public CBC_Encoder
+{
+public:
+ CBC_ASCIIEncoder();
+ virtual ~CBC_ASCIIEncoder();
+ FX_INT32 getEncodingMode();
+ void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+private:
+ static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1, FX_WCHAR digit2, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Base256Encoder.h b/xfa/src/fxbarcode/src/include/BC_Base256Encoder.h
new file mode 100644
index 0000000000..96110b1d08
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Base256Encoder.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BASE256ENCODER_H_
+#define _BC_BASE256ENCODER_H_
+class CBC_Encoder;
+class CBC_Base256Encoder;
+class CBC_Base256Encoder : public CBC_Encoder
+{
+public:
+ CBC_Base256Encoder();
+ virtual ~CBC_Base256Encoder();
+ FX_INT32 getEncodingMode();
+ void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+private:
+ static FX_WCHAR randomize255State(FX_WCHAR ch, FX_INT32 codewordPosition);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Binarizer.h b/xfa/src/fxbarcode/src/include/BC_Binarizer.h
new file mode 100644
index 0000000000..357aef67c2
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Binarizer.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BINARIZER_H_
+#define _BC_BINARIZER_H_
+class CBC_LuminanceSource;
+class CBC_CommonBitMatrix;
+class CBC_CommonBitArray;
+class CBC_BinaryBitmap;
+class CBC_Binarizer : public CFX_Object
+{
+public:
+ CBC_Binarizer(CBC_LuminanceSource *source);
+ virtual ~CBC_Binarizer();
+ CBC_LuminanceSource *GetLuminanceSource();
+ virtual CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e) = 0;
+ virtual CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) = 0;
+private:
+ CBC_LuminanceSource *m_source;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h b/xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h
new file mode 100644
index 0000000000..638d16f5a9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BINARYBITMAP_H_
+#define _BC_BINARYBITMAP_H_
+class CBC_Binarizer;
+class CBC_CommonBitMatrix;
+class CBC_CommonBitArray;
+class CBC_BinaryBitmap;
+class CBC_BinaryBitmap : public CFX_Object
+{
+public:
+ CBC_BinaryBitmap(CBC_Binarizer *binarizer);
+ virtual ~CBC_BinaryBitmap();
+ FX_INT32 GetWidth();
+ FX_INT32 GetHeight();
+ CBC_CommonBitMatrix * GetMatrix(FX_INT32 &e);
+ CBC_CommonBitArray * GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);
+ CBC_CommonBitMatrix * GetBlackMatrix(FX_INT32 &e);
+ FX_BOOL IsCropSupported();
+ FX_BOOL IsRotateSupported();
+private:
+ CBC_Binarizer * m_binarizer;
+ CBC_CommonBitMatrix * m_matrix;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h b/xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h
new file mode 100644
index 0000000000..4bff1756d5
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h
@@ -0,0 +1,33 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BUFFEREDIMAGELUMINANCESOURCE_H_
+#define _BC_BUFFEREDIMAGELUMINANCESOURCE_H_
+class CBC_LuminanceSource;
+class CBC_BufferedImageLuminanceSource;
+class CBC_BufferedImageLuminanceSource : public CBC_LuminanceSource
+{
+public:
+ CBC_BufferedImageLuminanceSource(const CFX_WideString &filename);
+ CBC_BufferedImageLuminanceSource(CFX_DIBitmap *pBitmap);
+ virtual ~CBC_BufferedImageLuminanceSource();
+ CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e);
+ CBC_LuminanceSource *Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height);
+
+ CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e);
+ CFX_ByteArray *GetMatrix();
+ FX_BOOL IsCropSupported();
+ FX_BOOL IsRotateSupported();
+ virtual void Init(FX_INT32 &e);
+private:
+ FX_INT32 m_bytesPerLine;
+ FX_INT32 m_left;
+ FX_INT32 m_top;
+ CFX_Int32Array m_rgbData;
+ CFX_DIBitmap *m_pBitmap;
+ const CFX_WideString m_filename;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_C40Encoder.h b/xfa/src/fxbarcode/src/include/BC_C40Encoder.h
new file mode 100644
index 0000000000..7f2d2f7e79
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_C40Encoder.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_C40ENCODER_H_
+#define _BC_C40ENCODER_H_
+class CBC_C40Encoder;
+class CBC_C40Encoder : public CBC_Encoder
+{
+public:
+ CBC_C40Encoder();
+ virtual ~CBC_C40Encoder();
+ virtual FX_INT32 getEncodingMode();
+ virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ static void writeNextTriplet(CBC_EncoderContext &context, CFX_WideString &buffer);
+ virtual void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e);
+ virtual FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+private:
+ FX_INT32 backtrackOneCharacter(CBC_EncoderContext &context, CFX_WideString &buffer, CFX_WideString &removed, FX_INT32 lastCharSize, FX_INT32 &e);
+ static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonBitArray.h b/xfa/src/fxbarcode/src/include/BC_CommonBitArray.h
new file mode 100644
index 0000000000..484d87d5a7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonBitArray.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONBITARRAY_H_
+#define _BC_COMMONBITARRAY_H_
+class CBC_CommonBitArray;
+class CBC_CommonBitArray : public CFX_Object
+{
+public:
+ CBC_CommonBitArray(CBC_CommonBitArray* array);
+ CBC_CommonBitArray(FX_INT32 size);
+ CBC_CommonBitArray();
+ virtual ~CBC_CommonBitArray();
+ FX_INT32 GetSize();
+ CFX_Int32Array& GetBits();
+ FX_INT32 GetSizeInBytes();
+ FX_BOOL Get(FX_INT32 i);
+ void Set(FX_INT32 i);
+ void Flip(FX_INT32 i);
+ void SetBulk(FX_INT32 i, FX_INT32 newBits);
+ FX_BOOL IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e);
+ FX_INT32 *GetBitArray();
+ void Reverse();
+ void Clear();
+private:
+ FX_INT32 m_size;
+ CFX_Int32Array m_bits;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h b/xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h
new file mode 100644
index 0000000000..f69d7a0e33
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h
@@ -0,0 +1,38 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONBITMATRIX_H_
+#define _BC_COMMONBITMATRIX_H_
+class CBC_CommonBitArray;
+class CBC_CommonBitMatrix;
+class CBC_CommonBitMatrix : public CFX_Object
+{
+public:
+ CBC_CommonBitMatrix();
+ virtual ~CBC_CommonBitMatrix();
+ FX_BOOL Get(FX_INT32 x, FX_INT32 y);
+ void Set(FX_INT32 x, FX_INT32 y);
+ void Flip(FX_INT32 x, FX_INT32 y);
+ void Clear();
+ void SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e);
+ CBC_CommonBitArray* GetRow(FX_INT32 y, CBC_CommonBitArray* row);
+ void SetRow(FX_INT32 y, CBC_CommonBitArray* row);
+ CBC_CommonBitArray* GetCol(FX_INT32 y, CBC_CommonBitArray* row);
+ void SetCol(FX_INT32 y, CBC_CommonBitArray* col);
+ FX_INT32 GetWidth();
+ FX_INT32 GetHeight();
+ FX_INT32 GetRowSize();
+ FX_INT32 GetDimension(FX_INT32 &e);
+ virtual void Init(FX_INT32 dimension);
+ virtual void Init(FX_INT32 width, FX_INT32 height);
+ FX_INT32* GetBits();
+private:
+ FX_INT32 m_width;
+ FX_INT32 m_height;
+ FX_INT32 m_rowSize;
+ FX_INT32* m_bits;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonBitSource.h b/xfa/src/fxbarcode/src/include/BC_CommonBitSource.h
new file mode 100644
index 0000000000..53891cf671
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonBitSource.h
@@ -0,0 +1,23 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONBITSOURCE_H_
+#define _BC_COMMONBITSOURCE_H_
+class CBC_CommonBitSource;
+class CBC_CommonBitSource : public CFX_Object
+{
+public:
+ CBC_CommonBitSource(CFX_ByteArray *bytes);
+ virtual ~CBC_CommonBitSource();
+ FX_INT32 ReadBits(FX_INT32 numBits, FX_INT32 &e);
+ FX_INT32 Available();
+ FX_INT32 getByteOffset();
+private:
+ CFX_ByteArray m_bytes;
+ FX_INT32 m_byteOffset;
+ FX_INT32 m_bitOffset;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonByteArray.h b/xfa/src/fxbarcode/src/include/BC_CommonByteArray.h
new file mode 100644
index 0000000000..fe0a67ffd1
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonByteArray.h
@@ -0,0 +1,30 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONBYTEARRAY_H_
+#define _BC_COMMONBYTEARRAY_H_
+class CBC_CommonByteArray;
+class CBC_CommonByteArray : public CFX_Object
+{
+private:
+ FX_INT32 m_size;
+ FX_INT32 m_index;
+ FX_BYTE* m_bytes;
+public:
+ CBC_CommonByteArray();
+ CBC_CommonByteArray(FX_INT32 size);
+ CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size);
+ virtual ~CBC_CommonByteArray();
+ FX_INT32 At(FX_INT32 index);
+ void Set(FX_INT32 index, FX_INT32 value);
+ FX_INT32 Size();
+ FX_BOOL IsEmpty();
+ void AppendByte(FX_INT32 value);
+ void Reserve(FX_INT32 capacity);
+ void Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count);
+ void Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h b/xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h
new file mode 100644
index 0000000000..3d831d1911
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONBYTEMATRIX_H_
+#define _BC_COMMONBYTEMATRIX_H_
+class CBC_CommonByteMatrix;
+class CBC_CommonByteMatrix : public CFX_Object
+{
+public:
+ CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height);
+ virtual ~CBC_CommonByteMatrix();
+ FX_INT32 GetHeight();
+ FX_INT32 GetWidth();
+ FX_BYTE Get(FX_INT32 x, FX_INT32 y);
+ FX_BYTE* GetArray();
+
+ void Set(FX_INT32 x, FX_INT32 y, FX_INT32 value);
+ void Set(FX_INT32 x, FX_INT32 y, FX_BYTE value);
+ void clear(FX_BYTE value);
+ virtual void Init();
+private:
+ FX_BYTE *m_bytes;
+ FX_INT32 m_width;
+ FX_INT32 m_height;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h b/xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h
new file mode 100644
index 0000000000..1e9f9a433f
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONCHARACTERSETECI_H_
+#define _BC_COMMONCHARACTERSETECI_H_
+class CBC_CommonECI;
+class CBC_CommonCharacterSetECI;
+class CBC_CommonCharacterSetECI : public CBC_CommonECI
+{
+public:
+ CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName);
+ virtual ~CBC_CommonCharacterSetECI();
+ CFX_ByteString GetEncodingName();
+ static void AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName);
+ FX_INT32 GetValue();
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(FX_INT32 value);
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByName(const CFX_ByteString& name);
+private:
+ CFX_ByteString m_encodingName;
+ static void initialize();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h b/xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h
new file mode 100644
index 0000000000..808203bd01
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h
@@ -0,0 +1,33 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONDECODERRESULT_H_
+#define _BC_COMMONDECODERRESULT_H_
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_PDF417ResultMetadata;
+class CBC_CommonDecoderResult;
+class CBC_CommonDecoderResult : public CFX_Object
+{
+public:
+ CBC_CommonDecoderResult();
+ virtual ~CBC_CommonDecoderResult();
+ const CFX_ByteArray& GetRawBytes();
+ const CFX_ByteString& GetText();
+ const CFX_Int32Array& GetByteSegments();
+ CBC_QRCoderErrorCorrectionLevel* GetECLevel();
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e);
+ void setOther(CBC_PDF417ResultMetadata* other);
+private:
+ CFX_ByteArray m_rawBytes;
+ CFX_ByteString m_text;
+ CFX_Int32Array m_byteSegments;
+ CFX_PtrArray m_pdf417byteSegments;
+ CBC_QRCoderErrorCorrectionLevel* m_ecLevel;
+ CFX_ByteString m_pdf417ecLevel;
+ CBC_PDF417ResultMetadata* m_other;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonECI.h b/xfa/src/fxbarcode/src/include/BC_CommonECI.h
new file mode 100644
index 0000000000..3907066066
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonECI.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONECI_H_
+#define _BC_COMMONECI_H_
+class CBC_CommonECI;
+class CBC_CommonECI : public CFX_Object
+{
+public:
+ CBC_CommonECI(FX_INT32 value);
+ virtual ~CBC_CommonECI();
+
+ FX_INT32 GetValue();
+ static CBC_CommonECI* GetEICByValue(FX_INT32 value, FX_INT32 &e);
+private:
+ FX_INT32 m_value;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h b/xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h
new file mode 100644
index 0000000000..5c42a1a6a7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h
@@ -0,0 +1,39 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMMONPERSPECTIVETRANSFORM_H_
+#define _BC_COMMONPERSPECTIVETRANSFORM_H_
+class CBC_CommonPerspectiveTransform;
+class CBC_CommonPerspectiveTransform : public CFX_Object
+{
+public:
+ CBC_CommonPerspectiveTransform(FX_FLOAT a11, FX_FLOAT a21, FX_FLOAT a31,
+ FX_FLOAT a12, FX_FLOAT a22, FX_FLOAT a32,
+ FX_FLOAT a13, FX_FLOAT a23, FX_FLOAT a33);
+ virtual ~CBC_CommonPerspectiveTransform();
+ static CBC_CommonPerspectiveTransform *QuadrilateralToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,
+ FX_FLOAT x1, FX_FLOAT y1,
+ FX_FLOAT x2, FX_FLOAT y2,
+ FX_FLOAT x3, FX_FLOAT y3,
+ FX_FLOAT x0p, FX_FLOAT y0p,
+ FX_FLOAT x1p, FX_FLOAT y1p,
+ FX_FLOAT x2p, FX_FLOAT y2p,
+ FX_FLOAT x3p, FX_FLOAT y3p);
+ static CBC_CommonPerspectiveTransform *SquareToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,
+ FX_FLOAT x1, FX_FLOAT y1,
+ FX_FLOAT x2, FX_FLOAT y2,
+ FX_FLOAT x3, FX_FLOAT y3);
+ static CBC_CommonPerspectiveTransform *QuadrilateralToSquare(FX_FLOAT x0, FX_FLOAT y0,
+ FX_FLOAT x1, FX_FLOAT y1,
+ FX_FLOAT x2, FX_FLOAT y2,
+ FX_FLOAT x3, FX_FLOAT y3);
+ CBC_CommonPerspectiveTransform *BuildAdjoint();
+ CBC_CommonPerspectiveTransform *Times(CBC_CommonPerspectiveTransform &other);
+ void TransformPoints(CFX_FloatArray *points);
+private:
+ FX_FLOAT m_a11, m_a12, m_a13, m_a21, m_a22, m_a23, m_a31, m_a32, m_a33;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h
new file mode 100644
index 0000000000..c5f1f3f7a0
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h
@@ -0,0 +1,33 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXBITMATRIXPARSER_H_
+#define _BC_DATAMATRIXBITMATRIXPARSER_H_
+class CBC_CommonBitMatrix;
+class CBC_DataMatrixVersion;
+class CBC_DataMatrixBitMatrixParser;
+class CBC_DataMatrixBitMatrixParser : public CFX_Object
+{
+public:
+ CBC_DataMatrixBitMatrixParser();
+ virtual ~CBC_DataMatrixBitMatrixParser();
+ CBC_DataMatrixVersion *GetVersion();
+ CFX_ByteArray *ReadCodewords(FX_INT32 &e);
+ FX_BOOL ReadModule(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns);
+ FX_INT32 ReadUtah(FX_INT32 row, FX_INT32 column, FX_INT32 numRows, FX_INT32 numColumns);
+ FX_INT32 ReadCorner1(FX_INT32 numRows, FX_INT32 numColumns);
+ FX_INT32 ReadCorner2(FX_INT32 numRows, FX_INT32 numColumns);
+ FX_INT32 ReadCorner3(FX_INT32 numRows, FX_INT32 numColumns);
+ FX_INT32 ReadCorner4(FX_INT32 numRows, FX_INT32 numColumns);
+ CBC_CommonBitMatrix *ExtractDataRegion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+ virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+private:
+ static CBC_DataMatrixVersion* ReadVersion(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+ CBC_CommonBitMatrix *m_mappingBitMatrix;
+ CBC_CommonBitMatrix *m_readMappingMatrix;
+ CBC_DataMatrixVersion *m_version;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h
new file mode 100644
index 0000000000..1dd62fe1fe
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h
@@ -0,0 +1,26 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXDATABLOCK_H_
+#define _BC_DATAMATRIXDATABLOCK_H_
+class CBC_DataMatrixVersion;
+class CBC_DataMatrixDataBlock;
+class CBC_DataMatrixDataBlock : public CFX_Object
+{
+public:
+ virtual ~CBC_DataMatrixDataBlock();
+
+ FX_INT32 GetNumDataCodewords();
+ CFX_ByteArray* GetCodewords();
+
+ static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords, CBC_DataMatrixVersion *version, FX_INT32 &e);
+private:
+ FX_INT32 m_numDataCodewords;
+ CFX_ByteArray m_codewords;
+
+ CBC_DataMatrixDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h
new file mode 100644
index 0000000000..060972d53a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h
@@ -0,0 +1,43 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXDECODEDBITSTREAMPARSER_H_
+#define _BC_DATAMATRIXDECODEDBITSTREAMPARSER_H_
+class CBC_CommonDecoderResult;
+class CBC_CommonBitSource;
+class CBC_DataMatrixDecodedBitStreamParser;
+class CBC_DataMatrixDecodedBitStreamParser : public CFX_Object
+{
+public:
+ CBC_DataMatrixDecodedBitStreamParser();
+ virtual ~CBC_DataMatrixDecodedBitStreamParser();
+ static CBC_CommonDecoderResult *Decode(CFX_ByteArray &bytes, FX_INT32 &e);
+
+private:
+ static FX_INT32 DecodeAsciiSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_ByteString &resultTrailer, FX_INT32 &e);
+ static void DecodeC40Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
+ static void DecodeTextSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
+ static void DecodeAnsiX12Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
+ static void ParseTwoBytes(FX_INT32 firstByte, FX_INT32 secondByte, CFX_Int32Array &result);
+ static void DecodeEdifactSegment(CBC_CommonBitSource *bits, CFX_ByteString &result, FX_INT32 &e);
+ static void DecodeBase256Segment(CBC_CommonBitSource *bits, CFX_ByteString &result, CFX_Int32Array &byteSegments, FX_INT32 &e);
+ static FX_BYTE Unrandomize255State(FX_INT32 randomizedBase256Codeword, FX_INT32 base256CodewordPosition);
+
+ const static FX_CHAR C40_BASIC_SET_CHARS[];
+ const static FX_CHAR C40_SHIFT2_SET_CHARS[];
+
+
+ const static FX_CHAR TEXT_BASIC_SET_CHARS[];
+ const static FX_CHAR TEXT_SHIFT3_SET_CHARS[];
+ const static FX_INT32 PAD_ENCODE;
+ const static FX_INT32 ASCII_ENCODE;
+ const static FX_INT32 C40_ENCODE;
+ const static FX_INT32 TEXT_ENCODE;
+ const static FX_INT32 ANSIX12_ENCODE;
+ const static FX_INT32 EDIFACT_ENCODE;
+ const static FX_INT32 BASE256_ENCODE;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h
new file mode 100644
index 0000000000..44f7efc7b7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXDECODER_H_
+#define _BC_DATAMATRIXDECODER_H_
+class CBC_ReedSolomonDecoder;
+class CBC_CommonDecoderResult;
+class CBC_CommonBitMatrix;
+class CBC_DataMatrixDecoder;
+class CBC_DataMatrixDecoder : public CFX_Object
+{
+public:
+ CBC_DataMatrixDecoder();
+ virtual ~CBC_DataMatrixDecoder();
+ CBC_CommonDecoderResult *Decode(CBC_CommonBitMatrix *bits, FX_INT32 &e);
+ virtual void Init();
+private:
+ void CorrectErrors(CFX_ByteArray &codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e);
+ CBC_ReedSolomonDecoder *m_rsDecoder;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h
new file mode 100644
index 0000000000..2d3ca744fe
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h
@@ -0,0 +1,78 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXDETECTOR_H_
+#define _BC_DATAMATRIXDETECTOR_H_
+class CBC_CommonBitMatrix;
+class CBC_WhiteRectangleDetector;
+class CBC_ResultPoint;
+class CBC_QRDetectorResult;
+class CBC_DataMatrixDetector;
+class ResultPointsAndTransitions;
+class CBC_ResultPointsAndTransitions : public CFX_Object
+{
+public:
+ CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, FX_INT32 transitions)
+ {
+ m_from = from;
+ m_to = to;
+ m_transitions = transitions;
+ }
+ ~CBC_ResultPointsAndTransitions()
+ {
+ }
+ CBC_ResultPoint *GetFrom()
+ {
+ return m_from;
+ }
+ CBC_ResultPoint *GetTo()
+ {
+ return m_to;
+ }
+ FX_INT32 GetTransitions()
+ {
+ return m_transitions;
+ }
+private:
+ CBC_ResultPoint *m_from;
+ CBC_ResultPoint *m_to;
+ FX_INT32 m_transitions;
+};
+class CBC_DataMatrixDetector
+{
+public:
+ CBC_DataMatrixDetector(CBC_CommonBitMatrix *image);
+ virtual ~CBC_DataMatrixDetector();
+ CBC_QRDetectorResult *Detect(FX_INT32 &e);
+ CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft,
+ CBC_ResultPoint *bottomRight,
+ CBC_ResultPoint *topLeft,
+ CBC_ResultPoint *topRight,
+ FX_INT32 dimensionTop, FX_INT32 dimensionRight);
+ CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft,
+ CBC_ResultPoint *bottomRight,
+ CBC_ResultPoint *topLeft,
+ CBC_ResultPoint *topRight,
+ FX_INT32 dimension);
+ CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image,
+ CBC_ResultPoint *topLeft,
+ CBC_ResultPoint *bottomLeft,
+ CBC_ResultPoint *bottomRight,
+ CBC_ResultPoint *topRight,
+ FX_INT32 dimensionX, FX_INT32 dimensionY, FX_INT32 &e);
+ CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CBC_ResultPoint *to);
+ FX_BOOL IsValid(CBC_ResultPoint *p);
+ FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b);
+ void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> &table, CBC_ResultPoint *key);
+ FX_INT32 Round(FX_FLOAT d);
+ void OrderBestPatterns(CFX_PtrArray *patterns);
+ virtual void Init(FX_INT32 &e);
+private:
+ CBC_CommonBitMatrix *m_image;
+ CBC_WhiteRectangleDetector *m_rectangleDetector;
+ const static FX_INT32 INTEGERS[5];
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h
new file mode 100644
index 0000000000..4301512d70
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXREADER_H_
+#define _BC_DATAMATRIXREADER_H_
+class CBC_BinaryBitmap;
+class CBC_DataMatrixDecoder;
+class CBC_Reader;
+class CBC_DataMatrixReader;
+class CBC_DataMatrixReader : public CBC_Reader
+{
+public:
+ CBC_DataMatrixReader();
+ virtual ~CBC_DataMatrixReader();
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, int hints, FX_INT32 &e);
+
+ virtual void Init();
+private:
+ CBC_DataMatrixDecoder *m_decoder;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h
new file mode 100644
index 0000000000..e749b27d86
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h
@@ -0,0 +1,19 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXSYMBOLINFO144_H_
+#define _BC_DATAMATRIXSYMBOLINFO144_H_
+class CBC_SymbolInfo;
+class CBC_DataMatrixSymbolInfo144;
+class CBC_DataMatrixSymbolInfo144 : public CBC_SymbolInfo
+{
+public:
+ CBC_DataMatrixSymbolInfo144();
+ virtual ~CBC_DataMatrixSymbolInfo144();
+ FX_INT32 getInterleavedBlockCount();
+ FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h
new file mode 100644
index 0000000000..41d2f23db6
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h
@@ -0,0 +1,101 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXVERSION_H_
+#define _BC_DATAMATRIXVERSION_H_
+class ECB;
+class ECBlocks;
+class CBC_DataMatrixVersion;
+class ECB : public CFX_Object
+{
+public:
+ ECB(FX_INT32 count, FX_INT32 dataCodewords)
+ {
+ m_count = count;
+ m_dataCodewords = dataCodewords;
+ }
+
+ FX_INT32 GetCount()
+ {
+ return m_count;
+ }
+
+ FX_INT32 GetDataCodewords()
+ {
+ return m_dataCodewords;
+ }
+private:
+ FX_INT32 m_count;
+ FX_INT32 m_dataCodewords;
+};
+class ECBlocks : public CFX_Object
+{
+public:
+ ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks)
+ {
+ m_ecCodewords = ecCodewords;
+ m_ecBlocks.Add(ecBlocks);
+ }
+
+ ECBlocks(FX_INT32 ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2)
+ {
+ m_ecCodewords = ecCodewords;
+ m_ecBlocks.Add(ecBlocks1);
+ m_ecBlocks.Add(ecBlocks2);
+ }
+ ~ECBlocks()
+ {
+ for(FX_INT32 i = 0; i < m_ecBlocks.GetSize(); i++) {
+ delete (ECB*)m_ecBlocks[i];
+ }
+ m_ecBlocks.RemoveAll();
+ }
+
+ FX_INT32 GetECCodewords()
+ {
+ return m_ecCodewords;
+ }
+
+ const CFX_PtrArray &GetECBlocks()
+ {
+ return m_ecBlocks;
+ }
+private:
+ FX_INT32 m_ecCodewords;
+ CFX_PtrArray m_ecBlocks;
+};
+class CBC_DataMatrixVersion : public CFX_Object
+{
+public:
+ CBC_DataMatrixVersion(FX_INT32 versionNumber,
+ FX_INT32 symbolSizeRows,
+ FX_INT32 symbolSizeColumns,
+ FX_INT32 dataRegionSizeRows,
+ FX_INT32 dataRegionSizeColumns,
+ ECBlocks *ecBlocks);
+ virtual ~CBC_DataMatrixVersion();
+ static void Initialize();
+ static void Finalize();
+ FX_INT32 GetVersionNumber();
+ FX_INT32 GetSymbolSizeRows();
+ FX_INT32 GetSymbolSizeColumns();
+ FX_INT32 GetDataRegionSizeRows();
+ FX_INT32 GetDataRegionSizeColumns();
+ FX_INT32 GetTotalCodewords();
+ ECBlocks *GetECBlocks();
+ static CBC_DataMatrixVersion *GetVersionForDimensions(FX_INT32 numRows, FX_INT32 numColumns, FX_INT32 &e);
+ static void ReleaseAll();
+private:
+ FX_INT32 m_versionNumber;
+ FX_INT32 m_symbolSizeRows;
+ FX_INT32 m_symbolSizeColumns;
+ FX_INT32 m_dataRegionSizeRows;
+ FX_INT32 m_dataRegionSizeColumns;
+ ECBlocks *m_ecBlocks;
+ FX_INT32 m_totalCodewords;
+ static CFX_PtrArray* VERSIONS;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h b/xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h
new file mode 100644
index 0000000000..c8a6bdd823
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h
@@ -0,0 +1,30 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DATAMATRIXWRITER_H_
+#define _BC_DATAMATRIXWRITER_H_
+class CBC_CommonByteMatrix;
+class CBC_CommonBitMatrix;
+class CBC_DefaultPlacement;
+class CBC_SymbolShapeHint;
+class CBC_SymbolInfo;
+class CBC_TwoDimWriter;
+class CBC_DataMatrixWriter;
+class CBC_DataMatrixWriter : public CBC_TwoDimWriter
+{
+public:
+ CBC_DataMatrixWriter();
+ virtual ~CBC_DataMatrixWriter();
+ FX_BYTE* Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BOOL SetErrorCorrectionLevel (FX_INT32 level);
+
+private:
+ static CBC_CommonByteMatrix* encodeLowLevel(CBC_DefaultPlacement* placement, CBC_SymbolInfo* symbolInfo, FX_INT32 &e);
+ FX_INT32 m_iCorrectLevel;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DecoderResult.h b/xfa/src/fxbarcode/src/include/BC_DecoderResult.h
new file mode 100644
index 0000000000..ff98b2c407
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DecoderResult.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DECODERRESULT_H_
+#define _BC_DECODERRESULT_H_
+class CBC_DecoderResult;
+class CBC_DecoderResult : public CFX_Object
+{
+public:
+ CBC_DecoderResult(CFX_ByteArray* rawBytes, CFX_ByteString text, CFX_ByteString ecLevel);
+ virtual ~CBC_DecoderResult();
+ CFX_ByteArray* getRawBytes();
+ CFX_ByteString getText();
+ CFX_ByteString getECLevel();
+ FX_INT32 getErrorsCorrected();
+ void setErrorsCorrected(FX_INT32 errorsCorrected);
+ FX_INT32 getErasures();
+ void setErasures(FX_INT32 erasures);
+ CFX_Object* getOther();
+ void setOther(CFX_Object* other);
+private:
+ CFX_ByteArray* m_rawBytes;
+ CFX_ByteString m_text;
+ CFX_ByteString m_ecLevel;
+ FX_INT32 m_errorsCorrected;
+ FX_INT32 m_erasures;
+ CFX_Object* m_other;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h b/xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h
new file mode 100644
index 0000000000..ba2da03408
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DEFAULTPLACEMENT_H_
+#define _BC_DEFAULTPLACEMENT_H_
+class CBC_DefaultPlacement;
+class CBC_DefaultPlacement : public CFX_Object
+{
+public:
+ CBC_DefaultPlacement(CFX_WideString codewords, FX_INT32 numcols, FX_INT32 numrows);
+ virtual ~CBC_DefaultPlacement();
+
+ FX_INT32 getNumrows();
+ FX_INT32 getNumcols();
+ CFX_ByteArray& getBits();
+ FX_BOOL getBit(FX_INT32 col, FX_INT32 row);
+ void setBit(FX_INT32 col, FX_INT32 row, FX_BOOL bit);
+ FX_BOOL hasBit(FX_INT32 col, FX_INT32 row);
+ void place();
+private:
+ CFX_WideString m_codewords;
+ FX_INT32 m_numrows;
+ FX_INT32 m_numcols;
+ CFX_ByteArray m_bits;
+ void module(FX_INT32 row, FX_INT32 col, FX_INT32 pos, FX_INT32 bit);
+ void utah(FX_INT32 row, FX_INT32 col, FX_INT32 pos);
+ void corner1(FX_INT32 pos);
+ void corner2(FX_INT32 pos);
+ void corner3(FX_INT32 pos);
+ void corner4(FX_INT32 pos);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Dimension.h b/xfa/src/fxbarcode/src/include/BC_Dimension.h
new file mode 100644
index 0000000000..ff4aecace4
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Dimension.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DIMENSION_H_
+#define _BC_DIMENSION_H_
+class CBC_Dimension;
+class CBC_Dimension : public CFX_Object
+{
+public:
+ CBC_Dimension();
+ CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e);
+ virtual ~CBC_Dimension();
+ FX_INT32 getWidth();
+ FX_INT32 getHeight();
+ FX_INT32 hashCode();
+ CFX_WideString toString();
+private:
+ FX_INT32 m_width;
+ FX_INT32 m_height;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h b/xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h
new file mode 100644
index 0000000000..7e2453a71d
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h
@@ -0,0 +1,23 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_EDIFACTENCODER_H_
+#define _BC_EDIFACTENCODER_H_
+class CBC_EncoderContext;
+class CBC_EdifactEncoder;
+class CBC_EdifactEncoder : public CBC_Encoder
+{
+public:
+ CBC_EdifactEncoder();
+ virtual ~CBC_EdifactEncoder();
+ FX_INT32 getEncodingMode();
+ void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+private:
+ static void handleEOD(CBC_EncoderContext &context, CFX_WideString buffer, FX_INT32 &e);
+ static void encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+ static CFX_WideString encodeToCodewords(CFX_WideString sb, FX_INT32 startPos, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Encoder.h b/xfa/src/fxbarcode/src/include/BC_Encoder.h
new file mode 100644
index 0000000000..10ac8763e5
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Encoder.h
@@ -0,0 +1,19 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ENCODER_H_
+#define _BC_ENCODER_H_
+class CBC_EncoderContext;
+class CBC_Encoder;
+class CBC_Encoder : public CFX_Object
+{
+public:
+ CBC_Encoder();
+ virtual ~CBC_Encoder();
+ virtual FX_INT32 getEncodingMode() = 0;
+ virtual void Encode(CBC_EncoderContext &context, FX_INT32 &e) = 0;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_EncoderContext.h b/xfa/src/fxbarcode/src/include/BC_EncoderContext.h
new file mode 100644
index 0000000000..0099dbc9f0
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_EncoderContext.h
@@ -0,0 +1,48 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ENCODERCONTEXT_H_
+#define _BC_ENCODERCONTEXT_H_
+class CBC_SymbolShapeHint;
+class CBC_SymbolInfo;
+class CBC_Dimension;
+class CBC_EncoderContext;
+class CBC_EncoderContext : public CBC_SymbolShapeHint
+{
+public:
+ CBC_EncoderContext(const CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e);
+ virtual ~CBC_EncoderContext();
+ void setSymbolShape(SymbolShapeHint shape);
+ void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize);
+ CFX_WideString getMessage();
+ void setSkipAtEnd(FX_INT32 count);
+ FX_WCHAR getCurrentChar();
+ FX_WCHAR getCurrent();
+ void writeCodewords(CFX_WideString codewords);
+ void writeCodeword(FX_WCHAR codeword);
+ FX_INT32 getCodewordCount();
+ void signalEncoderChange(FX_INT32 encoding);
+ void resetEncoderSignal();
+ FX_BOOL hasMoreCharacters();
+ FX_INT32 getRemainingCharacters();
+ void updateSymbolInfo(FX_INT32 &e);
+ void updateSymbolInfo(FX_INT32 len, FX_INT32 &e);
+ void resetSymbolInfo();
+public:
+ CFX_WideString m_msg;
+ CFX_WideString m_codewords;
+ FX_INT32 m_pos;
+ FX_INT32 m_newEncoding;
+ CBC_SymbolInfo* m_symbolInfo;
+private:
+ FX_INT32 getTotalMessageCharCount();
+private:
+ SymbolShapeHint m_shape;
+ CBC_Dimension* m_minSize;
+ CBC_Dimension* m_maxSize;
+ FX_INT32 m_skipAtEnd;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h b/xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h
new file mode 100644
index 0000000000..973ff33b8e
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ERRORCORRECTION_H_
+#define _BC_ERRORCORRECTION_H_
+class CBC_SymbolInfo;
+class CBC_ErrorCorrection;
+class CBC_ErrorCorrection : public CFX_Object
+{
+public:
+ CBC_ErrorCorrection();
+ virtual ~CBC_ErrorCorrection();
+ static void Initialize();
+ static void Finalize();
+ static CFX_WideString encodeECC200(CFX_WideString codewords, CBC_SymbolInfo* symbolInfo, FX_INT32 &e);
+private:
+ static FX_INT32 FACTOR_SETS[];
+ static FX_INT32 FACTORS[][100];
+ static FX_INT32 MODULO_VALUE;
+ static FX_INT32 LOG[256];
+ static FX_INT32 ALOG[256];
+private:
+ static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 numECWords, FX_INT32 &e);
+ static CFX_WideString createECCBlock(CFX_WideString codewords, FX_INT32 start, FX_INT32 len, FX_INT32 numECWords, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h b/xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h
new file mode 100644
index 0000000000..bac9291947
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_FINDERPATTERNINFO_H_
+#define _BC_FINDERPATTERNINFO_H_
+class CBC_QRFinderPattern;
+class CBC_QRFinderPatternInfo;
+class CBC_QRFinderPatternInfo : public CFX_Object
+{
+private:
+ CBC_QRFinderPattern *m_bottomLeft;
+ CBC_QRFinderPattern *m_topLeft;
+ CBC_QRFinderPattern *m_topRight;
+public:
+ CBC_QRFinderPatternInfo(CFX_PtrArray *patternCenters);
+ virtual ~CBC_QRFinderPatternInfo();
+ CBC_QRFinderPattern* GetBottomLeft();
+ CBC_QRFinderPattern* GetTopLeft();
+ CBC_QRFinderPattern* GetTopRight();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h b/xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h
new file mode 100644
index 0000000000..ef084c075e
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h
@@ -0,0 +1,28 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_GLOBALHISTOGRAMBINARIZER_H_
+#define _BC_GLOBALHISTOGRAMBINARIZER_H_
+class CBC_CommonBinarizer;
+class CBC_CommonBitArray;
+class CBC_CommonBitMatrix;
+class CBC_LuminanceSource;
+class CBC_GlobalHistogramBinarizer;
+class CBC_GlobalHistogramBinarizer : public CBC_Binarizer
+{
+public:
+ CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source);
+ virtual ~CBC_GlobalHistogramBinarizer();
+
+ void InitArrays(FX_INT32 luminanceSize);
+ CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e);
+ CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);
+ static FX_INT32 EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e);
+private:
+ CFX_ByteArray m_luminance;
+ CFX_Int32Array m_buckets;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h b/xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h
new file mode 100644
index 0000000000..170ca9f8fa
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h
@@ -0,0 +1,60 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_HIGHLEVALENCODER_H_
+#define _BC_HIGHLEVALENCODER_H_
+class CBC_SymbolShapeHint;
+class CBC_HighLevelEncoder;
+#define ASCII_ENCODATION 0
+#define C40_ENCODATION 1
+#define TEXT_ENCODATION 2
+#define X12_ENCODATION 3
+#define EDIFACT_ENCODATION 4
+#define BASE256_ENCODATION 5
+class CBC_HighLevelEncoder : public CBC_SymbolShapeHint
+{
+public:
+ CBC_HighLevelEncoder();
+ virtual ~CBC_HighLevelEncoder();
+ CFX_ByteArray& getBytesForMessage(CFX_WideString msg);
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, FX_INT32 &e);
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, CFX_WideString ecLevel, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_INT32 &e);
+ static FX_INT32 lookAheadTest(CFX_WideString msg, FX_INT32 startpos, FX_INT32 currentMode);
+ static FX_BOOL isDigit(FX_WCHAR ch);
+ static FX_BOOL isExtendedASCII(FX_WCHAR ch);
+ static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos);
+ static void illegalCharacter(FX_WCHAR c, FX_INT32 &e);
+
+public:
+ static FX_WCHAR LATCH_TO_C40;
+ static FX_WCHAR LATCH_TO_BASE256;
+ static FX_WCHAR UPPER_SHIFT;
+ static FX_WCHAR LATCH_TO_ANSIX12;
+ static FX_WCHAR LATCH_TO_TEXT;
+ static FX_WCHAR LATCH_TO_EDIFACT;
+ static FX_WCHAR C40_UNLATCH;
+ static FX_WCHAR X12_UNLATCH;
+private:
+ static FX_WCHAR PAD;
+ static FX_WCHAR MACRO_05;
+ static FX_WCHAR MACRO_06;
+ static const wchar_t* MACRO_05_HEADER;
+ static const wchar_t* MACRO_06_HEADER;
+ static const wchar_t MACRO_TRAILER;
+ CFX_ByteArray m_bytearray;
+private:
+ static FX_WCHAR randomize253State(FX_WCHAR ch, FX_INT32 codewordPosition);
+ static FX_INT32 findMinimums(CFX_FloatArray &charCounts, CFX_Int32Array &intCharCounts, FX_INT32 min, CFX_ByteArray &mins);
+ static FX_INT32 getMinimumCount(CFX_ByteArray &mins);
+ static FX_BOOL isNativeC40(FX_WCHAR ch);
+ static FX_BOOL isNativeText(FX_WCHAR ch);
+ static FX_BOOL isNativeX12(FX_WCHAR ch);
+ static FX_BOOL isX12TermSep(FX_WCHAR ch);
+ static FX_BOOL isNativeEDIFACT(FX_WCHAR ch);
+ static FX_BOOL isSpecialB256(FX_WCHAR ch);
+
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_LuminanceSource.h b/xfa/src/fxbarcode/src/include/BC_LuminanceSource.h
new file mode 100644
index 0000000000..6aa85101c9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_LuminanceSource.h
@@ -0,0 +1,34 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_LUMINANCESOURCE_H
+#define _BC_LUMINANCESOURCE_H
+class CBC_LuminanceSource;
+class CBC_LuminanceSource : public CFX_Object
+{
+public:
+ CBC_LuminanceSource(FX_INT32 width, FX_INT32 height);
+ virtual ~CBC_LuminanceSource();
+ FX_INT32 GetWidth();
+ FX_INT32 GetHeight();
+
+ virtual CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e) = 0;
+ virtual CFX_ByteArray *GetMatrix() = 0;
+ virtual FX_BOOL IsCropSupported()
+ {
+ return FALSE;
+ }
+ virtual FX_BOOL IsRotateSupported()
+ {
+ return FALSE;
+ }
+
+ virtual CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e) = 0;
+protected:
+ FX_INT32 m_width;
+ FX_INT32 m_height;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OneDReader.h b/xfa/src/fxbarcode/src/include/BC_OneDReader.h
new file mode 100644
index 0000000000..8645c9edf9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OneDReader.h
@@ -0,0 +1,34 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDREADER_H_
+#define _BC_ONEDREADER_H_
+class CBC_Reader;
+class CBC_BinaryBitmap;
+class CBC_CommonBitArray;
+class CBC_OneDReader;
+class CBC_OneDReader : public CBC_Reader
+{
+public:
+ CBC_OneDReader();
+ virtual ~CBC_OneDReader();
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e)
+ {
+ return "";
+ }
+private:
+ CFX_ByteString DeDecode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+
+protected:
+ const static FX_INT32 INTEGER_MATH_SHIFT;
+ const static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR;
+ void RecordPattern(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e);
+ void RecordPatternInReverse(CBC_CommonBitArray *row, FX_INT32 start, CFX_Int32Array *counters, FX_INT32 &e);
+ FX_INT32 PatternMatchVariance(CFX_Int32Array *counters, const FX_INT32 *pattern, FX_INT32 maxIndividualVariance);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OneDimReader.h b/xfa/src/fxbarcode/src/include/BC_OneDimReader.h
new file mode 100644
index 0000000000..bb10060ba3
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OneDimReader.h
@@ -0,0 +1,39 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDUPCEANREADER_H_
+#define _BC_ONEDUPCEANREADER_H_
+class CBC_OneDReader;
+class CBC_CommonBitArray;
+class CBC_OneDimReader;
+class CBC_OneDimReader : public CBC_OneDReader
+{
+private:
+ const static FX_INT32 MAX_AVG_VARIANCE;
+ const static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
+
+ FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString &s, FX_INT32 &e);
+public:
+ const static FX_INT32 START_END_PATTERN[3];
+ const static FX_INT32 MIDDLE_PATTERN[5];
+ const static FX_INT32 L_PATTERNS[10][4];
+ const static FX_INT32 L_AND_G_PATTERNS[20][4];
+ CBC_OneDimReader();
+ virtual ~CBC_OneDimReader();
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e);
+protected:
+ CFX_Int32Array *FindStartGuardPattern(CBC_CommonBitArray *row, FX_INT32 &e);
+ virtual FX_BOOL CheckChecksum(CFX_ByteString &s, FX_INT32 &e);
+ CFX_Int32Array *FindGuardPattern(CBC_CommonBitArray *row, FX_INT32 rowOffset, FX_BOOL whiteFirst, CFX_Int32Array *pattern, FX_INT32 &e);
+ FX_INT32 DecodeDigit(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, const FX_INT32* patterns, FX_INT32 patternLength, FX_INT32 &e);
+ virtual FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultResult, FX_INT32 &e)
+ {
+ return 0;
+ }
+ virtual CFX_Int32Array *DecodeEnd(CBC_CommonBitArray *row, FX_INT32 endStart, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OneDimWriter.h b/xfa/src/fxbarcode/src/include/BC_OneDimWriter.h
new file mode 100644
index 0000000000..cd5d937aca
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OneDimWriter.h
@@ -0,0 +1,70 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDIMWRITER_H_
+#define _BC_ONEDIMWRITER_H_
+class CBC_Writer;
+class CBC_CommonBitMatrix;
+class CBC_OneDimWriter;
+class CBC_OneDimWriter : public CBC_Writer
+{
+public:
+ CBC_OneDimWriter();
+ virtual ~CBC_OneDimWriter();
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ virtual FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e)
+ {
+ return NULL;
+ };
+ virtual void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_WSTR contents, FX_INT32 &e);
+ virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_WSTR contents, FX_INT32 &e);
+ virtual FX_BOOL CheckContentValidity(FX_WSTR contents)
+ {
+ return TRUE;
+ };
+ virtual CFX_WideString FilterContents(FX_WSTR contents)
+ {
+ return CFX_WideString();
+ }
+ virtual CFX_WideString RenderTextContents(FX_WSTR contents)
+ {
+ return CFX_WideString();
+ }
+ virtual void SetPrintChecksum(FX_BOOL checksum);
+ virtual void SetDataLength(FX_INT32 length);
+ virtual void SetCalcChecksum(FX_INT32 state);
+ virtual void SetFontSize(FX_FLOAT size);
+ virtual void SetFontStyle(FX_INT32 style);
+ virtual void SetFontColor(FX_ARGB color);
+ virtual FX_BOOL SetFont(CFX_Font * cFont);
+protected:
+ FX_BOOL m_bPrintChecksum;
+ FX_INT32 m_iDataLenth;
+ FX_BOOL m_bCalcChecksum;
+ CFX_Font* m_pFont;
+ FX_FLOAT m_fFontSize;
+ FX_INT32 m_iFontStyle;
+ FX_DWORD m_fontColor;
+ BC_TEXT_LOC m_locTextLoc;
+ FX_INT32 m_iContentLen;
+ FX_BOOL m_bLeftPadding;
+ FX_BOOL m_bRightPadding;
+ CBC_CommonBitMatrix* m_output;
+ FX_INT32 m_barWidth;
+ FX_INT32 m_multiple;
+ FX_FLOAT m_outputHScale;
+ void CalcTextInfo(const CFX_ByteString &text, FXTEXT_CHARPOS *charPos, CFX_Font *cFont, FX_FLOAT geWidth, FX_INT32 fontSize, FX_FLOAT &charsLen);
+ virtual void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice *device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+ virtual void ShowBitmapChars(CFX_DIBitmap *pOutBitmap, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth);
+ virtual void ShowDeviceChars(CFX_RenderDevice *device, const CFX_Matrix* matrix, const CFX_ByteString str, FX_FLOAT geWidth, FXTEXT_CHARPOS* pCharPos, FX_FLOAT locX, FX_FLOAT locY, FX_INT32 barWidth);
+ FX_INT32 AppendPattern(FX_BYTE* target, FX_INT32 pos, const FX_INT32* pattern, FX_INT32 patternLength, FX_INT32 startColor, FX_INT32 &e);
+ FX_WCHAR Upper(FX_WCHAR ch);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h b/xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h
new file mode 100644
index 0000000000..1d03491841
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h
@@ -0,0 +1,30 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODABARREADER_H_
+#define _BC_ONEDCODABARREADER_H_
+class CBC_CommonBitArray;
+class CBC_OneDReader;
+class CBC_OnedCodaBarReader;
+class CBC_OnedCodaBarReader : public CBC_OneDReader
+{
+public:
+ CBC_OnedCodaBarReader();
+ virtual ~CBC_OnedCodaBarReader();
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+ CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e);
+ FX_BOOL ArrayContains(const FX_CHAR array[], FX_CHAR key);
+ FX_CHAR ToNarrowWidePattern(CFX_Int32Array *counter);
+ static FX_LPCSTR ALPHABET_STRING;
+
+
+ const static FX_INT32 CHARACTER_ENCODINGS[22];
+
+ const static FX_INT32 minCharacterLength;
+
+ const static FX_CHAR STARTEND_ENCODING[8];
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h b/xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h
new file mode 100644
index 0000000000..b81839ca4a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h
@@ -0,0 +1,38 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODABARWRITER_H_
+#define _BC_ONEDCODABARWRITER_H_
+enum BC_TEXT_LOC;
+class CBC_OneDimWriter;
+class CBC_OnedCodaBarWriter;
+class CBC_OnedCodaBarWriter : public CBC_OneDimWriter
+{
+public:
+ CBC_OnedCodaBarWriter();
+ virtual ~CBC_OnedCodaBarWriter();
+ FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ CFX_WideString encodedContents(FX_WSTR contents);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ FX_BOOL SetStartChar(FX_CHAR start);
+ FX_BOOL SetEndChar(FX_CHAR end);
+ void SetDataLength(FX_INT32 length);
+ FX_BOOL SetTextLocation(BC_TEXT_LOC location);
+ FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+ FX_BOOL FindChar(FX_WCHAR ch, FX_BOOL isContent);
+private:
+ void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ const static FX_CHAR START_END_CHARS[];
+ const static FX_CHAR CONTENT_CHARS[];
+ FX_CHAR m_chStart;
+ FX_CHAR m_chEnd;
+ FX_INT32 m_iWideNarrRatio;
+
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h b/xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h
new file mode 100644
index 0000000000..94e1a6388b
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h
@@ -0,0 +1,40 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODA128READER_H_
+#define _BC_ONEDCODA128READER_H_
+class CBC_OneDReader;
+class CBC_CommonBitArray;
+class CBC_OnedCoda128Reader;
+class CBC_OnedCode128Reader : public CBC_OneDReader
+{
+public:
+ CBC_OnedCode128Reader();
+ virtual ~CBC_OnedCode128Reader();
+ virtual CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+ const static FX_INT32 CODE_PATTERNS[107][7];
+ const static FX_INT32 MAX_AVG_VARIANCE;
+ const static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
+
+ const static FX_INT32 CODE_SHIFT;
+ const static FX_INT32 CODE_CODE_C;
+ const static FX_INT32 CODE_CODE_B;
+ const static FX_INT32 CODE_CODE_A;
+ const static FX_INT32 CODE_FNC_1;
+ const static FX_INT32 CODE_FNC_2;
+ const static FX_INT32 CODE_FNC_3;
+ const static FX_INT32 CODE_FNC_4_A;
+ const static FX_INT32 CODE_FNC_4_B ;
+
+ const static FX_INT32 CODE_START_A;
+ const static FX_INT32 CODE_START_B;
+ const static FX_INT32 CODE_START_C;
+ const static FX_INT32 CODE_STOP;
+private:
+ CFX_Int32Array *FindStartPattern(CBC_CommonBitArray *row, FX_INT32 &e);
+ FX_INT32 DecodeCode(CBC_CommonBitArray *row, CFX_Int32Array *counters, FX_INT32 rowOffset, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h b/xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h
new file mode 100644
index 0000000000..daa48eca51
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h
@@ -0,0 +1,37 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODA128WRITER_H_
+#define _BC_ONEDCODA128WRITER_H_
+class CBC_OneDimWriter;
+class CBC_OnedCoda128Writer;
+class CBC_OnedCode128Writer : public CBC_OneDimWriter
+{
+public:
+ CBC_OnedCode128Writer();
+ CBC_OnedCode128Writer(BC_TYPE type);
+ virtual ~CBC_OnedCode128Writer();
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength , FX_INT32 &e);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ FX_BOOL SetTextLocation(BC_TEXT_LOC location);
+ BC_TYPE GetType();
+private:
+ FX_BOOL IsDigits(const CFX_ByteString &contents, FX_INT32 start, FX_INT32 length);
+ FX_INT32 Encode128B(const CFX_ByteString &contents, CFX_PtrArray &patterns);
+ FX_INT32 Encode128C(const CFX_ByteString &contents, CFX_PtrArray &patterns);
+ BC_TYPE m_codeFormat;
+ const static FX_INT32 CODE_START_B;
+ const static FX_INT32 CODE_START_C;
+ const static FX_INT32 CODE_CODE_B;
+ const static FX_INT32 CODE_CODE_C;
+ const static FX_INT32 CODE_STOP;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h b/xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h
new file mode 100644
index 0000000000..81fd6b79e9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODA39READER_H_
+#define _BC_ONEDCODA39READER_H_
+class CBC_OneDReader;
+class CBC_CommonBitArray;
+class CBC_OnedCoda39Reader;
+class CBC_OnedCode39Reader : public CBC_OneDReader
+{
+public:
+ static FX_LPCSTR ALPHABET_STRING;
+ static FX_LPCSTR CHECKSUM_STRING;
+ const static FX_INT32 CHARACTER_ENCODINGS[44];
+ const static FX_INT32 ASTERISK_ENCODING;
+ CBC_OnedCode39Reader();
+ CBC_OnedCode39Reader(FX_BOOL usingCheckDigit);
+ CBC_OnedCode39Reader(FX_BOOL usingCheckDigit, FX_BOOL extendedMode);
+ virtual ~CBC_OnedCode39Reader();
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+private:
+ FX_BOOL m_usingCheckDigit;
+ FX_BOOL m_extendedMode;
+ CFX_Int32Array *FindAsteriskPattern(CBC_CommonBitArray *row, FX_INT32 &e);
+ FX_INT32 ToNarrowWidePattern(CFX_Int32Array *counters);
+ FX_CHAR PatternToChar(FX_INT32 pattern, FX_INT32 &e);
+ CFX_ByteString DecodeExtended(CFX_ByteString &encoded, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h b/xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h
new file mode 100644
index 0000000000..b37d9d8e19
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h
@@ -0,0 +1,37 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDCODA39WRITER_H_
+#define _BC_ONEDCODA39WRITER_H_
+enum BC_TEXT_LOC;
+class CBC_OneDimWriter;
+class CBC_OnedCoda39Writer;
+class CBC_OnedCode39Writer : public CBC_OneDimWriter
+{
+public:
+ CBC_OnedCode39Writer();
+ CBC_OnedCode39Writer(FX_BOOL extendedMode);
+ virtual ~CBC_OnedCode39Writer();
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BYTE *Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
+ void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ CFX_WideString encodedContents(FX_WSTR contents, FX_INT32 &e);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ FX_BOOL CheckExtendedContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ CFX_WideString FilterExtendedContents(FX_WSTR contents);
+ CFX_WideString RenderTextContents(FX_WSTR contents);
+ CFX_WideString RenderExtendedTextContents(FX_WSTR contents);
+ FX_BOOL SetTextLocation(BC_TEXT_LOC loction);
+ FX_BOOL SetWideNarrowRatio(FX_INT32 ratio);
+private:
+ void ToIntArray(FX_INT32 a, FX_INT32 *toReturn);
+ FX_CHAR CalcCheckSum(const CFX_ByteString &contents, FX_INT32 &e);
+ FX_INT32 m_iWideNarrRatio;
+ FX_BOOL m_extendedMode;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h b/xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h
new file mode 100644
index 0000000000..9afb9b6418
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDEAN13READER_H_
+#define _BC_ONEDEAN13READER_H_
+class CBC_OneDimReader;
+class CBC_CommonBitArray;
+class CBC_OnedEAN13Reader;
+class CBC_OnedEAN13Reader : public CBC_OneDimReader
+{
+public:
+ const static FX_INT32 FIRST_DIGIT_ENCODINGS[10];
+ CBC_OnedEAN13Reader();
+ virtual ~CBC_OnedEAN13Reader();
+private:
+ void DetermineFirstDigit(CFX_ByteString &result, FX_INT32 lgPatternFound, FX_INT32 &e);
+protected:
+ FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e);
+ friend class CBC_OnedUPCAReader;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h b/xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h
new file mode 100644
index 0000000000..2353cfda95
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h
@@ -0,0 +1,31 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDEAN13WRITER_H_
+#define _BC_ONEDEAN13WRITER_H_
+class CBC_OneDimWriter;
+class CBC_OnedEAN13Writer;
+class CBC_OnedEAN13Writer : public CBC_OneDimWriter
+{
+private:
+ FX_INT32 m_codeWidth;
+public:
+ CBC_OnedEAN13Writer();
+ virtual ~CBC_OnedEAN13Writer();
+
+ FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format,
+ FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BYTE* Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
+ void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+protected:
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h b/xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h
new file mode 100644
index 0000000000..a32bb63083
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h
@@ -0,0 +1,20 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDEAN8READER_H_
+#define _BC_ONEDEAN8READER_H_
+class CBC_OneDimReader;
+class CBC_CommonBitArray;
+class CBC_OnedEAN8Reader;
+class CBC_OnedEAN8Reader : public CBC_OneDimReader
+{
+public:
+ CBC_OnedEAN8Reader();
+ virtual ~CBC_OnedEAN8Reader();
+protected:
+ FX_INT32 DecodeMiddle(CBC_CommonBitArray*, CFX_Int32Array *startRange, CFX_ByteString &result, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h b/xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h
new file mode 100644
index 0000000000..2b55734538
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDEAN8WRITER_H_
+#define _BC_ONEDEAN8WRITER_H_
+enum BC_TEXT_LOC;
+class CBC_OneDimWriter;
+class CBC_OnedEAN8Writer;
+class CBC_OnedEAN8Writer : public CBC_OneDimWriter
+{
+private:
+ FX_INT32 m_codeWidth;
+public:
+ CBC_OnedEAN8Writer();
+ virtual ~CBC_OnedEAN8Writer();
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight , FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints , FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, FX_INT32 &outLength, FX_INT32 &e);
+ void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ void SetDataLength(FX_INT32 length);
+ FX_BOOL SetTextLocation(BC_TEXT_LOC location);
+ FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+protected:
+
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h b/xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h
new file mode 100644
index 0000000000..5df6c739ff
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h
@@ -0,0 +1,30 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDUPCAREADER_H_
+#define _BC_ONEDUPCAREADER_H_
+class CBC_BinaryBitmap;
+class CBC_CommonBitArray;
+class CBC_OneDimReader;
+class CBC_OnedEAN13Reader;
+class CBC_OnedUPCAReader;
+class CBC_OnedUPCAReader : public CBC_OneDimReader
+{
+private:
+ CBC_OnedEAN13Reader *m_ean13Reader;
+public:
+ CBC_OnedUPCAReader();
+ virtual ~CBC_OnedUPCAReader();
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString DecodeRow(FX_INT32 rowNumber, CBC_CommonBitArray *row, CFX_Int32Array *startGuardRange, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ virtual void Init();
+protected:
+ FX_INT32 DecodeMiddle(CBC_CommonBitArray *row, CFX_Int32Array *startRange, CFX_ByteString &resultString, FX_INT32 &e);
+ CFX_ByteString MaybeReturnResult(CFX_ByteString &result, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h b/xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h
new file mode 100644
index 0000000000..4174ceb36e
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h
@@ -0,0 +1,31 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_ONEDUPCAWRITER_H_
+#define _BC_ONEDUPCAWRITER_H_
+class CBC_Writer;
+class CBC_OnedEAN13Writer;
+class CBC_OnedUPCAWriter;
+class CBC_OnedUPCAWriter : public CBC_OneDimWriter
+{
+private:
+ CBC_OnedEAN13Writer *m_subWriter;
+public:
+ CBC_OnedUPCAWriter();
+ virtual ~CBC_OnedUPCAWriter();
+ virtual void Init();
+ FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE* Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ void RenderResult(FX_WSTR contents, FX_BYTE* code, FX_INT32 codeLength, FX_BOOL isDevice, FX_INT32 &e);
+ FX_BOOL CheckContentValidity(FX_WSTR contents);
+ CFX_WideString FilterContents(FX_WSTR contents);
+ FX_INT32 CalcChecksum(const CFX_ByteString &contents);
+
+protected:
+
+ void ShowChars(FX_WSTR contents, CFX_DIBitmap *pOutBitmap, CFX_RenderDevice* device, const CFX_Matrix* matrix, FX_INT32 barWidth, FX_INT32 multiple, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417.h b/xfa/src/fxbarcode/src/include/BC_PDF417.h
new file mode 100644
index 0000000000..ab31244add
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417.h
@@ -0,0 +1,45 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417_H_
+#define _BC_PDF417_H_
+class CBC_Compaction;
+class CBC_BarcodeRow;
+class CBC_BarcodeMatrix;
+class CBC_PDF417;
+class CBC_PDF417 : public CFX_Object
+{
+public:
+ CBC_PDF417();
+ CBC_PDF417(FX_BOOL compact);
+ virtual ~CBC_PDF417();
+ CBC_BarcodeMatrix* getBarcodeMatrix();
+ void generateBarcodeLogic(CFX_WideString msg, FX_INT32 errorCorrectionLevel, FX_INT32 &e);
+ void setDimensions(FX_INT32 maxCols, FX_INT32 minCols, FX_INT32 maxRows, FX_INT32 minRows);
+ void setCompaction(Compaction compaction);
+ void setCompact(FX_BOOL compact);
+private:
+ static FX_INT32 START_PATTERN;
+ static FX_INT32 STOP_PATTERN;
+ static FX_INT32 CODEWORD_TABLE[][1000];
+ static FX_FLOAT PREFERRED_RATIO;
+ static FX_FLOAT DEFAULT_MODULE_WIDTH;
+ static FX_FLOAT HEIGHT;
+ CBC_BarcodeMatrix* m_barcodeMatrix;
+ FX_BOOL m_compact;
+ Compaction m_compaction;
+ FX_INT32 m_minCols;
+ FX_INT32 m_maxCols;
+ FX_INT32 m_maxRows;
+ FX_INT32 m_minRows;
+private:
+ static FX_INT32 calculateNumberOfRows(FX_INT32 m, FX_INT32 k, FX_INT32 c);
+ static FX_INT32 getNumberOfPadCodewords(FX_INT32 m, FX_INT32 k, FX_INT32 c, FX_INT32 r);
+ static void encodeChar(FX_INT32 pattern, FX_INT32 len, CBC_BarcodeRow* logic);
+ void encodeLowLevel(CFX_WideString fullCodewords, FX_INT32 c, FX_INT32 r, FX_INT32 errorCorrectionLevel, CBC_BarcodeMatrix* logic);
+ CFX_Int32Array* determineDimensions(FX_INT32 sourceCodeWords, FX_INT32 errorCorrectionCodeWords, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h
new file mode 100644
index 0000000000..d8a0c5d0ae
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BARCODEMATRIX_H_
+#define _BC_BARCODEMATRIX_H_
+class CBC_BarcodeRow;
+class CBC_BarcodeMatrix;
+class CBC_BarcodeMatrix : public CFX_Object
+{
+public:
+ CBC_BarcodeMatrix();
+ CBC_BarcodeMatrix(FX_INT32 height, FX_INT32 width);
+ virtual ~CBC_BarcodeMatrix();
+ void set(FX_INT32 x, FX_INT32 y, FX_BYTE value);
+ void setMatrix(FX_INT32 x, FX_INT32 y, FX_BOOL black);
+ void startRow();
+ CBC_BarcodeRow* getCurrentRow();
+ CFX_ByteArray& getMatrix();
+ CFX_ByteArray& getScaledMatrix(FX_INT32 scale);
+ CFX_ByteArray& getScaledMatrix(FX_INT32 xScale, FX_INT32 yScale);
+ FX_INT32 getWidth();
+ FX_INT32 getHeight();
+private:
+ CFX_PtrArray m_matrix;
+ CFX_ByteArray m_matrixOut;
+ FX_INT32 m_currentRow;
+ FX_INT32 m_height;
+ FX_INT32 m_width;
+ FX_INT32 m_outWidth;
+ FX_INT32 m_outHeight;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h
new file mode 100644
index 0000000000..62b1282827
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h
@@ -0,0 +1,27 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BARCODEMETADATA_H_
+#define _BC_BARCODEMETADATA_H_
+class CBC_BarcodeMetadata;
+class CBC_BarcodeMetadata : public CFX_Object
+{
+public:
+ CBC_BarcodeMetadata(FX_INT32 columnCount, FX_INT32 rowCountUpperPart, FX_INT32 rowCountLowerPart, FX_INT32 errorCorrectionLevel);
+ virtual ~CBC_BarcodeMetadata();
+ FX_INT32 getColumnCount();
+ FX_INT32 getErrorCorrectionLevel();
+ FX_INT32 getRowCount();
+ FX_INT32 getRowCountUpperPart();
+ FX_INT32 getRowCountLowerPart();
+private:
+ FX_INT32 m_columnCount;
+ FX_INT32 m_errorCorrectionLevel;
+ FX_INT32 m_rowCountUpperPart;
+ FX_INT32 m_rowCountLowerPart;
+ FX_INT32 m_rowCount;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h
new file mode 100644
index 0000000000..75fd15b653
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BARCODEROW_H_
+#define _BC_BARCODEROW_H_
+class CBC_BarcodeRow;
+class CBC_BarcodeRow : public CFX_Object
+{
+public:
+ CBC_BarcodeRow(FX_INT32 width);
+ virtual ~CBC_BarcodeRow();
+ void set(FX_INT32 x, FX_BYTE value);
+ void set(FX_INT32 x, FX_BOOL black);
+ void addBar(FX_BOOL black, FX_INT32 width);
+ CFX_ByteArray& getRow();
+ CFX_ByteArray& getScaledRow(FX_INT32 scale);
+private:
+ CFX_ByteArray m_row;
+ CFX_ByteArray m_output;
+ FX_INT32 m_currentLocation;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h
new file mode 100644
index 0000000000..1695c8ac5a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h
@@ -0,0 +1,22 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BARCODEVALUE_H_
+#define _BC_BARCODEVALUE_H_
+class CBC_BarcodeValue;
+class CBC_BarcodeValue : public CFX_Object
+{
+public:
+ CBC_BarcodeValue();
+ virtual ~CBC_BarcodeValue();
+ void setValue(FX_INT32 value);
+ CFX_Int32Array* getValue();
+ FX_INT32 getConfidence(FX_INT32 value);
+private:
+ CFX_Int32Array m_keys;
+ CFX_Int32Array m_values;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h b/xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h
new file mode 100644
index 0000000000..efae2b706f
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h
@@ -0,0 +1,43 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_BOUNDINGBOX_H_
+#define _BC_BOUNDINGBOX_H_
+class CBC_CommonBitMatrix;
+class CBC_ResultPoint;
+class CBC_BoundingBox;
+class CBC_BoundingBox : public CFX_Object
+{
+public:
+ CBC_BoundingBox(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight, FX_INT32 &e);
+ CBC_BoundingBox(CBC_BoundingBox* boundingBox);
+ virtual ~CBC_BoundingBox();
+ static CBC_BoundingBox* merge(CBC_BoundingBox* leftBox, CBC_BoundingBox* rightBox, FX_INT32 &e);
+ CBC_BoundingBox* addMissingRows(FX_INT32 missingStartRows, FX_INT32 missingEndRows, FX_BOOL isLeft, FX_INT32 &e);
+ void setTopRight(CBC_ResultPoint topRight);
+ void setBottomRight(CBC_ResultPoint bottomRight);
+ FX_INT32 getMinX();
+ FX_INT32 getMaxX();
+ FX_INT32 getMinY();
+ FX_INT32 getMaxY();
+ CBC_ResultPoint* getTopLeft();
+ CBC_ResultPoint* getTopRight();
+ CBC_ResultPoint* getBottomLeft();
+ CBC_ResultPoint* getBottomRight();
+private:
+ CBC_CommonBitMatrix* m_image;
+ CBC_ResultPoint* m_topLeft;
+ CBC_ResultPoint* m_bottomLeft;
+ CBC_ResultPoint* m_topRight;
+ CBC_ResultPoint* m_bottomRight;
+ FX_INT32 m_minX;
+ FX_INT32 m_maxX;
+ FX_INT32 m_minY;
+ FX_INT32 m_maxY;
+ void init(CBC_CommonBitMatrix* image, CBC_ResultPoint* topLeft, CBC_ResultPoint* bottomLeft, CBC_ResultPoint* topRight, CBC_ResultPoint* bottomRight);
+ void calculateMinMaxValues();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h b/xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h
new file mode 100644
index 0000000000..93b3cf6bb3
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h
@@ -0,0 +1,34 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_CODEWORD_H_
+#define _BC_CODEWORD_H_
+class CBC_Codeword;
+class CBC_Codeword : public CFX_Object
+{
+public:
+ CBC_Codeword(FX_INT32 startX, FX_INT32 endX, FX_INT32 bucket, FX_INT32 value);
+ virtual ~CBC_Codeword();
+ FX_BOOL hasValidRowNumber() ;
+ FX_BOOL isValidRowNumber(FX_INT32 rowNumber);
+ void setRowNumberAsRowIndicatorColumn();
+ FX_INT32 getWidth();
+ FX_INT32 getStartX();
+ FX_INT32 getEndX();
+ FX_INT32 getBucket();
+ FX_INT32 getValue();
+ FX_INT32 getRowNumber();
+ void setRowNumber(FX_INT32 rowNumber);
+ CFX_ByteString toString();
+private:
+ static FX_INT32 BARCODE_ROW_UNKNOWN;
+ FX_INT32 m_startX;
+ FX_INT32 m_endX;
+ FX_INT32 m_bucket;
+ FX_INT32 m_value;
+ FX_INT32 m_rowNumber;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h b/xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h
new file mode 100644
index 0000000000..da22683bfa
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h
@@ -0,0 +1,27 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417CODEWORDDECODER_H_
+#define _BC_PDF417CODEWORDDECODER_H_
+class CBC_PDF417Common;
+class CBC_PDF417CodewordDecoder;
+#define column 8
+class CBC_PDF417CodewordDecoder : public CFX_Object
+{
+public:
+ CBC_PDF417CodewordDecoder();
+ virtual ~CBC_PDF417CodewordDecoder();
+ static void Initialize();
+ static void Finalize();
+ static FX_INT32 getDecodedValue(CFX_Int32Array& moduleBitCount);
+private:
+ static FX_FLOAT RATIOS_TABLE[][8];
+ static CFX_Int32Array* sampleBitCounts(CFX_Int32Array& moduleBitCount);
+ static FX_INT32 getDecodedCodewordValue(CFX_Int32Array& moduleBitCount);
+ static FX_INT32 getBitValue(CFX_Int32Array& moduleBitCount);
+ static FX_INT32 getClosestDecodedValue(CFX_Int32Array& moduleBitCount);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Common.h b/xfa/src/fxbarcode/src/include/BC_PDF417Common.h
new file mode 100644
index 0000000000..19e3fe57da
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Common.h
@@ -0,0 +1,31 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417COMMON_H_
+#define _BC_PDF417COMMON_H_
+class CBC_PDF417Common;
+class CBC_PDF417Common : public CFX_Object
+{
+public:
+ CBC_PDF417Common();
+ virtual ~CBC_PDF417Common();
+ static FX_INT32 getBitCountSum(CFX_Int32Array& moduleBitCount);
+ static FX_INT32 getCodeword(FX_DWORD symbol);
+ static FX_INT32 NUMBER_OF_CODEWORDS;
+ static FX_INT32 MAX_CODEWORDS_IN_BARCODE;
+ static FX_INT32 MIN_ROWS_IN_BARCODE;
+ static FX_INT32 MAX_ROWS_IN_BARCODE;
+ static FX_INT32 MAX_CODEWORDS_IN_ROW;
+ static FX_INT32 MODULES_IN_CODEWORD;
+ static FX_INT32 MODULES_IN_STOP_PATTERN;
+ static FX_INT32 BARS_IN_MODULE;
+ static FX_INT32 SYMBOL_TABLE[];
+ static FX_INT32 CODEWORD_TABLE[];
+private:
+ static CFX_Int32Array* EMPTY_INT_ARRAY;
+ static FX_INT32 findCodewordIndex(FX_DWORD symbol);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h b/xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h
new file mode 100644
index 0000000000..774a23fbdf
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h
@@ -0,0 +1,22 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_COMPACTION_H_
+#define _BC_COMPACTION_H_
+class CBC_Compaction;
+enum Compaction {
+ AUTO,
+ TEXT,
+ BYTES,
+ NUMERIC
+};
+class CBC_Compaction : public CFX_Object
+{
+public:
+ CBC_Compaction();
+ virtual ~CBC_Compaction();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h b/xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h
new file mode 100644
index 0000000000..a612769106
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h
@@ -0,0 +1,49 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DECODEDBITSTREAMPARSER_H_
+#define _BC_DECODEDBITSTREAMPARSER_H_
+class CBC_CommonDecoderResult;
+class CBC_PDF417ResultMetadata;
+class CBC_DecodedBitStreamPaser;
+class CBC_DecodedBitStreamPaser : public CFX_Object
+{
+public:
+ CBC_DecodedBitStreamPaser();
+ virtual ~CBC_DecodedBitStreamPaser();
+ static void Initialize();
+ static void Finalize();
+ static CBC_CommonDecoderResult* decode(CFX_Int32Array &codewords, CFX_ByteString ecLevel, FX_INT32 &e);
+
+private:
+ enum Mode {
+ ALPHA,
+ LOWER,
+ MIXED,
+ PUNCT,
+ ALPHA_SHIFT,
+ PUNCT_SHIFT
+ };
+ static FX_INT32 MAX_NUMERIC_CODEWORDS;
+ static FX_INT32 PL;
+ static FX_INT32 LL;
+ static FX_INT32 AS;
+ static FX_INT32 ML;
+ static FX_INT32 AL;
+ static FX_INT32 PS;
+ static FX_INT32 PAL;
+ static FX_CHAR PUNCT_CHARS[29];
+ static FX_CHAR MIXED_CHARS[30];
+ static FX_INT32 EXP900[16];
+ static FX_INT32 NUMBER_OF_SEQUENCE_CODEWORDS;
+ static FX_INT32 decodeMacroBlock(CFX_Int32Array &codewords, FX_INT32 codeIndex, CBC_PDF417ResultMetadata* resultMetadata, FX_INT32 &e);
+ static FX_INT32 textCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);
+ static void decodeTextCompaction(CFX_Int32Array &textCompactionData, CFX_Int32Array &byteCompactionData, FX_INT32 length, CFX_ByteString &result);
+ static FX_INT32 byteCompaction(FX_INT32 mode, CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result);
+ static FX_INT32 numericCompaction(CFX_Int32Array &codewords, FX_INT32 codeIndex, CFX_ByteString &result, FX_INT32 &e);
+ static CFX_ByteString decodeBase900toBase10(CFX_Int32Array &codewords, FX_INT32 count, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h
new file mode 100644
index 0000000000..9c3401459b
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h
@@ -0,0 +1,48 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_EDTECTIONRESULT_H_
+#define _BC_EDTECTIONRESULT_H_
+class CBC_BarcodeMetadata;
+class CBC_BoundingBox;
+class CBC_Codeword;
+class CBC_DetectionResultColumn;
+class CBC_DetectionResult;
+class CBC_DetectionResult : public CFX_Object
+{
+public:
+ CBC_DetectionResult(CBC_BarcodeMetadata* barcodeMetadata, CBC_BoundingBox* boundingBox);
+ virtual ~CBC_DetectionResult();
+ CFX_PtrArray& getDetectionResultColumns();
+ void setBoundingBox(CBC_BoundingBox* boundingBox);
+ CBC_BoundingBox* getBoundingBox();
+ void setDetectionResultColumn(FX_INT32 barcodeColumn, CBC_DetectionResultColumn* detectionResultColumn);
+ CBC_DetectionResultColumn* getDetectionResultColumn(FX_INT32 barcodeColumn);
+ CFX_ByteString toString();
+
+ FX_INT32 getBarcodeColumnCount();
+ FX_INT32 getBarcodeRowCount();
+ FX_INT32 getBarcodeECLevel();
+private:
+ static FX_INT32 ADJUST_ROW_NUMBER_SKIP;
+ CBC_BarcodeMetadata* m_barcodeMetadata;
+ CFX_PtrArray m_detectionResultColumns;
+ CBC_BoundingBox* m_boundingBox;
+ FX_INT32 m_barcodeColumnCount;
+private:
+ void adjustIndicatorColumnRowNumbers(CBC_DetectionResultColumn* detectionResultColumn);
+ FX_INT32 adjustRowNumbers();
+ FX_INT32 adjustRowNumbersByRow();
+ FX_INT32 adjustRowNumbersFromBothRI();
+ FX_INT32 adjustRowNumbersFromRRI();
+ FX_INT32 adjustRowNumbersFromLRI();
+ static FX_INT32 adjustRowNumberIfValid(FX_INT32 rowIndicatorRowNumber, FX_INT32 invalidRowCounts, CBC_Codeword* codeword);
+ void adjustRowNumbers(FX_INT32 barcodeColumn, FX_INT32 codewordsRow, CFX_PtrArray* codewords);
+ static FX_BOOL adjustRowNumber(CBC_Codeword* codeword, CBC_Codeword* otherCodeword);
+
+
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h
new file mode 100644
index 0000000000..eddc3bce6d
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h
@@ -0,0 +1,31 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DETECTIONRESULTCOLUMN_H_
+#define _BC_DETECTIONRESULTCOLUMN_H_
+class CBC_Codeword;
+class CBC_BoundingBox;
+class CBC_DetectionResultColumn;
+class CBC_DetectionResultColumn : public CFX_Object
+{
+public:
+ CBC_DetectionResultColumn(CBC_BoundingBox* boundingBox);
+ virtual ~CBC_DetectionResultColumn();
+ CBC_Codeword* getCodewordNearby(FX_INT32 imageRow);
+ FX_INT32 imageRowToCodewordIndex(FX_INT32 imageRow);
+ FX_INT32 codewordIndexToImageRow(FX_INT32 codewordIndex);
+ void setCodeword(FX_INT32 imageRow, CBC_Codeword* codeword);
+ CBC_Codeword* getCodeword(FX_INT32 imageRow);
+ CBC_BoundingBox* getBoundingBox();
+ CFX_PtrArray* getCodewords();
+ CFX_ByteString toString();
+public:
+ CBC_BoundingBox* m_boundingBox;
+ CFX_PtrArray* m_codewords;
+private:
+ static FX_INT32 MAX_NEARBY_DISTANCE;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h
new file mode 100644
index 0000000000..fbdd0f0ec4
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h
@@ -0,0 +1,28 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DETECTIONRESULTROWINDICATORCOLUMN_H_
+#define _BC_DETECTIONRESULTROWINDICATORCOLUMN_H_
+class CBC_BarcodeMetadata;
+class CBC_BoundingBox;
+class CBC_DetectionResultRowIndicatorColumn;
+class CBC_DetectionResultRowIndicatorColumn : public CBC_DetectionResultColumn
+{
+public:
+ CBC_DetectionResultRowIndicatorColumn(CBC_BoundingBox* boundingBox, FX_BOOL isLeft);
+ virtual ~CBC_DetectionResultRowIndicatorColumn();
+ void setRowNumbers();
+ FX_INT32 adjustCompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
+ CFX_Int32Array* getRowHeights(FX_INT32 &e);
+ FX_INT32 adjustIncompleteIndicatorColumnRowNumbers(CBC_BarcodeMetadata barcodeMetadata);
+ CBC_BarcodeMetadata* getBarcodeMetadata();
+ FX_BOOL isLeft();
+ CFX_ByteString toString();
+private:
+ FX_BOOL m_isLeft;
+ void removeIncorrectCodewords(CFX_PtrArray* codewords, CBC_BarcodeMetadata barcodeMetadata);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Detector.h b/xfa/src/fxbarcode/src/include/BC_PDF417Detector.h
new file mode 100644
index 0000000000..557559e1f7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Detector.h
@@ -0,0 +1,43 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DETECTOR_H_
+#define _BC_DETECTOR_H_
+class CBC_PDF417DetectorResult;
+class CBC_BinaryBitmap;
+class CBC_CommonBitMatrix;
+class CBC_CommonBitArray;
+class CBC_Detector;
+class CBC_Detector : public CFX_Object
+{
+public:
+ CBC_Detector();
+ virtual ~CBC_Detector();
+ static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e);
+ static void rotate180(CBC_CommonBitMatrix* bitMatrix);
+ static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitArray* result);
+private:
+ static FX_INT32 INDEXES_START_PATTERN[];
+ static FX_INT32 INDEXES_STOP_PATTERN[];
+ static FX_INT32 INTEGER_MATH_SHIFT;
+ static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR;
+ static FX_INT32 MAX_AVG_VARIANCE;
+ static FX_INT32 MAX_INDIVIDUAL_VARIANCE;
+ static FX_INT32 START_PATTERN[];
+ static FX_INT32 STOP_PATTERN[];
+ static FX_INT32 MAX_PIXEL_DRIFT;
+ static FX_INT32 MAX_PATTERN_DRIFT;
+ static FX_INT32 SKIPPED_ROW_COUNT_MAX;
+ static FX_INT32 ROW_STEP;
+ static FX_INT32 BARCODE_MIN_HEIGHT;
+ static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix);
+ static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn);
+ static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength);
+ static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength);
+ static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters);
+ static FX_INT32 patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h b/xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h
new file mode 100644
index 0000000000..ba557f1541
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h
@@ -0,0 +1,22 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417DETECTORRESULT_H_
+#define _BC_PDF417DETECTORRESULT_H_
+class CBC_CommonBitMatrix;
+class CBC_PDF417DetectorResult;
+class CBC_PDF417DetectorResult : public CFX_Object
+{
+public:
+ CBC_PDF417DetectorResult(CBC_CommonBitMatrix* bits, CFX_PtrArray* points);
+ virtual ~CBC_PDF417DetectorResult();
+ CBC_CommonBitMatrix* getBits() ;
+ CFX_PtrArray* getPoints();
+private:
+ CBC_CommonBitMatrix* m_bits;
+ CFX_PtrArray* m_points;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h b/xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h
new file mode 100644
index 0000000000..6f8eaffed7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_DIMENSIONS_H_
+#define _BC_DIMENSIONS_H_
+class CBC_Dimensions;
+class CBC_Dimensions : public CFX_Object
+{
+public:
+ CBC_Dimensions(FX_INT32 minCols, FX_INT32 maxCols, FX_INT32 minRows, FX_INT32 maxRows);
+ virtual ~CBC_Dimensions();
+ FX_INT32 getMinCols();
+ FX_INT32 getMaxCols();
+ FX_INT32 getMinRows();
+ FX_INT32 getMaxRows();
+private:
+ FX_INT32 m_minCols;
+ FX_INT32 m_maxCols;
+ FX_INT32 m_minRows;
+ FX_INT32 m_maxRows;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h b/xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h
new file mode 100644
index 0000000000..4ce8eda7d6
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h
@@ -0,0 +1,26 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417ECERRORCORRECTION_H_
+#define _BC_PDF417ECERRORCORRECTION_H_
+class CBC_PDF417ECModulusGF;
+class CBC_PDF417ECModulusPoly;
+class CBC_PDF417ECErrorCorrection;
+class CBC_PDF417ECErrorCorrection : public CFX_Object
+{
+public:
+ CBC_PDF417ECErrorCorrection();
+ virtual ~CBC_PDF417ECErrorCorrection();
+ static void Initialize(FX_INT32 &e);
+ static void Finalize();
+ static FX_INT32 decode(CFX_Int32Array &received, FX_INT32 numECCodewords, CFX_Int32Array &erasures, FX_INT32 &e);
+private:
+ static CBC_PDF417ECModulusGF* m_field;
+ static CFX_PtrArray* runEuclideanAlgorithm(CBC_PDF417ECModulusPoly* a, CBC_PDF417ECModulusPoly* b, FX_INT32 R, FX_INT32 &e);
+ static CFX_Int32Array* findErrorLocations(CBC_PDF417ECModulusPoly* errorLocator, FX_INT32 &e);
+ static CFX_Int32Array* findErrorMagnitudes(CBC_PDF417ECModulusPoly* errorEvaluator, CBC_PDF417ECModulusPoly* errorLocator, CFX_Int32Array &errorLocations, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h b/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h
new file mode 100644
index 0000000000..7ebe33ecfd
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h
@@ -0,0 +1,37 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417ECMODULUSGF_H_
+#define _BC_PDF417ECMODULUSGF_H_
+class CBC_PDF417ECModulusPoly;
+class CBC_PDF417Common;
+class CBC_PDF417ECModulusGF;
+class CBC_PDF417ECModulusGF : public CFX_Object
+{
+public:
+ CBC_PDF417ECModulusGF(FX_INT32 modulus, FX_INT32 generator, FX_INT32 &e);
+ virtual ~CBC_PDF417ECModulusGF();
+ static void Initialize(FX_INT32 &e);
+ static void Finalize();
+ CBC_PDF417ECModulusPoly* getZero();
+ CBC_PDF417ECModulusPoly* getOne();
+ CBC_PDF417ECModulusPoly* buildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
+ FX_INT32 add(FX_INT32 a, FX_INT32 b);
+ FX_INT32 subtract(FX_INT32 a, FX_INT32 b);
+ FX_INT32 exp(FX_INT32 a);
+ FX_INT32 log(FX_INT32 a, FX_INT32 &e);
+ FX_INT32 inverse(FX_INT32 a, FX_INT32 &e);
+ FX_INT32 multiply(FX_INT32 a, FX_INT32 b);
+ FX_INT32 getSize();
+ static CBC_PDF417ECModulusGF* PDF417_GF;
+private:
+ CFX_Int32Array m_expTable;
+ CFX_Int32Array m_logTable;
+ CBC_PDF417ECModulusPoly* m_zero;
+ CBC_PDF417ECModulusPoly* m_one;
+ FX_INT32 m_modulus;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h b/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h
new file mode 100644
index 0000000000..9a9d6c16f2
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h
@@ -0,0 +1,34 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417ECMODULUSPOLY_H_
+#define _BC_PDF417ECMODULUSPOLY_H_
+class CBC_PDF417ECModulusGF;
+class CBC_PDF417ECModulusPoly;
+class CBC_PDF417ECModulusPoly : public CFX_Object
+{
+public:
+ CBC_PDF417ECModulusPoly(CBC_PDF417ECModulusGF* field, CFX_Int32Array &coefficients, FX_INT32 &e);
+ virtual ~CBC_PDF417ECModulusPoly();
+ CFX_Int32Array& getCoefficients();
+ CBC_PDF417ECModulusGF* getField();
+ FX_INT32 getDegree();
+ FX_BOOL isZero();
+ FX_INT32 getCoefficient(FX_INT32 degree);
+ FX_INT32 evaluateAt(FX_INT32 a);
+ CBC_PDF417ECModulusPoly* add(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
+ CBC_PDF417ECModulusPoly* subtract(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
+ CBC_PDF417ECModulusPoly* multiply(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
+ CBC_PDF417ECModulusPoly* negative(FX_INT32 &e);
+ CBC_PDF417ECModulusPoly* multiply(FX_INT32 scalar, FX_INT32 &e);
+ CBC_PDF417ECModulusPoly* multiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
+ CFX_PtrArray* divide(CBC_PDF417ECModulusPoly* other, FX_INT32 &e);
+ CFX_ByteString toString();
+private:
+ CBC_PDF417ECModulusGF* m_field;
+ CFX_Int32Array m_coefficients;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h b/xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h
new file mode 100644
index 0000000000..4e3aee8d26
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417ERRORCORRECTION_H_
+#define _BC_PDF417ERRORCORRECTION_H_
+class CBC_PDF417ErrorCorrection;
+class CBC_PDF417ErrorCorrection : public CFX_Object
+{
+public:
+ CBC_PDF417ErrorCorrection();
+ virtual ~CBC_PDF417ErrorCorrection();
+ static FX_INT32 getErrorCorrectionCodewordCount(FX_INT32 errorCorrectionLevel, FX_INT32 &e);
+ static FX_INT32 getRecommendedMinimumErrorCorrectionLevel(FX_INT32 n, FX_INT32 &e);
+ static CFX_WideString generateErrorCorrection(CFX_WideString dataCodewords, FX_INT32 errorCorrectionLevel, FX_INT32 &e);
+private:
+ static FX_INT32 EC_COEFFICIENTS[][2500];
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h b/xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h
new file mode 100644
index 0000000000..4bca174bb2
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h
@@ -0,0 +1,48 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417HIGHLEVELENCODER_H_
+#define _BC_PDF417HIGHLEVELENCODER_H_
+class CBC_Compaction;
+class CBC_PDF417HighLevelEncoder;
+class CBC_PDF417HighLevelEncoder : public CFX_Object
+{
+public:
+ CBC_PDF417HighLevelEncoder();
+ virtual ~CBC_PDF417HighLevelEncoder();
+ static CFX_WideString encodeHighLevel(CFX_WideString msg, Compaction compaction, FX_INT32 &e);
+ static void Inverse();
+ static void Initialize();
+ static void Finalize();
+private:
+ static FX_INT32 TEXT_COMPACTION;
+ static FX_INT32 BYTE_COMPACTION;
+ static FX_INT32 NUMERIC_COMPACTION;
+ static FX_INT32 SUBMODE_PUNCTUATION;
+ static FX_INT32 LATCH_TO_TEXT;
+ static FX_INT32 LATCH_TO_BYTE_PADDED;
+ static FX_INT32 LATCH_TO_NUMERIC;
+ static FX_INT32 SHIFT_TO_BYTE;
+ static FX_INT32 LATCH_TO_BYTE;
+ static FX_BYTE TEXT_MIXED_RAW[];
+ static FX_BYTE TEXT_PUNCTUATION_RAW[];
+ static FX_INT32 MIXED[128];
+ static FX_INT32 PUNCTUATION[128];
+ static CFX_ByteArray* getBytesForMessage(CFX_WideString msg);
+ static FX_INT32 encodeText(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb, FX_INT32 initialSubmode);
+ static void encodeBinary(CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 count, FX_INT32 startmode, CFX_WideString &sb);
+ static void encodeNumeric(CFX_WideString msg, FX_INT32 startpos, FX_INT32 count, CFX_WideString &sb);
+ static FX_BOOL isDigit(FX_WCHAR ch);
+ static FX_BOOL isAlphaUpper(FX_WCHAR ch);
+ static FX_BOOL isAlphaLower(FX_WCHAR ch);
+ static FX_BOOL isMixed(FX_WCHAR ch);
+ static FX_BOOL isPunctuation(FX_WCHAR ch);
+ static FX_BOOL isText(FX_WCHAR ch);
+ static FX_INT32 determineConsecutiveDigitCount(CFX_WideString msg, FX_INT32 startpos);
+ static FX_INT32 determineConsecutiveTextCount(CFX_WideString msg, FX_INT32 startpos);
+ static FX_INT32 determineConsecutiveBinaryCount(CFX_WideString msg, CFX_ByteArray* bytes, FX_INT32 startpos, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Reader.h b/xfa/src/fxbarcode/src/include/BC_PDF417Reader.h
new file mode 100644
index 0000000000..e6c0236cf7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Reader.h
@@ -0,0 +1,26 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417READER_H_
+#define _BC_PDF417READER_H_
+class CBC_BinaryBitmap;
+class CBC_ResultPoint;
+class CBC_PDF417Reader;
+class CBC_PDF417Reader : public CBC_Reader
+{
+public:
+ CBC_PDF417Reader();
+ virtual ~CBC_PDF417Reader();
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_BOOL multiple, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+private:
+ static FX_INT32 getMaxWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
+ static FX_INT32 getMinWidth(CBC_ResultPoint* p1, CBC_ResultPoint* p2);
+ static FX_INT32 getMaxCodewordWidth(CFX_PtrArray& p);
+ static FX_INT32 getMinCodewordWidth(CFX_PtrArray& p);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h b/xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h
new file mode 100644
index 0000000000..e6c7780304
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417READER_H_
+#define _BC_PDF417READER_H_
+class CBC_PDF417ResultMetadata;
+class CBC_PDF417ResultMetadata : public CFX_Object
+{
+public:
+ CBC_PDF417ResultMetadata();
+ virtual ~CBC_PDF417ResultMetadata();
+ FX_INT32 getSegmentIndex();
+ void setSegmentIndex(FX_INT32 segmentIndex);
+ CFX_ByteString getFileId();
+ void setFileId(CFX_ByteString fileId);
+ CFX_Int32Array& getOptionalData();
+ void setOptionalData(CFX_Int32Array &optionalData);
+ FX_BOOL isLastSegment();
+ void setLastSegment(FX_BOOL lastSegment);
+private:
+ FX_INT32 m_segmentIndex;
+ CFX_ByteString m_fileId;
+ CFX_Int32Array m_optionalData;
+ FX_BOOL m_lastSegment;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h b/xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h
new file mode 100644
index 0000000000..924e5f798a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h
@@ -0,0 +1,61 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417SCANNINGDECODER_H_
+#define _BC_PDF417SCANNINGDECODER_H_
+class CBC_CommonDecoderResult;
+class CBC_CommonBitMatrix;
+class CBC_ErrorCorrection;
+class CBC_Codeword;
+class CBC_BoundingBox;
+class CBC_ResultPoint;
+class CBC_BarcodeMetadata;
+class CBC_BarcodeValue;
+class CBC_DetectionResult;
+class CBC_DetectionResultRowIndicatorColumn;
+class CBC_PDF417ScanningDecoder;
+class CBC_PDF417ScanningDecoder : public CFX_Object
+{
+public:
+ CBC_PDF417ScanningDecoder();
+ virtual ~CBC_PDF417ScanningDecoder();
+ static void Initialize();
+ static void Finalize();
+ static CBC_CommonDecoderResult* decode(CBC_CommonBitMatrix* image, CBC_ResultPoint* imageTopLeft, CBC_ResultPoint* imageBottomLeft, CBC_ResultPoint* imageTopRight,
+ CBC_ResultPoint* imageBottomRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth, FX_INT32 &e);
+ static CFX_ByteString toString(CFX_PtrArray* barcodeMatrix);
+private:
+ static FX_INT32 CODEWORD_SKEW_SIZE;
+ static FX_INT32 MAX_ERRORS;
+ static FX_INT32 MAX_EC_CODEWORDS;
+ static CBC_PDF417ECErrorCorrection* errorCorrection;
+ static CBC_DetectionResult* merge(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn, FX_INT32 &e);
+ static CBC_BoundingBox* adjustBoundingBox(CBC_DetectionResultRowIndicatorColumn* rowIndicatorColumn, FX_INT32 &e);
+ static FX_INT32 getMax(CFX_Int32Array& values);
+ static CBC_BarcodeMetadata* getBarcodeMetadata(CBC_DetectionResultRowIndicatorColumn* leftRowIndicatorColumn, CBC_DetectionResultRowIndicatorColumn* rightRowIndicatorColumn);
+ static CBC_DetectionResultRowIndicatorColumn* getRowIndicatorColumn(CBC_CommonBitMatrix* image, CBC_BoundingBox* boundingBox, CBC_ResultPoint startPoint,
+ FX_BOOL leftToRight, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
+ static void adjustCodewordCount(CBC_DetectionResult* detectionResult, CFX_PtrArray* barcodeMatrix, FX_INT32 &e);
+ static CBC_CommonDecoderResult* createDecoderResult(CBC_DetectionResult* detectionResult, FX_INT32 &e);
+ static CBC_CommonDecoderResult* createDecoderResultFromAmbiguousValues(FX_INT32 ecLevel, CFX_Int32Array &codewords, CFX_Int32Array &erasureArray, CFX_Int32Array &ambiguousIndexes,
+ CFX_PtrArray& ambiguousIndexValues, FX_INT32 &e);
+ static CFX_PtrArray* createBarcodeMatrix(CBC_DetectionResult* detectionResult);
+ static FX_BOOL isValidBarcodeColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn);
+ static FX_INT32 getStartColumn(CBC_DetectionResult* detectionResult, FX_INT32 barcodeColumn, FX_INT32 imageRow, FX_BOOL leftToRight);
+ static CBC_Codeword* detectCodeword(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn,
+ FX_INT32 imageRow, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
+ static CFX_Int32Array* getModuleBitCount(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 startColumn, FX_INT32 imageRow);
+ static FX_INT32 getNumberOfECCodeWords(FX_INT32 barcodeECLevel);
+ static FX_INT32 adjustCodewordStartColumn(CBC_CommonBitMatrix* image, FX_INT32 minColumn, FX_INT32 maxColumn, FX_BOOL leftToRight, FX_INT32 codewordStartColumn, FX_INT32 imageRow);
+ static FX_BOOL checkCodewordSkew(FX_INT32 codewordSize, FX_INT32 minCodewordWidth, FX_INT32 maxCodewordWidth);
+ static CBC_CommonDecoderResult* decodeCodewords(CFX_Int32Array &codewords, FX_INT32 ecLevel, CFX_Int32Array &erasures, FX_INT32 &e);
+ static FX_INT32 correctErrors(CFX_Int32Array &codewords, CFX_Int32Array &erasures, FX_INT32 numECCodewords, FX_INT32 &e);
+ static void verifyCodewordCount(CFX_Int32Array &codewords, FX_INT32 numECCodewords, FX_INT32 &e);
+ static CFX_Int32Array* getBitCountForCodeword(FX_INT32 codeword);
+ static FX_INT32 getCodewordBucketNumber(FX_INT32 codeword);
+ static FX_INT32 getCodewordBucketNumber(CFX_Int32Array& moduleBitCount);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_PDF417Writer.h b/xfa/src/fxbarcode/src/include/BC_PDF417Writer.h
new file mode 100644
index 0000000000..5d974f9377
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_PDF417Writer.h
@@ -0,0 +1,26 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_PDF417WRITER_H_
+#define _BC_PDF417WRITER_H_
+class CBC_TwoDimWriter;
+class CBC_PDF417Writer;
+class CBC_PDF417Writer : public CBC_TwoDimWriter
+{
+public:
+ CBC_PDF417Writer();
+ virtual ~CBC_PDF417Writer();
+ FX_BYTE * Encode(const CFX_WideString &contents, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE * Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BOOL SetErrorCorrectionLevel(FX_INT32 level);
+ void SetTruncated(FX_BOOL truncated);
+private:
+ void rotateArray(CFX_ByteArray& bitarray, FX_INT32 width, FX_INT32 height);
+ FX_BOOL m_bTruncated;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h b/xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h
new file mode 100644
index 0000000000..a52687b6b7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRALIGNMENTPATTERN_H_
+#define _BC_QRALIGNMENTPATTERN_H_
+class CBC_CommonBitArray;
+class CBC_ResultPoint;
+class CBC_REAI013x0x1xDecoder;
+class CBC_QRAlignmentPattern : public CBC_ResultPoint
+{
+private:
+ FX_FLOAT m_moduleSize;
+public:
+ CBC_QRAlignmentPattern(FX_FLOAT posX, FX_FLOAT posY, FX_FLOAT estimateModuleSize);
+ virtual ~CBC_QRAlignmentPattern();
+ FX_BOOL AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLOAT j);
+ FX_FLOAT GetX();
+ FX_FLOAT GetY();
+ CBC_QRAlignmentPattern *Clone();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h b/xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h
new file mode 100644
index 0000000000..5471c4e62a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRALIGNMENTPATTERNFINDER_H_
+#define _BC_QRALIGNMENTPATTERNFINDER_H_
+class CBC_CommonBitMatrix;
+class CBC_QRAlignmentPattern;
+class CBC_QRAlignmentPatternFinder;
+class CBC_QRAlignmentPatternFinder : public CFX_Object
+{
+private:
+ CBC_CommonBitMatrix *m_image;
+ CFX_PtrArray m_possibleCenters;
+ FX_INT32 m_startX;
+ FX_INT32 m_startY;
+ FX_INT32 m_width;
+ FX_INT32 m_height;
+ FX_FLOAT m_moduleSize;
+ CFX_Int32Array m_crossCheckStateCount;
+public:
+ CBC_QRAlignmentPatternFinder(CBC_CommonBitMatrix *image, FX_INT32 startX, FX_INT32 startY, FX_INT32 width, FX_INT32 height, FX_FLOAT moduleSize);
+ virtual ~CBC_QRAlignmentPatternFinder();
+ FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount);
+ FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 startJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal);
+ CBC_QRAlignmentPattern* Find(FX_INT32 &e);
+ CBC_QRAlignmentPattern *HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j);
+ static FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h b/xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h
new file mode 100644
index 0000000000..2e176f63d3
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h
@@ -0,0 +1,31 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRABITMATRIXPARSER_H_
+#define _BC_QRABITMATRIXPARSER_H_
+class CBC_CommonBitMatrix ;
+class CBC_QRCoderVersion;
+class CBC_QRCoderFormatInformation;
+class CBC_QRDataMask;
+class CBC_QRBitMatrixParser;
+class CBC_QRBitMatrixParser : public CFX_Object
+{
+private:
+ CBC_CommonBitMatrix *m_bitMatrix;
+ CBC_CommonBitMatrix *m_tempBitMatrix;
+ CBC_QRCoderVersion *m_version;
+ CBC_QRCoderFormatInformation *m_parsedFormatInfo;
+ FX_INT32 m_dimension;
+public:
+ CBC_QRBitMatrixParser();
+ virtual ~CBC_QRBitMatrixParser();
+ CBC_QRCoderFormatInformation *ReadFormatInformation(FX_INT32 &e);
+ CBC_QRCoderVersion *ReadVersion(FX_INT32 &e);
+ FX_INT32 CopyBit(FX_INT32 i, FX_INT32 j, FX_INT32 versionBits);
+ CFX_ByteArray *ReadCodewords(FX_INT32 &e);
+ virtual void Init(CBC_CommonBitMatrix *bitMatrix, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCodeReader.h b/xfa/src/fxbarcode/src/include/BC_QRCodeReader.h
new file mode 100644
index 0000000000..71a1ad3dd6
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCodeReader.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODEREADER_H_
+#define _BC_QRCODEREADER_H_
+class CBC_QRDetector;
+class CBC_BinaryBitmap;
+class CBC_QRCoderDecoder;
+class CBC_ResultPoint;
+class CBC_ReedSolomonGF256;
+class CBC_QRCoderVersion;
+class CBC_QRDetector;
+class CBC_QRDetectorResult;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderMode;
+class CBC_QRDataMask;
+class CBC_QRCodeReader;
+class CBC_QRCodeReader : public CBC_Reader
+{
+private:
+ CBC_QRCoderDecoder *m_decoder;
+public:
+ CBC_QRCodeReader();
+ virtual ~CBC_QRCodeReader();
+ CFX_ByteString Decode(CFX_DIBitmap *pBitmap, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e);
+ CFX_ByteString Decode(const CFX_WideString &filename, FX_INT32 hints, FX_INT32 byteModeDecode, FX_INT32 &e);
+ static void ReleaseAll();
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e);
+ CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e);
+ virtual void Init();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h b/xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h
new file mode 100644
index 0000000000..a4a4cbe048
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h
@@ -0,0 +1,28 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERWRITER_H_
+#define _BC_QRCODERWRITER_H_
+#include "BC_TwoDimWriter.h"
+class CBC_TwoDimWriter;
+class CBC_MultiBarCodes;
+class CBC_QRCoderWriter;
+class CBC_QRCodeWriter : public CBC_TwoDimWriter
+{
+public:
+ CBC_QRCodeWriter();
+ virtual ~CBC_QRCodeWriter();
+ FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e);
+ FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e);
+ FX_BOOL SetVersion(FX_INT32 version);
+ FX_BOOL SetErrorCorrectionLevel(FX_INT32 level);
+ static void ReleaseAll();
+private:
+
+ FX_INT32 m_iVersion;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoder.h b/xfa/src/fxbarcode/src/include/BC_QRCoder.h
new file mode 100644
index 0000000000..89ce140fbd
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoder.h
@@ -0,0 +1,55 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODER_H_
+#define _BC_QRCODER_H_
+class CBC_QRCoderErrorCorrectionLevel ;
+class CBC_QRCoderMode;
+class CBC_CommonByteMatrix;
+class CBC_QRCoder;
+class CBC_QRCoder : public CFX_Object
+{
+private:
+ CBC_QRCoderMode* m_mode;
+ CBC_QRCoderErrorCorrectionLevel* m_ecLevel;
+ FX_INT32 m_version;
+ FX_INT32 m_matrixWidth;
+ FX_INT32 m_maskPattern;
+ FX_INT32 m_numTotalBytes;
+ FX_INT32 m_numDataBytes;
+ FX_INT32 m_numECBytes;
+ FX_INT32 m_numRSBlocks;
+ CBC_CommonByteMatrix* m_matrix;
+public:
+ const static FX_INT32 NUM_MASK_PATTERNS;
+ CBC_QRCoder();
+ virtual ~CBC_QRCoder();
+ CBC_QRCoderMode* GetMode();
+ CBC_QRCoderErrorCorrectionLevel* GetECLevel();
+ FX_INT32 GetVersion();
+ FX_INT32 GetMatrixWidth();
+ FX_INT32 GetMaskPattern();
+ FX_INT32 GetNumTotalBytes();
+ FX_INT32 GetNumDataBytes();
+ FX_INT32 GetNumECBytes();
+ FX_INT32 GetNumRSBlocks();
+ CBC_CommonByteMatrix* GetMatrix();
+ FX_INT32 At(FX_INT32 x, FX_INT32 y, FX_INT32 &e);
+ FX_BOOL IsValid();
+
+ void SetMode(CBC_QRCoderMode* value);
+ void SetECLevel(CBC_QRCoderErrorCorrectionLevel* ecLevel);
+ void SetVersion(FX_INT32 version);
+ void SetMatrixWidth(FX_INT32 width);
+ void SetMaskPattern(FX_INT32 pattern);
+ void SetNumDataBytes(FX_INT32 bytes);
+ void SetNumTotalBytes(FX_INT32 value);
+ void SetNumECBytes(FX_INT32 value);
+ void SetNumRSBlocks(FX_INT32 block);
+ void SetMatrix(CBC_CommonByteMatrix* value);
+ static FX_BOOL IsValidMaskPattern(FX_INT32 maskPattern);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h b/xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h
new file mode 100644
index 0000000000..6e9abba6c9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRECODERBITVECTOR_H_
+#define _BC_QRECODERBITVECTOR_H_
+class CBC_QRCoderBitVector;
+class CBC_QRCoderBitVector : public CFX_Object
+{
+private:
+ FX_INT32 m_sizeInBits;
+ FX_BYTE *m_array;
+ FX_INT32 m_size;
+
+ void AppendByte(FX_INT32 value);
+public:
+ CBC_QRCoderBitVector();
+ virtual ~CBC_QRCoderBitVector();
+ FX_INT32 At(FX_INT32 index, FX_INT32 &e);
+ FX_INT32 Size();
+ FX_INT32 sizeInBytes();
+ void AppendBit(FX_INT32 bit, FX_INT32 &e);
+ void AppendBits(FX_INT32 value, FX_INT32 numBits, FX_INT32 &e);
+ void AppendBitVector(CBC_QRCoderBitVector *bits, FX_INT32 &e);
+ void XOR(CBC_QRCoderBitVector *other, FX_INT32 &e);
+ FX_BYTE* GetArray();
+ void Clear();
+ virtual void Init();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h b/xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h
new file mode 100644
index 0000000000..234ac1a776
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h
@@ -0,0 +1,23 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERBLOCKPAIR_H_
+#define _BC_QRCODERBLOCKPAIR_H_
+class CBC_CommonByteArray;
+class CBC_QRCoderBlockPair;
+class CBC_QRCoderBlockPair : public CFX_Object
+{
+private:
+ CBC_CommonByteArray* m_dataBytes;
+ CBC_CommonByteArray* m_errorCorrectionBytes;
+public:
+ CBC_QRCoderBlockPair(CBC_CommonByteArray* data, CBC_CommonByteArray* errorCorrection);
+ virtual ~CBC_QRCoderBlockPair();
+
+ CBC_CommonByteArray* GetDataBytes();
+ CBC_CommonByteArray* GetErrorCorrectionBytes();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h b/xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h
new file mode 100644
index 0000000000..355af78180
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERDECODER_H_
+#define _BC_QRCODERDECODER_H_
+class CBC_CommonBitMatrix;
+class CBC_ReedSolomonDecoder;
+class CBC_CommonDecoderResult;
+class CBC_QRBitMatrixParser;
+class CBC_QRCoderVersion;
+class CBC_QRDataBlock;
+class CBC_QRCoderDecoder;
+class CBC_QRCoderDecoder : public CFX_Object
+{
+private:
+ CBC_ReedSolomonDecoder *m_rsDecoder;
+public:
+ CBC_QRCoderDecoder();
+ virtual ~CBC_QRCoderDecoder();
+
+ CBC_CommonDecoderResult* Decode(FX_BOOL* image, FX_INT32 width, FX_INT32 height, FX_INT32 &e);
+ CBC_CommonDecoderResult* Decode(CBC_CommonBitMatrix* bits, FX_INT32 byteModeDecode, FX_INT32 &e);
+ void CorrectErrors(CFX_ByteArray* codewordBytes, FX_INT32 numDataCodewords, FX_INT32 &e);
+ virtual void Init();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderECB.h b/xfa/src/fxbarcode/src/include/BC_QRCoderECB.h
new file mode 100644
index 0000000000..c6494b75cd
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderECB.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERECB_H_
+#define _BC_QRCODERECB_H_
+class CBC_QRCoderECB;
+class CBC_QRCoderECB : public CFX_Object
+{
+private:
+ FX_INT32 m_count;
+ FX_INT32 m_dataCodeWords;
+public:
+ CBC_QRCoderECB(FX_INT32 count, FX_INT32 dataCodeWords);
+ virtual ~CBC_QRCoderECB();
+ FX_INT32 GetCount();
+ FX_INT32 GetDataCodeWords();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h b/xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h
new file mode 100644
index 0000000000..385837510a
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERECBLOCKS_H_
+#define _BC_QRCODERECBLOCKS_H_
+class CBC_QRCoderECB;
+class CBC_QRCoderECBlocks;
+class CBC_QRCoderECBlocks : public CFX_Object
+{
+private:
+ FX_INT32 m_ecCodeWordsPerBlock;
+ CFX_PtrArray m_ecBlocks;
+public:
+ CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks);
+ CBC_QRCoderECBlocks(FX_INT32 ecCodeWordsPerBlock, CBC_QRCoderECB* ecBlocks1, CBC_QRCoderECB* ecBlocks2);
+ virtual ~CBC_QRCoderECBlocks();
+ FX_INT32 GetECCodeWordsPerBlock();
+ FX_INT32 GetNumBlocks();
+ FX_INT32 GetTotalECCodeWords();
+ CFX_PtrArray* GetECBlocks();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h b/xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h
new file mode 100644
index 0000000000..8dea2a6477
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h
@@ -0,0 +1,60 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERENCODER_H_
+#define _BC_QRCODERENCODER_H_
+class Make_Pair;
+class CBC_QRCoder;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderMode;
+class CBC_QRCoderBitVector;
+class CBC_CommonByteArray;
+class CBC_CommonByteMatrix;
+class CBC_QRCoderEncoder;
+class CBC_QRCoderEncoder : public CFX_Object
+{
+private:
+ const static FX_INT32 m_alphaNumbericTable[96];
+public:
+ CBC_QRCoderEncoder();
+ virtual ~CBC_QRCoderEncoder();
+
+ static void Encode(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e, FX_INT32 versionSpecify = 0);
+ static void Encode(const CFX_WideString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e);
+ static void EncodeWithSpecifyVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ CBC_QRCoder *qrCode, FX_INT32 versionSpecify, FX_INT32 &e);
+ static void EncodeWithAutoVersion(const CFX_ByteString &content, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoder *qrCode, FX_INT32 &e);
+ static CBC_QRCoderMode* ChooseMode(const CFX_ByteString & content, CFX_ByteString encoding);
+ static FX_INT32 GetAlphaNumericCode(FX_INT32 code);
+ static void AppendECI(CBC_QRCoderBitVector* bits);
+ static void AppendBytes(const CFX_ByteString &content, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e);
+ static void AppendNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void AppendAlphaNumericBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void Append8BitBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, CFX_ByteString encoding, FX_INT32 &e);
+ static void Append8BitBytes(CFX_ByteArray &bytes, CBC_QRCoderBitVector *bits, FX_INT32 &e);
+ static void AppendKanjiBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void AppendGBKBytes(const CFX_ByteString &content, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void InitQRCode(FX_INT32 numInputBytes, FX_INT32 versionNumber,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e);
+ static void InitQRCode(FX_INT32 numInputBytes, CBC_QRCoderErrorCorrectionLevel* ecLevel, CBC_QRCoderMode* mode, CBC_QRCoder* qrCode, FX_INT32 &e);
+ static void AppendModeInfo(CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void AppendLengthInfo(FX_INT32 numLetters, FX_INT32 version, CBC_QRCoderMode* mode, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+
+ static void InterleaveWithECBytes(CBC_QRCoderBitVector* bits, FX_INT32 numTotalBytes, FX_INT32 numDataBytes, FX_INT32 numRSBlocks, CBC_QRCoderBitVector* result, FX_INT32 &e);
+ static void GetNumDataBytesAndNumECBytesForBlockID(FX_INT32 numTotalBytes, FX_INT32 numDataBytes,
+ FX_INT32 numRSBlocks, FX_INT32 blockID,
+ FX_INT32 &numDataBytesInBlock, FX_INT32& numECBytesInBlocks);
+ static CBC_CommonByteArray* GenerateECBytes(CBC_CommonByteArray* dataBytes, FX_INT32 numEcBytesInBlock, FX_INT32 &e);
+ static FX_INT32 ChooseMaskPattern(CBC_QRCoderBitVector* bits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static FX_INT32 CalculateMaskPenalty(CBC_CommonByteMatrix* matrix);
+ static void TerminateBits(FX_INT32 numDataBytes, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static FX_INT32 GetSpanByVersion(CBC_QRCoderMode *modeFirst, CBC_QRCoderMode *modeSecond, FX_INT32 versionNum, FX_INT32 &e);
+ static void MergeString(CFX_PtrArray &result, FX_INT32 versionNum, FX_INT32 &e);
+ static void SplitString(const CFX_ByteString &content, CFX_PtrArray &result);
+ static void AppendDataModeLenghInfo(CFX_PtrArray &splitResult, CBC_QRCoderBitVector &headerAndDataBits, CBC_QRCoderMode *tempMode, CBC_QRCoder *qrCode, CFX_ByteString &encoding, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h b/xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h
new file mode 100644
index 0000000000..2c0ad7b0b7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h
@@ -0,0 +1,32 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERERRORCORRECTIONLEVEL_H_
+#define _BC_QRCODERERRORCORRECTIONLEVEL_H_
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderErrorCorrectionLevel : public CFX_Object
+{
+private:
+ FX_INT32 m_ordinal;
+ FX_INT32 m_bits;
+ CFX_ByteString m_name;
+ CBC_QRCoderErrorCorrectionLevel(FX_INT32 ordinal, FX_INT32 bits, FX_CHAR* name);
+ CBC_QRCoderErrorCorrectionLevel();
+public:
+ static CBC_QRCoderErrorCorrectionLevel* L;
+ static CBC_QRCoderErrorCorrectionLevel* M;
+ static CBC_QRCoderErrorCorrectionLevel* Q;
+ static CBC_QRCoderErrorCorrectionLevel* H;
+ virtual ~CBC_QRCoderErrorCorrectionLevel();
+ static void Initialize();
+ static void Finalize();
+ FX_INT32 Ordinal();
+ FX_INT32 GetBits();
+ CFX_ByteString GetName();
+ static void Destroy();
+ static CBC_QRCoderErrorCorrectionLevel* ForBits(FX_INT32 bits);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h b/xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h
new file mode 100644
index 0000000000..9d828c8380
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERFORMATINFORMATION_H_
+#define _BC_QRCODERFORMATINFORMATION_H_
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderFormatInformation;
+class CBC_QRCoderFormatInformation : public CFX_Object
+{
+private:
+ const static FX_INT32 FORMAT_INFO_MASK_QR;
+ const static FX_INT32 FORMAT_INFO_DECODE_LOOKUP[32][2];
+ const static FX_INT32 BITS_SET_IN_HALF_BYTE[16];
+ CBC_QRCoderErrorCorrectionLevel* m_errorCorrectLevl;
+ FX_BYTE m_dataMask;
+public:
+ CBC_QRCoderFormatInformation(FX_INT32 formatInfo);
+ virtual ~CBC_QRCoderFormatInformation();
+ FX_BYTE GetDataMask();
+ CBC_QRCoderErrorCorrectionLevel* GetErrorCorrectionLevel();
+
+ static FX_INT32 NumBitsDiffering(FX_INT32 a, FX_INT32 b);
+ static CBC_QRCoderFormatInformation* DecodeFormatInformation(FX_INT32 maskedFormatInfo);
+ static CBC_QRCoderFormatInformation* DoDecodeFormatInformation(FX_INT32 maskedFormatInfo);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h b/xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h
new file mode 100644
index 0000000000..134d344e72
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERMASKUTIL_H_
+#define _BC_QRCODERMASKUTIL_H_
+class CBC_CommonByteMatrix;
+class CBC_QRCoderMaskUtil;
+class CBC_QRCoderMaskUtil : public CFX_Object
+{
+public:
+ CBC_QRCoderMaskUtil();
+ virtual ~CBC_QRCoderMaskUtil();
+ static FX_BOOL GetDataMaskBit(FX_INT32 maskPattern, FX_INT32 x, FX_INT32 y, FX_INT32 &e);
+
+ static FX_INT32 ApplyMaskPenaltyRule1(CBC_CommonByteMatrix* matrix);
+ static FX_INT32 ApplyMaskPenaltyRule2(CBC_CommonByteMatrix* matrix);
+ static FX_INT32 ApplyMaskPenaltyRule3(CBC_CommonByteMatrix* matrix);
+ static FX_INT32 ApplyMaskPenaltyRule4(CBC_CommonByteMatrix* matrix);
+ static FX_INT32 ApplyMaskPenaltyRule1Internal(CBC_CommonByteMatrix* matrix, FX_BOOL isHorizontal);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h b/xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h
new file mode 100644
index 0000000000..23a9d88128
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h
@@ -0,0 +1,50 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERMATRIXUTIL_H_
+#define _BC_QRCODERMATRIXUTIL_H_
+class CBC_CommonByteMatrix;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderBitVector;
+class CBC_QRCoderMatrixUtil;
+class CBC_QRCoderMatrixUtil : public CFX_Object
+{
+private:
+ const static FX_INT32 POSITION_DETECTION_PATTERN[7][7];
+ const static FX_INT32 VERTICAL_SEPARATION_PATTERN[7][1];
+ const static FX_INT32 HORIZONTAL_SEPARATION_PATTERN[1][8];
+ const static FX_INT32 POSITION_ADJUSTMENT_PATTERN[5][5];
+ const static FX_INT32 POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[40][7];
+ const static FX_INT32 TYPE_INFO_COORDINATES[15][2];
+ const static FX_INT32 VERSION_INFO_POLY;
+ const static FX_INT32 TYPE_INFO_POLY;
+ const static FX_INT32 TYPE_INFO_MASK_PATTERN;
+public:
+ CBC_QRCoderMatrixUtil();
+ virtual ~CBC_QRCoderMatrixUtil();
+ static void ClearMatrix(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void BuildMatrix(CBC_QRCoderBitVector* dataBits, CBC_QRCoderErrorCorrectionLevel* ecLevel,
+ FX_INT32 version, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedBasicPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedTypeInfo(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_CommonByteMatrix *matrix, FX_INT32 &e);
+ static void EmbedDataBits(CBC_QRCoderBitVector* dataBits, FX_INT32 maskPattern, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void MaybeEmbedVersionInfo(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static FX_INT32 FindMSBSet(FX_INT32 value);
+ static FX_INT32 CalculateBCHCode(FX_INT32 code, FX_INT32 poly);
+ static void MakeTypeInfoBits(CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 maskPattern, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static void MakeVersionInfoBits(FX_INT32 version, CBC_QRCoderBitVector* bits, FX_INT32 &e);
+ static FX_BOOL IsEmpty(FX_INT32 value);
+ static FX_BOOL IsValidValue(FX_INT32 value);
+ static void EmbedTimingPatterns(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedDarkDotAtLeftBottomCorner(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedHorizontalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedVerticalSeparationPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedPositionAdjustmentPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedPositionDetectionPattern(FX_INT32 xStart, FX_INT32 yStart, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void EmbedPositionDetectionPatternsAndSeparators(CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+ static void MaybeEmbedPositionAdjustmentPatterns(FX_INT32 version, CBC_CommonByteMatrix* matrix, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderMode.h b/xfa/src/fxbarcode/src/include/BC_QRCoderMode.h
new file mode 100644
index 0000000000..71cea9fc78
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderMode.h
@@ -0,0 +1,40 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERMODE_H_
+#define _BC_QRCODERMODE_H_
+class CBC_QRCoderVersion;
+class CBC_QRCoderMode;
+class CBC_QRCoderMode : public CFX_Object
+{
+private:
+ FX_INT32* m_characterCountBitsForVersions;
+ FX_INT32 m_bits;
+ CFX_ByteString m_name;
+ CBC_QRCoderMode(FX_INT32 *characterCountBitsForVersions, FX_INT32 x1, FX_INT32 x2, FX_INT32 x3, FX_INT32 bits, CFX_ByteString name);
+ CBC_QRCoderMode();
+public:
+ static CBC_QRCoderMode* sBYTE;
+ static CBC_QRCoderMode* sNUMERIC;
+ static CBC_QRCoderMode* sALPHANUMERIC;
+ static CBC_QRCoderMode* sKANJI;
+ static CBC_QRCoderMode* sECI;
+ static CBC_QRCoderMode* sGBK;
+ static CBC_QRCoderMode* sTERMINATOR;
+ static CBC_QRCoderMode* sFNC1_FIRST_POSITION;
+ static CBC_QRCoderMode* sFNC1_SECOND_POSITION;
+ static CBC_QRCoderMode* sSTRUCTURED_APPEND;
+ virtual ~CBC_QRCoderMode();
+
+ static void Initialize();
+ static void Finalize();
+ static CBC_QRCoderMode* ForBits(FX_INT32 bits, FX_INT32 &e);
+ FX_INT32 GetCharacterCountBits(CBC_QRCoderVersion* version, FX_INT32 &e);
+ FX_INT32 GetBits();
+ CFX_ByteString GetName();
+ static void Destroy();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h b/xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h
new file mode 100644
index 0000000000..b693dd6dd7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h
@@ -0,0 +1,42 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRCODERVERSION_H_
+#define _BC_QRCODERVERSION_H_
+class CBC_QRCoderECBlocks;
+class CBC_CommonBitMatrix;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRCoderVersion;
+class CBC_QRCoderVersion : public CFX_Object
+{
+private:
+ const static FX_INT32 VERSION_DECODE_INFO[34];
+ static CFX_PtrArray *VERSION;
+ FX_INT32 m_versionNumber;
+ FX_INT32 m_totalCodeWords;
+ CFX_Int32Array m_alignmentPatternCenters;
+ CFX_PtrArray m_ecBlocks;
+
+ CBC_QRCoderVersion();
+ CBC_QRCoderVersion(FX_INT32 versionNumber, CBC_QRCoderECBlocks* ecBlocks1, CBC_QRCoderECBlocks* ecBlocks2,
+ CBC_QRCoderECBlocks* ecBlocks3, CBC_QRCoderECBlocks* ecBlocks4);
+public:
+ virtual ~CBC_QRCoderVersion();
+ static void Initialize();
+ static void Finalize();
+
+ FX_INT32 GetVersionNumber();
+ FX_INT32 GetTotalCodeWords();
+ FX_INT32 GetDimensionForVersion();
+ CBC_CommonBitMatrix *BuildFunctionPattern(FX_INT32 &e);
+ CFX_Int32Array* GetAlignmentPatternCenters();
+ CBC_QRCoderECBlocks* GetECBlocksForLevel(CBC_QRCoderErrorCorrectionLevel *ecLevel);
+ static CBC_QRCoderVersion* GetVersionForNumber(FX_INT32 versionNumber, FX_INT32 &e);
+ static CBC_QRCoderVersion* GetProvisionalVersionForDimension(FX_INT32 dimension, FX_INT32 &e);
+ static CBC_QRCoderVersion* DecodeVersionInformation(FX_INT32 versionBits, FX_INT32 &e);
+ static void Destroy();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRDataBlock.h b/xfa/src/fxbarcode/src/include/BC_QRDataBlock.h
new file mode 100644
index 0000000000..4f68c7a9f3
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRDataBlock.h
@@ -0,0 +1,27 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRDATABLOCK_H_
+#define _BC_QRDATABLOCK_H_
+class CBC_QRCoderVersion;
+class CBC_QRCoderECBlocks;
+class CBC_QRCoderECB;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_QRDataBlock;
+class CBC_QRDataBlock : public CFX_Object
+{
+private:
+ FX_INT32 m_numDataCodewords;
+ CFX_ByteArray *m_codewords;
+ CBC_QRDataBlock(FX_INT32 numDataCodewords, CFX_ByteArray *codewords);
+public:
+ virtual ~CBC_QRDataBlock();
+ FX_INT32 GetNumDataCodewords();
+ CFX_ByteArray* GetCodewords();
+ static CFX_PtrArray *GetDataBlocks(CFX_ByteArray* rawCodewords,
+ CBC_QRCoderVersion *version, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRDataMask.h b/xfa/src/fxbarcode/src/include/BC_QRDataMask.h
new file mode 100644
index 0000000000..6fcc09d556
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRDataMask.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRDATAMASK_H_
+#define _BC_QRDATAMASK_H_
+class CBC_CommonBitMatrix;
+class CBC_QRDataMask;
+class CBC_QRDataMask : public CFX_Object
+{
+public:
+ static CFX_PtrArray *DATA_MASKS;
+ CBC_QRDataMask();
+ virtual ~CBC_QRDataMask();
+ static void Initialize();
+ static void Finalize();
+ virtual FX_BOOL IsMasked(FX_INT32 i, FX_INT32 j) = 0;
+ void UnmaskBitMatirx(CBC_CommonBitMatrix *bits, FX_INT32 dimension);
+ static CBC_QRDataMask* ForReference(FX_INT32 reference, FX_INT32 &e);
+ static FX_INT32 BuildDataMasks();
+ static void Destroy();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h b/xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h
new file mode 100644
index 0000000000..b64485f788
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRDECODEDBITSTREAMPARSER_H_
+#define _BC_QRDECODEDBITSTREAMPARSER_H_
+class CBC_CommonDecoderResult;
+class CBC_QRCoderErrorCorrectionLevel;
+class CBC_CommonBitSource;
+class CBC_QRCoderVersion;
+class CBC_CommonCharacterSetECI;
+class CBC_QRDecodedBitStreamParser;
+class CBC_QRDecodedBitStreamParser : public CFX_Object
+{
+private:
+ const static FX_CHAR ALPHANUMERIC_CHARS[45];
+ static FX_LPCSTR UTF_8;
+ CBC_QRDecodedBitStreamParser();
+public:
+ virtual ~CBC_QRDecodedBitStreamParser();
+ static CBC_CommonDecoderResult* Decode(CFX_ByteArray *bytes, CBC_QRCoderVersion *version,
+ CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 byteModeDecode, FX_INT32 &e);
+
+ static const CFX_ByteString GuessEncoding(CFX_ByteArray* bytes);
+ static FX_INT32 ParseECIValue(CBC_CommonBitSource* bits, FX_INT32 &e);
+ static void DecodeGBKSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
+ static void DecodeKanjiSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
+ static void DecodeNumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_INT32 &e);
+ static void DecodeAlphanumericSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, FX_BOOL fac1InEffect, FX_INT32 &e);
+ static void DecodeByteSegment(CBC_CommonBitSource* bits, CFX_ByteString &result, FX_INT32 count, CBC_CommonCharacterSetECI *currentCharacterSetECI,
+ CFX_Int32Array *byteSegments, FX_INT32 byteModeDecode, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRDetector.h b/xfa/src/fxbarcode/src/include/BC_QRDetector.h
new file mode 100644
index 0000000000..60c301cb7b
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRDetector.h
@@ -0,0 +1,41 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRDETECTOR_H_
+#define _BC_QRDETECTOR_H_
+class CBC_ResultPoint;
+class CBC_CommonBitMatrix;
+class CBC_QRDetectorResult;
+class CBC_QRFinderPatternInfo;
+class CBC_QRAlignmentPattern;
+class CBC_QRFinderPatternFinder;
+class CBC_QRCoderVersion;
+class CBC_QRGridSampler;
+class CBC_QRAlignmentPatternFinder;
+class CBC_QRAlignmentPattern;
+class CBC_QRDetector;
+class CBC_QRDetector
+{
+private:
+ CBC_CommonBitMatrix *m_image;
+public:
+ CBC_QRDetector(CBC_CommonBitMatrix *image);
+ virtual ~CBC_QRDetector();
+
+ CBC_CommonBitMatrix* GetImage();
+ CBC_QRDetectorResult* Detect(FX_INT32 hints, FX_INT32 &e);
+ CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e);
+ FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft);
+ FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern);
+ FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);
+ FX_FLOAT SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);
+ CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX, FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e);
+ static FX_INT32 Round(FX_FLOAT d);
+ static FX_INT32 ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e);
+ static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,
+ CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, FX_INT32 dimension, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h b/xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h
new file mode 100644
index 0000000000..13f6d3dc46
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h
@@ -0,0 +1,23 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRDETECTORRESULT_H_
+#define _BC_QRDETECTORRESULT_H_
+class CBC_CommonBitMatrix;
+class CBC_ResultPoint;
+class CBC_QRDetectorResult;
+class CBC_QRDetectorResult : public CFX_Object
+{
+private:
+ CBC_CommonBitMatrix *m_bits;
+ CFX_PtrArray *m_points;
+public:
+ CBC_QRDetectorResult(CBC_CommonBitMatrix *bits, CFX_PtrArray *points);
+ virtual ~CBC_QRDetectorResult();
+ CBC_CommonBitMatrix *GetBits();
+ CFX_PtrArray *GetPoints();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h b/xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h
new file mode 100644
index 0000000000..af88a727d9
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h
@@ -0,0 +1,29 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRFINDERPATTERN_H_
+#define _BC_QRFINDERPATTERN_H_
+class CBC_ResultPoint;
+class CBC_QRFinderPattern;
+class CBC_QRFinderPattern : public CBC_ResultPoint
+{
+private:
+ FX_FLOAT m_estimatedModuleSize;
+ FX_INT32 m_count;
+public:
+ CBC_QRFinderPattern(FX_FLOAT x, FX_FLOAT posY, FX_FLOAT estimatedModuleSize);
+ virtual ~CBC_QRFinderPattern();
+
+ FX_INT32 GetCount();
+ FX_FLOAT GetX();
+ FX_FLOAT GetY();
+ FX_FLOAT GetEstimatedModuleSize();
+ void IncrementCount();
+ FX_BOOL AboutEquals(FX_FLOAT moduleSize, FX_FLOAT i, FX_FLOAT j);
+ CBC_QRFinderPattern *Clone();
+};
+typedef CBC_QRFinderPattern FinderPattern;
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h b/xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h
new file mode 100644
index 0000000000..7470b553ee
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h
@@ -0,0 +1,45 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRFINDERPATTERNFINDER_H_
+#define _BC_QRFINDERPATTERNFINDER_H_
+class CBC_CommonBitMatrix;
+class CBC_QRFinderPattern;
+class CBC_ResultPoint;
+class CBC_QRFinderPatternInfo;
+class CBC_QRFinderPatternFinder;
+class CBC_QRFinderPatternFinder : public CFX_Object
+{
+private:
+ const static FX_INT32 CENTER_QUORUM;
+ const static FX_INT32 MIN_SKIP;
+ const static FX_INT32 MAX_MODULES;
+ const static FX_INT32 INTEGER_MATH_SHIFT;
+ FX_BOOL m_hasSkipped;
+ CBC_CommonBitMatrix* m_image;
+ CFX_Int32Array m_crossCheckStateCount;
+ CFX_PtrArray m_possibleCenters;
+public:
+ CBC_QRFinderPatternFinder(CBC_CommonBitMatrix *image);
+ virtual ~CBC_QRFinderPatternFinder();
+ FX_INT32 FindRowSkip();
+ CBC_CommonBitMatrix* GetImage();
+ CBC_QRFinderPatternInfo* Find(FX_INT32 hint, FX_INT32 &e);
+
+ CFX_Int32Array &GetCrossCheckStateCount();
+ CFX_PtrArray *GetPossibleCenters();
+ CFX_PtrArray *SelectBestpatterns(FX_INT32 &e);
+
+ FX_BOOL HandlePossibleCenter(const CFX_Int32Array &stateCount, FX_INT32 i, FX_INT32 j);
+ FX_BOOL HaveMultiplyConfirmedCenters();
+ FX_FLOAT CenterFromEnd(const CFX_Int32Array &stateCount, FX_INT32 end);
+ FX_FLOAT CrossCheckVertical(FX_INT32 startI, FX_INT32 centerJ, FX_INT32 maxCount, FX_INT32 originalStateCountTotal);
+ FX_FLOAT CrossCheckHorizontal(FX_INT32 startJ, FX_INT32 CenterI, FX_INT32 maxCOunt, FX_INT32 originalStateCountTotal);
+ static void OrderBestPatterns(CFX_PtrArray *patterns);
+ static FX_BOOL FoundPatternCross(const CFX_Int32Array &stateCount);
+ static FX_FLOAT Distance(CBC_ResultPoint* point1, CBC_ResultPoint* point2);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_QRGridSampler.h b/xfa/src/fxbarcode/src/include/BC_QRGridSampler.h
new file mode 100644
index 0000000000..0b8c7d3ab7
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_QRGridSampler.h
@@ -0,0 +1,33 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_QRGRIDSAMPLER_H_
+#define _BC_QRGRIDSAMPLER_H_
+class CBC_CommonBitMatrix;
+class CBC_CommonPerspectiveTransform;
+class CBC_CommonDefaultGridSampler;
+class CBC_QRGridSampler;
+class CBC_QRGridSampler
+{
+private:
+ static CBC_QRGridSampler m_gridSampler;
+public:
+ CBC_QRGridSampler();
+ virtual ~CBC_QRGridSampler();
+ virtual CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, FX_INT32 dimensionX, FX_INT32 dimensionY,
+ FX_FLOAT p1ToX, FX_FLOAT p1ToY,
+ FX_FLOAT p2ToX, FX_FLOAT p2ToY,
+ FX_FLOAT p3ToX, FX_FLOAT p3ToY,
+ FX_FLOAT p4ToX, FX_FLOAT p4ToY,
+ FX_FLOAT p1FromX, FX_FLOAT p1FromY,
+ FX_FLOAT p2FromX, FX_FLOAT p2FromY,
+ FX_FLOAT p3FromX, FX_FLOAT p3FromY,
+ FX_FLOAT p4FromX, FX_FLOAT p4FromY, FX_INT32 &e);
+
+ static CBC_QRGridSampler &GetInstance();
+ static void CheckAndNudgePoints(CBC_CommonBitMatrix *image, CFX_FloatArray *points, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Reader.h b/xfa/src/fxbarcode/src/include/BC_Reader.h
new file mode 100644
index 0000000000..42b2aa11f5
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Reader.h
@@ -0,0 +1,19 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_READER_H_
+#define _BC_READER_H_
+class CBC_BinaryBitmap;
+class CBC_Reader;
+class CBC_Reader : public CFX_Object
+{
+public:
+ CBC_Reader();
+ virtual ~CBC_Reader();
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e) = 0;
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) = 0;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ReedSolomon.h b/xfa/src/fxbarcode/src/include/BC_ReedSolomon.h
new file mode 100644
index 0000000000..2950b8f315
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ReedSolomon.h
@@ -0,0 +1,25 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_READSOLOMON_H_
+#define _BC_READSOLOMON_H_
+class CBC_ReedSolomonGF256;
+class CBC_ReedSolomonGF256Poly;
+class CBC_ReedSolomonEncoder;
+class CBC_ReedSolomonEncoder : public CFX_Object
+{
+private:
+ CBC_ReedSolomonGF256* m_field;
+ CFX_PtrArray m_cachedGenerators;
+ CBC_ReedSolomonGF256Poly* BuildGenerator(FX_INT32 degree, FX_INT32 &e);
+public:
+ CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256 * field);
+ virtual ~CBC_ReedSolomonEncoder();
+
+ void Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e);
+ virtual void Init();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h b/xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h
new file mode 100644
index 0000000000..c1dd0f03f5
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_REEDSOLOMONDECODER_H_
+#define _BC_REEDSOLOMONDECODER_H_
+class CBC_ReedSolomonGF256;
+class CBC_ReedSolomonGF256Poly;
+class CBC_ReedSolomonDecoder;
+class CBC_ReedSolomonDecoder : public CFX_Object
+{
+private:
+ CBC_ReedSolomonGF256 * m_field;
+public:
+ CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256 * field);
+ virtual ~CBC_ReedSolomonDecoder();
+ void Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e);
+ CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e);
+ CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e);
+ CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h b/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h
new file mode 100644
index 0000000000..1687b95e09
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_REEDSOLOMONGF256_H_
+#define _BC_REEDSOLOMONGF256_H_
+class CBC_ReedSolomonGF256Poly;
+class CBC_ReedSolomonGF256;
+class CBC_ReedSolomonGF256 : public CFX_Object
+{
+public:
+ static void Initialize();
+ static void Finalize();
+ static CBC_ReedSolomonGF256 *QRCodeFild;
+ static CBC_ReedSolomonGF256 *DataMatrixField;
+ CBC_ReedSolomonGF256(FX_INT32 primitive);
+ virtual ~CBC_ReedSolomonGF256();
+ CBC_ReedSolomonGF256Poly* GetZero();
+ CBC_ReedSolomonGF256Poly* GetOne();
+ CBC_ReedSolomonGF256Poly* BuildMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
+ static FX_INT32 AddOrSubtract(FX_INT32 a, FX_INT32 b);
+ FX_INT32 Exp(FX_INT32 a);
+ FX_INT32 Log(FX_INT32 a, FX_INT32 &e);
+ FX_INT32 Inverse(FX_INT32 a, FX_INT32 &e);
+ FX_INT32 Multiply(FX_INT32 a, FX_INT32 b);
+ virtual void Init();
+private:
+ FX_INT32 m_expTable[256];
+ FX_INT32 m_logTable[256];
+ CBC_ReedSolomonGF256Poly *m_zero;
+ CBC_ReedSolomonGF256Poly *m_one;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h b/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h
new file mode 100644
index 0000000000..a6db24e231
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h
@@ -0,0 +1,33 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_READSOLOMONGF256POLY_H_
+#define _BC_READSOLOMONGF256POLY_H_
+class CBC_ReedSolomonGF256;
+class CBC_ReedSolomonGF256Poly;
+class CBC_ReedSolomonGF256Poly : public CFX_Object
+{
+public:
+ CBC_ReedSolomonGF256Poly(CBC_ReedSolomonGF256* field, FX_INT32 coefficients);
+ CBC_ReedSolomonGF256Poly();
+ virtual ~CBC_ReedSolomonGF256Poly();
+ FX_INT32 GetCoefficients(FX_INT32 degree);
+ CFX_Int32Array* GetCoefficients();
+ FX_INT32 GetDegree();
+ FX_BOOL IsZero();
+ FX_INT32 EvaluateAt(FX_INT32 a);
+ CBC_ReedSolomonGF256Poly* AddOrSubtract(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* Multiply(CBC_ReedSolomonGF256Poly* other, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* Multiply(FX_INT32 scalar, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* MultiplyByMonomial(FX_INT32 degree, FX_INT32 coefficient, FX_INT32 &e);
+ CFX_PtrArray* Divide(CBC_ReedSolomonGF256Poly *other, FX_INT32 &e);
+ CBC_ReedSolomonGF256Poly* Clone(FX_INT32 &e);
+ virtual void Init(CBC_ReedSolomonGF256* field, CFX_Int32Array* coefficients, FX_INT32 &e);
+private:
+ CBC_ReedSolomonGF256* m_field;
+ CFX_Int32Array m_coefficients;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_ResultPoint.h b/xfa/src/fxbarcode/src/include/BC_ResultPoint.h
new file mode 100644
index 0000000000..7001cfa2a5
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_ResultPoint.h
@@ -0,0 +1,24 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_RESULTPOINT_H_
+#define _BC_RESULTPOINT_H_
+class CBC_ResultPoint;
+class CBC_ResultPoint : public CFX_Object
+{
+public:
+ CBC_ResultPoint();
+ CBC_ResultPoint(FX_FLOAT x, FX_FLOAT y);
+ virtual ~CBC_ResultPoint()
+ {
+ }
+ virtual FX_FLOAT GetX();
+ virtual FX_FLOAT GetY();
+protected:
+ FX_FLOAT m_x;
+ FX_FLOAT m_y;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_SymbolInfo.h b/xfa/src/fxbarcode/src/include/BC_SymbolInfo.h
new file mode 100644
index 0000000000..0450a28725
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_SymbolInfo.h
@@ -0,0 +1,53 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_SYMBOLINFO_H_
+#define _BC_SYMBOLINFO_H_
+class CBC_SymbolShapeHint;
+class CBC_Dimension;
+class CBC_SymbolInfo;
+class CBC_SymbolInfo : public CBC_SymbolShapeHint
+{
+public:
+ CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords,
+ FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions);
+ virtual ~CBC_SymbolInfo();
+ static void Initialize();
+ static void Finalize();
+ static void overrideSymbolSet(CBC_SymbolInfo* override);
+ static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_INT32 &e);
+ static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_INT32 &e);
+ static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, FX_BOOL allowRectangular, FX_BOOL fail, FX_INT32 &e);
+ static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, FX_BOOL fail, FX_INT32 &e);
+ static CBC_SymbolInfo* lookup(FX_INT32 dataCodewords, SymbolShapeHint shape, CBC_Dimension* minSize, CBC_Dimension* maxSize, FX_BOOL fail, FX_INT32 &e);
+ FX_INT32 getHorizontalDataRegions(FX_INT32 &e);
+ FX_INT32 getVerticalDataRegions(FX_INT32 &e);
+ FX_INT32 getSymbolDataWidth(FX_INT32 &e);
+ FX_INT32 getSymbolDataHeight(FX_INT32 &e);
+ FX_INT32 getSymbolWidth(FX_INT32 &e);
+ FX_INT32 getSymbolHeight(FX_INT32 &e);
+ FX_INT32 getCodewordCount();
+ FX_INT32 getInterleavedBlockCount();
+ FX_INT32 getDataLengthForInterleavedBlock(FX_INT32 index);
+ FX_INT32 getErrorLengthForInterleavedBlock(FX_INT32 index);
+ CFX_WideString toString(FX_INT32 &e);
+public:
+ FX_INT32 m_dataCapacity;
+ FX_INT32 m_errorCodewords;
+ FX_INT32 m_matrixWidth;
+ FX_INT32 m_matrixHeight;
+ FX_INT32 m_rsBlockData;
+ FX_INT32 m_rsBlockError;
+ static CBC_SymbolInfo* m_PROD_SYMBOLS[30];
+private:
+ static CBC_SymbolInfo* m_symbols[30];
+ FX_BOOL m_rectangular;
+ FX_INT32 m_dataRegions;
+private:
+ CBC_SymbolInfo(FX_BOOL rectangular, FX_INT32 dataCapacity, FX_INT32 errorCodewords, FX_INT32 matrixWidth, FX_INT32 matrixHeight, FX_INT32 dataRegions,
+ FX_INT32 rsBlockData, FX_INT32 rsBlockError);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h b/xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h
new file mode 100644
index 0000000000..2b030012a3
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_SYMBOLSHAPEHINT_H_
+#define _BC_SYMBOLSHAPEHINT_H_
+class CBC_SymbolShapeHint;
+class CBC_SymbolShapeHint : public CFX_Object
+{
+public:
+ CBC_SymbolShapeHint();
+ virtual ~CBC_SymbolShapeHint();
+ enum SymbolShapeHint {
+ FORCE_NONE,
+ FORCE_SQUARE,
+ FORCE_RECTANGLE,
+ };
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_TextEncoder.h b/xfa/src/fxbarcode/src/include/BC_TextEncoder.h
new file mode 100644
index 0000000000..f1168679a6
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_TextEncoder.h
@@ -0,0 +1,18 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_TEXTENCODER_H_
+#define _BC_TEXTENCODER_H_
+class CBC_TextEncoder;
+class CBC_TextEncoder : public CBC_C40Encoder
+{
+public:
+ CBC_TextEncoder();
+ virtual ~CBC_TextEncoder();
+ FX_INT32 getEncodingMode();
+ FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h b/xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h
new file mode 100644
index 0000000000..369d494c08
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h
@@ -0,0 +1,44 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_TWODIMWRITER_H_
+#define _BC_TWODIMWRITER_H_
+#include "BC_Writer.h"
+class CBC_Writer;
+class CBC_CommonBitMatrix;
+class CBC_TwoDimWriter;
+class CBC_TwoDimWriter : public CBC_Writer
+{
+public:
+ CBC_TwoDimWriter();
+ virtual ~CBC_TwoDimWriter();
+ virtual FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+ {
+ return NULL;
+ };
+ virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)
+ {
+ return NULL;
+ };
+ virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)
+ {
+ return NULL;
+ };
+ virtual void RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e);
+ virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e);
+ virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix);
+ virtual FX_BOOL SetErrorCorrectionLevel (FX_INT32 level) = 0;
+ virtual FX_INT32 GetErrorCorrectionLevel()
+ {
+ return m_iCorrectLevel;
+ };
+
+protected:
+ FX_INT32 m_iCorrectLevel;
+ FX_BOOL m_bFixedSize;
+ CBC_CommonBitMatrix* m_output;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h b/xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h
new file mode 100644
index 0000000000..1ee3a8c64c
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h
@@ -0,0 +1,22 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_UTILCODINGCONVERT_H_
+#define _BC_UTILCODINGCONVERT_H_
+class CBC_UtilCodingConvert;
+class CBC_UtilCodingConvert : public CFX_Object
+{
+public:
+ CBC_UtilCodingConvert();
+ virtual ~CBC_UtilCodingConvert();
+ static void UnicodeToLocale(const CFX_WideString &source, CFX_ByteString &result);
+ static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteString &result);
+ static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteArray &result);
+ static void Utf8ToLocale(const CFX_ByteArray &source, CFX_ByteString &result);
+ static void Utf8ToLocale(const FX_BYTE *source, FX_INT32 count, CFX_ByteString &result);
+ static void UnicodeToUTF8(const CFX_WideString &source, CFX_ByteString &result);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_UtilRSS.h b/xfa/src/fxbarcode/src/include/BC_UtilRSS.h
new file mode 100644
index 0000000000..37834eaa76
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_UtilRSS.h
@@ -0,0 +1,23 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_UTILRESS_H_
+#define _BC_UTILRESS_H_
+class CBC_RssPair;
+class CBC_UtilRSS : public CFX_Object
+{
+public:
+ virtual ~CBC_UtilRSS();
+ static FX_INT32 GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow);
+
+protected:
+ static CFX_Int32Array *GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow);
+ static FX_INT32 Combins(FX_INT32 n, FX_INT32 r);
+ static CFX_Int32Array *Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K);
+private:
+ CBC_UtilRSS();
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h b/xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h
new file mode 100644
index 0000000000..83d91ced92
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h
@@ -0,0 +1,38 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_WHITERECTANLEDETECTOR_H_
+#define _BC_WHITERECTANLEDETECTOR_H_
+class CBC_CommonBitMatrix;
+class CBC_ResultPoint;
+class CBC_WhiteRectangleDetector;
+class CBC_WhiteRectangleDetector : public CFX_Object
+{
+public:
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image);
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y);
+ virtual ~CBC_WhiteRectangleDetector();
+ CFX_PtrArray *Detect(FX_INT32 &e);
+ virtual void Init(FX_INT32 &e);
+private:
+ FX_INT32 Round(float d);
+ CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
+ FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);
+ CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z,
+ CBC_ResultPoint *x, CBC_ResultPoint *t);
+ FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal);
+ const static FX_INT32 INIT_SIZE;
+ const static FX_INT32 CORR;
+
+ CBC_CommonBitMatrix *m_image;
+ FX_INT32 m_height;
+ FX_INT32 m_width;
+ FX_INT32 m_leftInit;
+ FX_INT32 m_rightInit;
+ FX_INT32 m_downInit;
+ FX_INT32 m_upInit;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_Writer.h b/xfa/src/fxbarcode/src/include/BC_Writer.h
new file mode 100644
index 0000000000..deb68c07be
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_Writer.h
@@ -0,0 +1,35 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_WRITER_H_
+#define _BC_WRITER_H_
+class CBC_Writer;
+class CBC_Writer : public CFX_Object
+{
+public:
+ CBC_Writer();
+ virtual ~CBC_Writer();
+ virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) = 0;
+ virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) = 0;
+ virtual FX_BOOL SetCharEncoding(FX_INT32 encoding);
+ virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight);
+ virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth);
+ virtual FX_BOOL SetHeight(FX_INT32 height);
+ virtual FX_BOOL SetWidth(FX_INT32 width);
+ virtual void SetBackgroundColor(FX_ARGB backgroundColor);
+ virtual void SetBarcodeColor(FX_ARGB foregroundColor);
+protected:
+ CFX_DIBitmap* CreateDIBitmap(FX_INT32 width, FX_INT32 height);
+ FX_INT32 m_CharEncoding;
+ FX_INT32 m_ModuleHeight;
+ FX_INT32 m_ModuleWidth;
+ FX_INT32 m_Height;
+ FX_INT32 m_Width;
+ FXDIB_Format m_colorSpace;
+ FX_ARGB m_barColor;
+ FX_ARGB m_backgroundColor;
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/BC_X12Encoder.h b/xfa/src/fxbarcode/src/include/BC_X12Encoder.h
new file mode 100644
index 0000000000..21111bc5cc
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/BC_X12Encoder.h
@@ -0,0 +1,21 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_X12ENCODER_H_
+#define _BC_X12ENCODER_H_
+class CBC_C40Encoder;
+class CBC_X12Encoder;
+class CBC_X12Encoder : public CBC_C40Encoder
+{
+public:
+ CBC_X12Encoder();
+ virtual ~CBC_X12Encoder();
+ FX_INT32 getEncodingMode();
+ void Encode(CBC_EncoderContext &context, FX_INT32 &e);
+ void handleEOD(CBC_EncoderContext &context, CFX_WideString &buffer, FX_INT32 &e);
+ FX_INT32 encodeChar(FX_WCHAR c, CFX_WideString &sb, FX_INT32 &e);
+};
+#endif
diff --git a/xfa/src/fxbarcode/src/include/utils.h b/xfa/src/fxbarcode/src/include/utils.h
new file mode 100644
index 0000000000..ecaadccef0
--- /dev/null
+++ b/xfa/src/fxbarcode/src/include/utils.h
@@ -0,0 +1,219 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _BC_UTILS_H_
+#define _BC_UTILS_H_
+typedef CFX_MapPtrTemplate<FX_LPVOID, FX_INT32> CFX_PtrToInt32;
+FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c);
+void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c);
+void BC_FX_ByteString_Append(CFX_ByteString &dst, const CFX_ByteArray &ba);
+typedef FX_BOOL (*BC_PtrArrayCompareCallback)(FX_LPVOID l, FX_LPVOID r);
+void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun);
+template<class _Ty>
+class CBC_AutoPtr
+{
+public:
+ typedef _Ty element_type;
+ explicit CBC_AutoPtr(_Ty *_P = 0)
+ : _Owns(_P != 0), _Ptr(_P) {}
+ CBC_AutoPtr(const CBC_AutoPtr<_Ty>& _Y)
+ : _Owns(_Y._Owns), _Ptr(_Y.release()) {}
+ CBC_AutoPtr<_Ty>& operator=(const CBC_AutoPtr<_Ty>& _Y)
+ {
+ if (this != &_Y) {
+ if (_Ptr != _Y.get()) {
+ if (_Owns) {
+ delete _Ptr;
+ }
+ _Owns = _Y._Owns;
+ } else if (_Y._Owns) {
+ _Owns = TRUE;
+ }
+ _Ptr = _Y.release();
+ }
+ return (*this);
+ }
+ ~CBC_AutoPtr()
+ {
+ if (_Owns) {
+ delete _Ptr;
+ }
+ }
+ _Ty& operator*() const
+ {
+ return (*get());
+ }
+ _Ty *operator->() const
+ {
+ return (get());
+ }
+ _Ty *get() const
+ {
+ return (_Ptr);
+ }
+ _Ty *release() const
+ {
+ ((CBC_AutoPtr<_Ty> *)this)->_Owns = FALSE;
+ return (_Ptr);
+ }
+private:
+ FX_BOOL _Owns;
+ _Ty *_Ptr;
+};
+#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
+#include <limits>
+#elif (_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_IOS_)
+#include <limits.h>
+#endif
+#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
+#define FXSYS_isnan(x) _isnan(x)
+#elif (_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_)
+#include <math.h>
+#define FXSYS_isnan(x) std::isnan(x)
+#elif (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_)
+#include <math.h>
+#define FXSYS_isnan(x) isnan(x)
+#endif
+#if (_FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_)
+#define FXSYS_nan() (std::numeric_limits<float>::quiet_NaN())
+#elif (_FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_IOS_ || _FX_OS_ == _FX_ANDROID_)
+#define FXSYS_nan() NAN
+#endif
+enum BCFORMAT {
+ BCFORMAT_UNSPECIFY = -1,
+ BCFORMAT_CODABAR,
+ BCFORMAT_CODE_39,
+ BCFORMAT_CODE_128,
+ BCFORMAT_CODE_128B,
+ BCFORMAT_CODE_128C,
+ BCFORMAT_EAN_8,
+ BCFORMAT_UPC_A,
+ BCFORMAT_EAN_13,
+ BCFORMAT_PDF_417,
+ BCFORMAT_DATAMATRIX,
+ BCFORMAT_QR_CODE
+};
+#define BCFORMAT_ECLEVEL_L 0
+#define BCFORMAT_ECLEVEL_M 1
+#define BCFORMAT_ECLEVEL_Q 2
+#define BCFORMAT_ECLEVEL_H 3
+#include <ctype.h>
+#define FXSYS_IntMax INT_MAX
+#define FXSYS_Isdigit isdigit
+#define BCExceptionNO 0
+#define BCExceptionNotFound 1
+#define BCExceptionEndLessThanStart 2
+#define BCExceptionUnknownDecoder 3
+#define BCExceptionRotateNotSupported 4
+#define BCExceptionHeightAndWidthMustBeAtLeast1 5
+#define BCExceptionRegionMustFitInsideMatrix 6
+#define BCExceptionCanNotCallGetDimensionOnNonSquareMatrix 7
+#define BCExceptionFormatException 8
+#define BCExceptionIllegalArgumentMustMatchVersionSize 9
+#define BCExceptionChecksumException 10
+#define BCExceptionIllegalArgumentInvalidFirstDigit 11
+#define BCExceptionIllegalArgumentInvalidSecondDigit 12
+#define BCExceptionRuntimeDecodingInvalidISO_IEC 13
+#define BCExceptionRuntimeDecodingInvalidAlphanumeric 14
+#define BCExceptionLeftAndTopMustBeNonnegative 15
+#define BCExceptionIllegalArgument 16
+#define BCExceptionBadECI 17
+#define BCExceptionUnSupportedBarcode 18
+#define BCExceptionUnSupportedString 19
+#define BCExceptionDigitLengthMustBe8 20
+#define BCExceptionDataCheckException 21
+#define BCExceptionExtractNumberValueFromBitArray 22
+#define BCExceptionRead 23
+#define BCExceptionRequestedRowIsOutSizeTheImage 24
+#define BCExceptionNoContents 26
+#define BCExceptionUnSupportEclevel 27
+#define BCExceptionUnSupportMode 28
+#define BCExceptionReferenceMustBeBetween0And7 29
+#define BCExceptionBadErrorLocation 30
+#define BCExceptionDegreeIsNegative 31
+#define BCExceptionDivideByZero 32
+#define BCExceptionCoefficientsSizeIsNull 33
+#define BCExceptionNoCorrectionBytes 34
+#define BCExceptionNoDataBytesProvided 35
+#define BCExceptionR_I_1IsZero 36
+#define BCExceptionAIsZero 37
+#define BCExceptionIsZero 38
+#define BCExceptionDegreeNotMatchRoots 39
+#define BCExceptionContentsLengthShouldBetween1and80 40
+#define BCExceptionOnlyEncodeCODE_128 41
+#define BCExceptionOnlyEncodeCODE_39 42
+#define BCExceptionOnlyEncodeEAN_13 43
+#define BCExceptionOnlyEncodeEAN_8 44
+#define BCExceptionOnlyEncodeITF 45
+#define BCExceptionDigitLengthShould13 46
+#define BCExceptionDigitLengthMustBe6or8or10or12or14or16or20or24or44 47
+#define BCExceptionOnlyEncodeUPC_A 48
+#define BCExceptionDigitLengthShouldBe12 49
+#define BCExceptionValueMustBeEither0or1 50
+#define BCExceptionReedsolomnDecodeException 51
+#define BCExceptionBadIndexException 52
+#define BCExceptionBadValueException 53
+#define BCExceptionBadNumBitsException 54
+#define BCExceptioncanNotOperatexorOperator 55
+#define BCExceptionVersionMust1_40 56
+#define BCExceptionUnknown 57
+#define BCExceptionNoSuchVersion 58
+#define BCExceptionCannotFindBlockInfo 59
+#define BCExceptionDataTooBig 60
+#define BCExceptionInvalidQRCode 61
+#define BCExceptionDataTooMany 62
+#define BCExceptionBitsNotEqualCacity 63
+#define BCExceptionUnsupportedMode 64
+#define BCExceptionInvalidateCharacter 65
+#define BCExceptionBytesNotMatchOffset 66
+#define BCExceptionSizeInBytesDiffer 67
+#define BCExceptionInvalidateMaskPattern 68
+#define BCExceptionNullPointer 69
+#define BCExceptionBadMask 70
+#define BCExceptionBitSizeNot15 71
+#define BCExceptionBitSizeNot18 72
+#define BCExceptionInvalidateImageData 73
+#define BCExceptionHeight_8BeZero 74
+#define BCExceptionCharacterNotThisMode 75
+#define BCExceptionBitsBytesNotMatch 76
+#define BCExceptionInvalidateData 77
+#define BCExceptionLoadFile 78
+#define BCExceptionPDF417EncodeFail 79
+#define BCExceptionFailToCreateBitmap 80
+#define BCExceptionLoadFontFail 81
+#define BCExceptionOnlyEncodeCODEBAR 82
+#define BCExceptionCodabarShouldStartWithOneOfABCD 83
+#define BCExceptionCodabarShouldEndWithOneOfTNE 84
+#define BCExceptionCodabarEncodeCharsInvalid 85
+#define BCExceptionOnlyEncodeDATAMATRIX 86
+#define BCExceptionCharactersOutsideISO88591Encoding 87
+#define BCExceptionIllegalDataCodewords 88
+#define BCExceptionCannotHandleThisNumberOfDataRegions 89
+#define BCExceptionIllegalStateUnexpectedCase 90
+#define BCExceptionIllegalStateCountMustNotExceed4 91
+#define BCExceptionIllegalStateMessageLengthInvalid 92
+#define BCExceptionIllegalArgumentNotGigits 93
+#define BCExceptionIllegalStateIllegalMode 94
+#define BCExceptionOnlyEncodePDF417 95
+#define BCExceptionNonEncodableCharacterDetected 96
+#define BCExceptionErrorCorrectionLevelMustBeBetween0And8 97
+#define BCExceptionNoRecommendationPossible 98
+#define BCExceptionIllegalArgumentnMustBeAbove0 99
+#define BCExceptionUnableToFitMessageInColumns 100
+#define BCExceptionEncodedMessageContainsTooManyCodeWords 101
+#define BCExceptionBitmapSizeError 102
+#define BCExceptionFormatInstance 102
+#define BCExceptionChecksumInstance 103
+#define BCExceptiontNotFoundInstance 104
+#define BCExceptionNotFoundInstance 105
+#define BCExceptionCannotMetadata 106
+#define TWO_DIGIT_DATA_LENGTH_SIZE 24
+#define THREE_DIGIT_DATA_LENGTH_SIZE 23
+#define THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH_SIZE 57
+#define FOUR_DIGIT_DATA_LENGTH_SIZE 17
+#define BC_EXCEPTION_CHECK_ReturnVoid(e) if (e != BCExceptionNO) return;
+#define BC_EXCEPTION_CHECK_ReturnValue(e, v) if (e != BCExceptionNO) return v;
+#endif