"xfa/src/fwl/src/theme/pushbuttontp.cpp",
"xfa/src/fwl/src/theme/scrollbartp.cpp",
"xfa/src/fwl/src/theme/widgettp.cpp",
- "xfa/src/fxbarcode/src/barcode.h",
- "xfa/src/fxbarcode/src/BC_ASCIIEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_BarCode.cpp",
- "xfa/src/fxbarcode/src/BC_Base256Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_Binarizer.cpp",
- "xfa/src/fxbarcode/src/BC_BinaryBitmap.cpp",
- "xfa/src/fxbarcode/src/BC_BufferedImageLuminanceSource.cpp",
- "xfa/src/fxbarcode/src/BC_C40Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitArray.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitSource.cpp",
- "xfa/src/fxbarcode/src/BC_CommonByteArray.cpp",
- "xfa/src/fxbarcode/src/BC_CommonByteMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_CommonCharacterSetECI.cpp",
- "xfa/src/fxbarcode/src/BC_CommonDecoderResult.cpp",
- "xfa/src/fxbarcode/src/BC_CommonECI.cpp",
- "xfa/src/fxbarcode/src/BC_CommonPerspectiveTransform.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixBitMatrixParser.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDataBlock.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDetector.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixReader.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixSymbolInfo144.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixVersion.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixWriter.cpp",
- "xfa/src/fxbarcode/src/BC_DefaultPlacement.cpp",
- "xfa/src/fxbarcode/src/BC_Dimension.cpp",
- "xfa/src/fxbarcode/src/BC_EdifactEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_EncoderContext.cpp",
- "xfa/src/fxbarcode/src/BC_ErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_FinderPatternInfo.cpp",
- "xfa/src/fxbarcode/src/BC_GlobalHistogramBinarizer.cpp",
- "xfa/src/fxbarcode/src/BC_HighLevelEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_Library.cpp",
- "xfa/src/fxbarcode/src/BC_LuminanceSource.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCodaBarReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCodaBarWriter.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode128Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode128Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode39Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode39Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN13Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN13Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN8Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN8Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OneDimReader.cpp",
- "xfa/src/fxbarcode/src/BC_OneDimWriter.cpp",
- "xfa/src/fxbarcode/src/BC_OneDReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedUPCAReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedUPCAWriter.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeMetadata.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeRow.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeValue.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BoundingBox.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Codeword.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417CodewordDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Common.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Compaction.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResult.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResultColumn.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResultRowIndicatorColumn.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Detector.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectorResult.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Dimensions.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECModulusGF.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECModulusPoly.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417HighLevelEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Reader.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ResultMetadata.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ScanningDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Writer.cpp",
- "xfa/src/fxbarcode/src/BC_QRAlignmentPattern.cpp",
- "xfa/src/fxbarcode/src/BC_QRAlignmentPatternFinder.cpp",
- "xfa/src/fxbarcode/src/BC_QRBitMatrixParser.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderBitVector.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderBlockPair.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCodeReader.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderECB.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderECBlocks.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderErrorCorrectionLevel.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderFormatInformation.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMaskUtil.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMatrixUtil.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMode.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderVersion.cpp",
- "xfa/src/fxbarcode/src/BC_QRCodeWriter.cpp",
- "xfa/src/fxbarcode/src/BC_QRDataBlock.cpp",
- "xfa/src/fxbarcode/src/BC_QRDataMask.cpp",
- "xfa/src/fxbarcode/src/BC_QRDecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_QRDetector.cpp",
- "xfa/src/fxbarcode/src/BC_QRDetectorResult.cpp",
- "xfa/src/fxbarcode/src/BC_QRFinderPattern.cpp",
- "xfa/src/fxbarcode/src/BC_QRFinderPatternFinder.cpp",
- "xfa/src/fxbarcode/src/BC_QRGridSampler.cpp",
- "xfa/src/fxbarcode/src/BC_Reader.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomon.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonGF256.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonGF256Poly.cpp",
- "xfa/src/fxbarcode/src/BC_ResultPoint.cpp",
- "xfa/src/fxbarcode/src/BC_SymbolInfo.cpp",
- "xfa/src/fxbarcode/src/BC_SymbolShapeHint.cpp",
- "xfa/src/fxbarcode/src/BC_TextEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_TwoDimWriter.cpp",
- "xfa/src/fxbarcode/src/BC_UtilCodingConvert.cpp",
- "xfa/src/fxbarcode/src/BC_UtilRSS.cpp",
- "xfa/src/fxbarcode/src/BC_Utils.cpp",
- "xfa/src/fxbarcode/src/BC_WhiteRectangleDetector.cpp",
- "xfa/src/fxbarcode/src/BC_Writer.cpp",
- "xfa/src/fxbarcode/src/BC_X12Encoder.cpp",
- "xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_Base256Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_Binarizer.h",
- "xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h",
- "xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h",
- "xfa/src/fxbarcode/src/include/BC_C40Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitArray.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitSource.h",
- "xfa/src/fxbarcode/src/include/BC_CommonByteArray.h",
- "xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h",
- "xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h",
- "xfa/src/fxbarcode/src/include/BC_CommonECI.h",
- "xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h",
- "xfa/src/fxbarcode/src/include/BC_DecoderResult.h",
- "xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h",
- "xfa/src/fxbarcode/src/include/BC_Dimension.h",
- "xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_EncoderContext.h",
- "xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h",
- "xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h",
- "xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_LuminanceSource.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OneDimReader.h",
- "xfa/src/fxbarcode/src/include/BC_OneDimWriter.h",
- "xfa/src/fxbarcode/src/include/BC_OneDReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Common.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Detector.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Reader.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Writer.h",
- "xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h",
- "xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h",
- "xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCodeReader.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderECB.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMode.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h",
- "xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h",
- "xfa/src/fxbarcode/src/include/BC_QRDataBlock.h",
- "xfa/src/fxbarcode/src/include/BC_QRDataMask.h",
- "xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_QRDetector.h",
- "xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h",
- "xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h",
- "xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h",
- "xfa/src/fxbarcode/src/include/BC_QRGridSampler.h",
- "xfa/src/fxbarcode/src/include/BC_Reader.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomon.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h",
- "xfa/src/fxbarcode/src/include/BC_ResultPoint.h",
- "xfa/src/fxbarcode/src/include/BC_SymbolInfo.h",
- "xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h",
- "xfa/src/fxbarcode/src/include/BC_TextEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h",
- "xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h",
- "xfa/src/fxbarcode/src/include/BC_UtilRSS.h",
- "xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h",
- "xfa/src/fxbarcode/src/include/BC_Writer.h",
- "xfa/src/fxbarcode/src/include/BC_X12Encoder.h",
- "xfa/src/fxbarcode/src/include/utils.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitArray.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitSource.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonByteArray.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonECI.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitArray.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitSource.h",
+ "xfa/src/fxbarcode/common/BC_CommonByteArray.h",
+ "xfa/src/fxbarcode/common/BC_CommonByteMatrix.h",
+ "xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h",
+ "xfa/src/fxbarcode/common/BC_CommonDecoderResult.h",
+ "xfa/src/fxbarcode/common/BC_CommonECI.h",
+ "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.h",
+ "xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp",
+ "xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h",
+ "xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp",
+ "xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h",
+ "xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolShapeHint.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h",
+ "xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolShapeHint.h",
+ "xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h",
+ "xfa/src/fxbarcode/datamatrix/BC_Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDimReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OneDimReader.h",
+ "xfa/src/fxbarcode/oned/BC_OneDimWriter.h",
+ "xfa/src/fxbarcode/oned/BC_OneDReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Compaction.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Common.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Compaction.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPattern.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPattern.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataMask.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetector.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h",
+ "xfa/src/fxbarcode/qrcode/BC_FinderPatternInfo.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_FinderPatternInfo.h",
+ "xfa/src/fxbarcode/BC_BarCode.cpp",
+ "xfa/src/fxbarcode/BC_Binarizer.cpp",
+ "xfa/src/fxbarcode/BC_BinaryBitmap.cpp",
+ "xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp",
+ "xfa/src/fxbarcode/BC_Dimension.cpp",
+ "xfa/src/fxbarcode/BC_Library.cpp",
+ "xfa/src/fxbarcode/BC_LuminanceSource.cpp",
+ "xfa/src/fxbarcode/BC_Reader.cpp",
+ "xfa/src/fxbarcode/BC_ResultPoint.cpp",
+ "xfa/src/fxbarcode/BC_TwoDimWriter.cpp",
+ "xfa/src/fxbarcode/BC_UtilCodingConvert.cpp",
+ "xfa/src/fxbarcode/BC_UtilRSS.cpp",
+ "xfa/src/fxbarcode/BC_Utils.cpp",
+ "xfa/src/fxbarcode/BC_Writer.cpp",
+ "xfa/src/fxbarcode/BC_Binarizer.h",
+ "xfa/src/fxbarcode/BC_BinaryBitmap.h",
+ "xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h",
+ "xfa/src/fxbarcode/BC_DecoderResult.h",
+ "xfa/src/fxbarcode/BC_Dimension.h",
+ "xfa/src/fxbarcode/BC_LuminanceSource.h",
+ "xfa/src/fxbarcode/BC_Reader.h",
+ "xfa/src/fxbarcode/BC_ResultPoint.h",
+ "xfa/src/fxbarcode/BC_TwoDimWriter.h",
+ "xfa/src/fxbarcode/BC_UtilCodingConvert.h",
+ "xfa/src/fxbarcode/BC_UtilRSS.h",
+ "xfa/src/fxbarcode/BC_Writer.h",
+ "xfa/src/fxbarcode/barcode.h",
+ "xfa/src/fxbarcode/utils.h",
"xfa/src/fxfa/src/app/xfa_checksum.cpp",
"xfa/src/fxfa/src/app/xfa_checksum.h",
"xfa/src/fxfa/src/app/xfa_ffapp.cpp",
"core/src/fxcrt/fx_basic_bstring_unittest.cpp",
"testing/fx_string_testhelpers.cpp",
"testing/fx_string_testhelpers.h",
- "xfa/src/fxbarcode/src/BC_PDF417HighLevelEncoder_unittest.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp",
]
deps = [
"//testing/gtest",
'testing/fx_string_testhelpers.h',
'testing/fx_string_testhelpers.cpp',
'core/src/fxcrt/fx_basic_bstring_unittest.cpp',
- 'xfa/src/fxbarcode/src/BC_PDF417HighLevelEncoder_unittest.cpp',
+ 'xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder_unittest.cpp',
],
},
],
"xfa/src/fwl/src/theme/pushbuttontp.cpp",
"xfa/src/fwl/src/theme/scrollbartp.cpp",
"xfa/src/fwl/src/theme/widgettp.cpp",
- "xfa/src/fxbarcode/src/barcode.h",
- "xfa/src/fxbarcode/src/BC_ASCIIEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_BarCode.cpp",
- "xfa/src/fxbarcode/src/BC_Base256Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_Binarizer.cpp",
- "xfa/src/fxbarcode/src/BC_BinaryBitmap.cpp",
- "xfa/src/fxbarcode/src/BC_BufferedImageLuminanceSource.cpp",
- "xfa/src/fxbarcode/src/BC_C40Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitArray.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_CommonBitSource.cpp",
- "xfa/src/fxbarcode/src/BC_CommonByteArray.cpp",
- "xfa/src/fxbarcode/src/BC_CommonByteMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_CommonCharacterSetECI.cpp",
- "xfa/src/fxbarcode/src/BC_CommonDecoderResult.cpp",
- "xfa/src/fxbarcode/src/BC_CommonECI.cpp",
- "xfa/src/fxbarcode/src/BC_CommonPerspectiveTransform.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixBitMatrixParser.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDataBlock.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixDetector.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixReader.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixSymbolInfo144.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixVersion.cpp",
- "xfa/src/fxbarcode/src/BC_DataMatrixWriter.cpp",
- "xfa/src/fxbarcode/src/BC_DefaultPlacement.cpp",
- "xfa/src/fxbarcode/src/BC_Dimension.cpp",
- "xfa/src/fxbarcode/src/BC_EdifactEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_Encoder.cpp",
- "xfa/src/fxbarcode/src/BC_EncoderContext.cpp",
- "xfa/src/fxbarcode/src/BC_ErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_FinderPatternInfo.cpp",
- "xfa/src/fxbarcode/src/BC_GlobalHistogramBinarizer.cpp",
- "xfa/src/fxbarcode/src/BC_HighLevelEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_Library.cpp",
- "xfa/src/fxbarcode/src/BC_LuminanceSource.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCodaBarReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCodaBarWriter.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode128Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode128Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode39Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedCode39Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN13Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN13Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN8Reader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedEAN8Writer.cpp",
- "xfa/src/fxbarcode/src/BC_OneDimReader.cpp",
- "xfa/src/fxbarcode/src/BC_OneDimWriter.cpp",
- "xfa/src/fxbarcode/src/BC_OneDReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedUPCAReader.cpp",
- "xfa/src/fxbarcode/src/BC_OnedUPCAWriter.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeMatrix.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeMetadata.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeRow.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BarcodeValue.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417BoundingBox.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Codeword.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417CodewordDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Common.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Compaction.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResult.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResultColumn.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectionResultRowIndicatorColumn.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Detector.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417DetectorResult.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Dimensions.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECModulusGF.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ECModulusPoly.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ErrorCorrection.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417HighLevelEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Reader.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ResultMetadata.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417ScanningDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_PDF417Writer.cpp",
- "xfa/src/fxbarcode/src/BC_QRAlignmentPattern.cpp",
- "xfa/src/fxbarcode/src/BC_QRAlignmentPatternFinder.cpp",
- "xfa/src/fxbarcode/src/BC_QRBitMatrixParser.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderBitVector.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderBlockPair.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCodeReader.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderECB.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderECBlocks.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderErrorCorrectionLevel.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderFormatInformation.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMaskUtil.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMatrixUtil.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderMode.cpp",
- "xfa/src/fxbarcode/src/BC_QRCoderVersion.cpp",
- "xfa/src/fxbarcode/src/BC_QRCodeWriter.cpp",
- "xfa/src/fxbarcode/src/BC_QRDataBlock.cpp",
- "xfa/src/fxbarcode/src/BC_QRDataMask.cpp",
- "xfa/src/fxbarcode/src/BC_QRDecodedBitStreamParser.cpp",
- "xfa/src/fxbarcode/src/BC_QRDetector.cpp",
- "xfa/src/fxbarcode/src/BC_QRDetectorResult.cpp",
- "xfa/src/fxbarcode/src/BC_QRFinderPattern.cpp",
- "xfa/src/fxbarcode/src/BC_QRFinderPatternFinder.cpp",
- "xfa/src/fxbarcode/src/BC_QRGridSampler.cpp",
- "xfa/src/fxbarcode/src/BC_Reader.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomon.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonDecoder.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonGF256.cpp",
- "xfa/src/fxbarcode/src/BC_ReedSolomonGF256Poly.cpp",
- "xfa/src/fxbarcode/src/BC_ResultPoint.cpp",
- "xfa/src/fxbarcode/src/BC_SymbolInfo.cpp",
- "xfa/src/fxbarcode/src/BC_SymbolShapeHint.cpp",
- "xfa/src/fxbarcode/src/BC_TextEncoder.cpp",
- "xfa/src/fxbarcode/src/BC_TwoDimWriter.cpp",
- "xfa/src/fxbarcode/src/BC_UtilCodingConvert.cpp",
- "xfa/src/fxbarcode/src/BC_UtilRSS.cpp",
- "xfa/src/fxbarcode/src/BC_Utils.cpp",
- "xfa/src/fxbarcode/src/BC_WhiteRectangleDetector.cpp",
- "xfa/src/fxbarcode/src/BC_Writer.cpp",
- "xfa/src/fxbarcode/src/BC_X12Encoder.cpp",
- "xfa/src/fxbarcode/src/include/BC_ASCIIEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_Base256Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_Binarizer.h",
- "xfa/src/fxbarcode/src/include/BC_BinaryBitmap.h",
- "xfa/src/fxbarcode/src/include/BC_BufferedImageLuminanceSource.h",
- "xfa/src/fxbarcode/src/include/BC_C40Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitArray.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_CommonBitSource.h",
- "xfa/src/fxbarcode/src/include/BC_CommonByteArray.h",
- "xfa/src/fxbarcode/src/include/BC_CommonByteMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_CommonCharacterSetECI.h",
- "xfa/src/fxbarcode/src/include/BC_CommonDecoderResult.h",
- "xfa/src/fxbarcode/src/include/BC_CommonECI.h",
- "xfa/src/fxbarcode/src/include/BC_CommonPerspectiveTransform.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixBitMatrixParser.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDataBlock.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixDetector.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixReader.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixSymbolInfo144.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixVersion.h",
- "xfa/src/fxbarcode/src/include/BC_DataMatrixWriter.h",
- "xfa/src/fxbarcode/src/include/BC_DecoderResult.h",
- "xfa/src/fxbarcode/src/include/BC_DefaultPlacement.h",
- "xfa/src/fxbarcode/src/include/BC_Dimension.h",
- "xfa/src/fxbarcode/src/include/BC_EdifactEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_Encoder.h",
- "xfa/src/fxbarcode/src/include/BC_EncoderContext.h",
- "xfa/src/fxbarcode/src/include/BC_ErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_FinderPatternInfo.h",
- "xfa/src/fxbarcode/src/include/BC_GlobalHistogramBinarizer.h",
- "xfa/src/fxbarcode/src/include/BC_HighLevelEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_LuminanceSource.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCodaBarReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCodaBarWriter.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode128Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode128Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode39Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedCode39Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN13Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN13Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN8Reader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedEAN8Writer.h",
- "xfa/src/fxbarcode/src/include/BC_OneDimReader.h",
- "xfa/src/fxbarcode/src/include/BC_OneDimWriter.h",
- "xfa/src/fxbarcode/src/include/BC_OneDReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedUPCAReader.h",
- "xfa/src/fxbarcode/src/include/BC_OnedUPCAWriter.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMatrix.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeMetadata.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeRow.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BarcodeValue.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417BoundingBox.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Codeword.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417CodewordDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Common.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Compaction.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResult.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultColumn.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectionResultRowIndicatorColumn.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Detector.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417DetectorResult.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Dimensions.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECModulusGF.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ECModulusPoly.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ErrorCorrection.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417HighLevelEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Reader.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ResultMetadata.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417ScanningDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_PDF417Writer.h",
- "xfa/src/fxbarcode/src/include/BC_QRAlignmentPattern.h",
- "xfa/src/fxbarcode/src/include/BC_QRAlignmentPatternFinder.h",
- "xfa/src/fxbarcode/src/include/BC_QRBitMatrixParser.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderBitVector.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderBlockPair.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCodeReader.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderECB.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderECBlocks.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderErrorCorrectionLevel.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderFormatInformation.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMaskUtil.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMatrixUtil.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderMode.h",
- "xfa/src/fxbarcode/src/include/BC_QRCoderVersion.h",
- "xfa/src/fxbarcode/src/include/BC_QRCodeWriter.h",
- "xfa/src/fxbarcode/src/include/BC_QRDataBlock.h",
- "xfa/src/fxbarcode/src/include/BC_QRDataMask.h",
- "xfa/src/fxbarcode/src/include/BC_QRDecodedBitStreamParser.h",
- "xfa/src/fxbarcode/src/include/BC_QRDetector.h",
- "xfa/src/fxbarcode/src/include/BC_QRDetectorResult.h",
- "xfa/src/fxbarcode/src/include/BC_QRFinderPattern.h",
- "xfa/src/fxbarcode/src/include/BC_QRFinderPatternFinder.h",
- "xfa/src/fxbarcode/src/include/BC_QRGridSampler.h",
- "xfa/src/fxbarcode/src/include/BC_Reader.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomon.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonDecoder.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256.h",
- "xfa/src/fxbarcode/src/include/BC_ReedSolomonGF256Poly.h",
- "xfa/src/fxbarcode/src/include/BC_ResultPoint.h",
- "xfa/src/fxbarcode/src/include/BC_SymbolInfo.h",
- "xfa/src/fxbarcode/src/include/BC_SymbolShapeHint.h",
- "xfa/src/fxbarcode/src/include/BC_TextEncoder.h",
- "xfa/src/fxbarcode/src/include/BC_TwoDimWriter.h",
- "xfa/src/fxbarcode/src/include/BC_UtilCodingConvert.h",
- "xfa/src/fxbarcode/src/include/BC_UtilRSS.h",
- "xfa/src/fxbarcode/src/include/BC_WhiteRectangleDetector.h",
- "xfa/src/fxbarcode/src/include/BC_Writer.h",
- "xfa/src/fxbarcode/src/include/BC_X12Encoder.h",
- "xfa/src/fxbarcode/src/include/utils.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitArray.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitMatrix.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitSource.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonByteArray.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonByteMatrix.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonDecoderResult.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonECI.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.cpp",
+ "xfa/src/fxbarcode/common/BC_CommonBitArray.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitMatrix.h",
+ "xfa/src/fxbarcode/common/BC_CommonBitSource.h",
+ "xfa/src/fxbarcode/common/BC_CommonByteArray.h",
+ "xfa/src/fxbarcode/common/BC_CommonByteMatrix.h",
+ "xfa/src/fxbarcode/common/BC_CommonCharacterSetECI.h",
+ "xfa/src/fxbarcode/common/BC_CommonDecoderResult.h",
+ "xfa/src/fxbarcode/common/BC_CommonECI.h",
+ "xfa/src/fxbarcode/common/BC_CommonPerspectiveTransform.h",
+ "xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.cpp",
+ "xfa/src/fxbarcode/common/BC_WhiteRectangleDetector.h",
+ "xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.cpp",
+ "xfa/src/fxbarcode/common/BC_GlobalHistogramBinarizer.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.cpp",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomon.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.h",
+ "xfa/src/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256Poly.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixBitMatrixParser.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDataBlock.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixDetector.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixReader.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixVersion.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DataMatrixWriter.h",
+ "xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_C40Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_EncoderContext.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolShapeHint.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_TextEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_X12Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_Encoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp",
+ "xfa/src/fxbarcode/datamatrix/BC_ASCIIEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_C40Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_EdifactEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_EncoderContext.h",
+ "xfa/src/fxbarcode/datamatrix/BC_ErrorCorrection.h",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolInfo.h",
+ "xfa/src/fxbarcode/datamatrix/BC_SymbolShapeHint.h",
+ "xfa/src/fxbarcode/datamatrix/BC_TextEncoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_X12Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_DefaultPlacement.h",
+ "xfa/src/fxbarcode/datamatrix/BC_Encoder.h",
+ "xfa/src/fxbarcode/datamatrix/BC_HighLevelEncoder.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDimReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OneDReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCodaBarWriter.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode128Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedCode39Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN13Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Reader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedEAN8Writer.h",
+ "xfa/src/fxbarcode/oned/BC_OneDimReader.h",
+ "xfa/src/fxbarcode/oned/BC_OneDimWriter.h",
+ "xfa/src/fxbarcode/oned/BC_OneDReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAReader.h",
+ "xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Common.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Compaction.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Reader.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Writer.cpp",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeMetadata.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeRow.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BarcodeValue.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417BoundingBox.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Codeword.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417CodewordDecoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Common.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Compaction.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResult.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultColumn.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Detector.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417DetectorResult.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Dimensions.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusGF.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ECModulusPoly.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ErrorCorrection.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Reader.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ResultMetadata.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417ScanningDecoder.h",
+ "xfa/src/fxbarcode/pdf417/BC_PDF417Writer.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPattern.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECB.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMode.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataMask.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetector.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPattern.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRAlignmentPatternFinder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderDecoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeReader.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECB.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderECBlocks.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderEncoder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderFormatInformation.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMaskUtil.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMatrixUtil.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderMode.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCoderVersion.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRCodeWriter.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataBlock.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDataMask.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDecodedBitStreamParser.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetector.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRDetectorResult.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPattern.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRFinderPatternFinder.h",
+ "xfa/src/fxbarcode/qrcode/BC_QRGridSampler.h",
+ "xfa/src/fxbarcode/qrcode/BC_FinderPatternInfo.cpp",
+ "xfa/src/fxbarcode/qrcode/BC_FinderPatternInfo.h",
+ "xfa/src/fxbarcode/BC_BarCode.cpp",
+ "xfa/src/fxbarcode/BC_Binarizer.cpp",
+ "xfa/src/fxbarcode/BC_BinaryBitmap.cpp",
+ "xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.cpp",
+ "xfa/src/fxbarcode/BC_Dimension.cpp",
+ "xfa/src/fxbarcode/BC_Library.cpp",
+ "xfa/src/fxbarcode/BC_LuminanceSource.cpp",
+ "xfa/src/fxbarcode/BC_Reader.cpp",
+ "xfa/src/fxbarcode/BC_ResultPoint.cpp",
+ "xfa/src/fxbarcode/BC_TwoDimWriter.cpp",
+ "xfa/src/fxbarcode/BC_UtilCodingConvert.cpp",
+ "xfa/src/fxbarcode/BC_UtilRSS.cpp",
+ "xfa/src/fxbarcode/BC_Utils.cpp",
+ "xfa/src/fxbarcode/BC_Writer.cpp",
+ "xfa/src/fxbarcode/BC_Binarizer.h",
+ "xfa/src/fxbarcode/BC_BinaryBitmap.h",
+ "xfa/src/fxbarcode/BC_BufferedImageLuminanceSource.h",
+ "xfa/src/fxbarcode/BC_DecoderResult.h",
+ "xfa/src/fxbarcode/BC_Dimension.h",
+ "xfa/src/fxbarcode/BC_LuminanceSource.h",
+ "xfa/src/fxbarcode/BC_Reader.h",
+ "xfa/src/fxbarcode/BC_ResultPoint.h",
+ "xfa/src/fxbarcode/BC_TwoDimWriter.h",
+ "xfa/src/fxbarcode/BC_UtilCodingConvert.h",
+ "xfa/src/fxbarcode/BC_UtilRSS.h",
+ "xfa/src/fxbarcode/BC_Writer.h",
+ "xfa/src/fxbarcode/barcode.h",
+ "xfa/src/fxbarcode/utils.h",
"xfa/src/fxfa/src/app/xfa_checksum.cpp",
"xfa/src/fxfa/src/app/xfa_checksum.h",
"xfa/src/fxfa/src/app/xfa_ffapp.cpp",
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:
+/*\r
+ * Copyright 2011 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_Reader.h"\r
+#include "BC_Writer.h"\r
+#include "BC_DecoderResult.h"\r
+#include "BC_LuminanceSource.h"\r
+#include "BC_BufferedImageLuminanceSource.h"\r
+#include "BC_Binarizer.h"\r
+#include "BC_BinaryBitmap.h"\r
+#include "BC_UtilCodingConvert.h"\r
+#include "BC_ResultPoint.h"\r
+#include "BC_BinaryBitmap.h"\r
+#include "BC_TwoDimWriter.h"\r
+#include "common/BC_GlobalHistogramBinarizer.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonBitArray.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonDecoderResult.h"\r
+#include "datamatrix/BC_DataMatrixReader.h"\r
+#include "datamatrix/BC_DataMatrixWriter.h"\r
+#include "oned/BC_OneDReader.h"\r
+#include "oned/BC_OneDimReader.h"\r
+#include "oned/BC_OneDimWriter.h"\r
+#include "oned/BC_OnedCode39Reader.h"\r
+#include "oned/BC_OnedCode39Writer.h"\r
+#include "oned/BC_OnedCodaBarReader.h"\r
+#include "oned/BC_OnedCodaBarWriter.h"\r
+#include "oned/BC_OnedCode128Reader.h"\r
+#include "oned/BC_OnedCode128Writer.h"\r
+#include "oned/BC_OnedEAN8Reader.h"\r
+#include "oned/BC_OnedEAN8Writer.h"\r
+#include "oned/BC_OnedEAN13Reader.h"\r
+#include "oned/BC_OnedEAN13Writer.h"\r
+#include "oned/BC_OnedUPCAReader.h"\r
+#include "oned/BC_OnedUPCAWriter.h"\r
+#include "pdf417/BC_PDF417DetectorResult.h"\r
+#include "pdf417/BC_PDF417Compaction.h"\r
+#include "pdf417/BC_PDF417.h"\r
+#include "pdf417/BC_PDF417Writer.h"\r
+#include "pdf417/BC_PDF417Detector.h"\r
+#include "pdf417/BC_PDF417DetectorResult.h"\r
+#include "pdf417/BC_PDF417Codeword.h"\r
+#include "pdf417/BC_PDF417Common.h"\r
+#include "pdf417/BC_PDF417BarcodeValue.h"\r
+#include "pdf417/BC_PDF417BarcodeMetadata.h"\r
+#include "pdf417/BC_PDF417BoundingBox.h"\r
+#include "pdf417/BC_PDF417DetectionResultColumn.h"\r
+#include "pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h"\r
+#include "pdf417/BC_PDF417DetectionResult.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417CodewordDecoder.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417ECModulusPoly.h"\r
+#include "pdf417/BC_PDF417ECModulusGF.h"\r
+#include "pdf417/BC_PDF417ECErrorCorrection.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417ScanningDecoder.h"\r
+#include "pdf417/BC_PDF417Reader.h"\r
+#include "pdf417/BC_PDF417HighLevelEncoder.h"\r
+#include "qrcode/BC_QRCodeReader.h"\r
+#include "qrcode/BC_QRCodeWriter.h"\r
+CBC_CodeBase :: CBC_CodeBase()\r
+{\r
+}\r
+CBC_CodeBase :: ~CBC_CodeBase()\r
+{\r
+}\r
+FX_BOOL CBC_CodeBase::SetCharEncoding(FX_INT32 encoding)\r
+{\r
+ if (m_pBCWriter) {\r
+ return m_pBCWriter->SetCharEncoding(encoding);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_CodeBase::SetModuleHeight(FX_INT32 moduleHeight)\r
+{\r
+ if (m_pBCWriter) {\r
+ return m_pBCWriter->SetModuleHeight(moduleHeight);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_CodeBase::SetModuleWidth(FX_INT32 moduleWidth)\r
+{\r
+ if (m_pBCWriter) {\r
+ return m_pBCWriter->SetModuleWidth(moduleWidth);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_CodeBase::SetHeight(FX_INT32 height)\r
+{\r
+ if (m_pBCWriter) {\r
+ return m_pBCWriter->SetHeight(height);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_CodeBase::SetWidth(FX_INT32 width)\r
+{\r
+ if (m_pBCWriter) {\r
+ return m_pBCWriter->SetWidth(width);\r
+ }\r
+ return FALSE;\r
+}\r
+void CBC_CodeBase::SetBackgroundColor(FX_ARGB backgroundColor)\r
+{\r
+ if (m_pBCWriter) {\r
+ m_pBCWriter->SetBackgroundColor(backgroundColor);\r
+ }\r
+}\r
+void CBC_CodeBase::SetBarcodeColor(FX_ARGB foregroundColor)\r
+{\r
+ if (m_pBCWriter) {\r
+ m_pBCWriter->SetBarcodeColor(foregroundColor);\r
+ }\r
+}\r
+CBC_OneCode::CBC_OneCode()\r
+{\r
+};\r
+CBC_OneCode::~CBC_OneCode()\r
+{\r
+}\r
+FX_BOOL CBC_OneCode::CheckContentValidity(FX_WSTR contents)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OneDimWriter*)m_pBCWriter)->CheckContentValidity(contents);\r
+ }\r
+ return FALSE;\r
+}\r
+CFX_WideString CBC_OneCode::FilterContents(FX_WSTR contents)\r
+{\r
+ CFX_WideString tmp;\r
+ if (m_pBCWriter == NULL) {\r
+ return tmp;\r
+ }\r
+ return ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents);\r
+}\r
+void CBC_OneCode::SetPrintChecksum(FX_BOOL checksum)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetPrintChecksum(checksum);\r
+ }\r
+}\r
+void CBC_OneCode::SetDataLength(FX_INT32 length)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetDataLength(length);\r
+ }\r
+}\r
+void CBC_OneCode::SetCalChecksum(FX_BOOL calc)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetCalcChecksum(calc);\r
+ }\r
+}\r
+FX_BOOL CBC_OneCode::SetFont(CFX_Font* cFont)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OneDimWriter*)m_pBCWriter)->SetFont(cFont);\r
+ }\r
+ return FALSE;\r
+}\r
+void CBC_OneCode::SetFontSize(FX_FLOAT size)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetFontSize(size);\r
+ }\r
+}\r
+void CBC_OneCode::SetFontStyle(FX_INT32 style)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetFontStyle(style);\r
+ }\r
+}\r
+void CBC_OneCode::SetFontColor(FX_ARGB color)\r
+{\r
+ if (m_pBCWriter) {\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->SetFontColor(color);\r
+ }\r
+}\r
+CBC_Code39::CBC_Code39()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedCode39Reader);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedCode39Writer);\r
+}\r
+CBC_Code39::CBC_Code39(FX_BOOL usingCheckDigit)\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW CBC_OnedCode39Reader(usingCheckDigit);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW CBC_OnedCode39Writer;\r
+}\r
+CBC_Code39::CBC_Code39(FX_BOOL usingCheckDigit, FX_BOOL extendedMode)\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW CBC_OnedCode39Reader(usingCheckDigit, extendedMode);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW CBC_OnedCode39Writer(extendedMode);\r
+}\r
+CBC_Code39::~CBC_Code39()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_Code39::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_CODE_39;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString filtercontents = ((CBC_OnedCode39Writer*)m_pBCWriter)->FilterContents(contents);\r
+ CFX_WideString renderContents = ((CBC_OnedCode39Writer*)m_pBCWriter)->RenderTextContents(contents);\r
+ m_renderContents = renderContents;\r
+ CFX_ByteString byteString = filtercontents.UTF8Encode();\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(renderContents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)->encodedContents(m_renderContents, e);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_Code39::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_Code39::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+FX_BOOL CBC_Code39::SetTextLocation(BC_TEXT_LOC location)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetTextLocation(location);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_Code39::SetWideNarrowRatio(FX_INT32 ratio)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OnedCode39Writer*)m_pBCWriter)->SetWideNarrowRatio(ratio);\r
+ }\r
+ return FALSE;\r
+}\r
+CBC_Codabar::CBC_Codabar()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedCodaBarReader);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedCodaBarWriter);\r
+}\r
+CBC_Codabar::~CBC_Codabar()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_Codabar::SetStartChar(FX_CHAR start)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OnedCodaBarWriter*)m_pBCWriter)->SetStartChar(start);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_Codabar::SetEndChar(FX_CHAR end)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OnedCodaBarWriter*)m_pBCWriter)->SetEndChar(end);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_Codabar::SetTextLocation(BC_TEXT_LOC location)\r
+{\r
+ return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetTextLocation(location);\r
+}\r
+FX_BOOL CBC_Codabar::SetWideNarrowRatio(FX_INT32 ratio)\r
+{\r
+ if (m_pBCWriter) {\r
+ return ((CBC_OnedCodaBarWriter*) m_pBCWriter)->SetWideNarrowRatio(ratio);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_Codabar::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_CODABAR;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString filtercontents = ((CBC_OneDimWriter*)m_pBCWriter)->FilterContents(contents);\r
+ CFX_ByteString byteString = filtercontents.UTF8Encode();\r
+ m_renderContents = filtercontents;\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(filtercontents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, renderCon, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ CFX_WideString renderCon = ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, renderCon, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_Codabar::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_Codabar::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+CBC_Code128::CBC_Code128(BC_TYPE type)\r
+{\r
+ m_pBCReader = (CBC_Reader *) FX_NEW (CBC_OnedCode128Reader);\r
+ m_pBCWriter = (CBC_Writer *) FX_NEW CBC_OnedCode128Writer(type);\r
+}\r
+CBC_Code128::~CBC_Code128()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_Code128::SetTextLocation(BC_TEXT_LOC location)\r
+{\r
+ if (m_pBCWriter) {\r
+ return (( CBC_OnedCode128Writer*)m_pBCWriter)->SetTextLocation(location);\r
+ }\r
+ return FALSE;\r
+}\r
+FX_BOOL CBC_Code128::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_CODE_128;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString content = contents;\r
+ if (contents.GetLength() % 2 && ((CBC_OnedCode128Writer *)m_pBCWriter)->GetType() == BC_CODE128_C) {\r
+ content += '0';\r
+ }\r
+ CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)->FilterContents(content);\r
+ m_renderContents = encodeContents;\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_Code128::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_Code128::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+CBC_EAN8::CBC_EAN8()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN8Reader);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN8Writer);\r
+}\r
+CBC_EAN8::~CBC_EAN8()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+CFX_WideString CBC_EAN8::Preprocess(FX_WSTR contents)\r
+{\r
+ CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);\r
+ FX_INT32 length = encodeContents.GetLength();\r
+ if (length <= 7) {\r
+ for (FX_INT32 i = 0; i < 7 - length; i++) {\r
+ encodeContents = FX_WCHAR('0') + encodeContents;\r
+ }\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ FX_INT32 checksum = ((CBC_OnedEAN8Writer *)m_pBCWriter)->CalcChecksum(byteString);\r
+ encodeContents += FX_WCHAR(checksum - 0 + '0');\r
+ }\r
+ if (length > 8) {\r
+ encodeContents = encodeContents.Mid(0, 8);\r
+ }\r
+ return encodeContents;\r
+}\r
+FX_BOOL CBC_EAN8::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_EAN_8;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString encodeContents = Preprocess(contents);\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ m_renderContents = encodeContents;\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_EAN8::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_EAN8::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+CBC_EAN13::CBC_EAN13()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedEAN13Reader);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedEAN13Writer);\r
+}\r
+CBC_EAN13::~CBC_EAN13()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+CFX_WideString CBC_EAN13::Preprocess(FX_WSTR contents)\r
+{\r
+ CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);\r
+ FX_INT32 length = encodeContents.GetLength();\r
+ if (length <= 12) {\r
+ for (FX_INT32 i = 0; i < 12 - length; i++) {\r
+ encodeContents = FX_WCHAR('0') + encodeContents;\r
+ }\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ FX_INT32 checksum = ((CBC_OnedEAN13Writer *)m_pBCWriter)->CalcChecksum(byteString);\r
+ byteString += checksum - 0 + '0';\r
+ encodeContents = byteString.UTF8Decode();\r
+ }\r
+ if (length > 13) {\r
+ encodeContents = encodeContents.Mid(0, 13);\r
+ }\r
+ return encodeContents;\r
+}\r
+FX_BOOL CBC_EAN13::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_EAN_13;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString encodeContents = Preprocess(contents);\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ m_renderContents = encodeContents;\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_EAN13::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_EAN13::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+CBC_UPCA::CBC_UPCA()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_OnedUPCAReader);\r
+ ((CBC_OnedUPCAReader *)m_pBCReader)->Init();\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_OnedUPCAWriter);\r
+}\r
+CBC_UPCA::~CBC_UPCA()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+CFX_WideString CBC_UPCA::Preprocess(FX_WSTR contents)\r
+{\r
+ CFX_WideString encodeContents = ((CBC_OnedEAN8Writer*)m_pBCWriter)->FilterContents(contents);\r
+ FX_INT32 length = encodeContents.GetLength();\r
+ if (length <= 11) {\r
+ for (FX_INT32 i = 0; i < 11 - length; i++) {\r
+ encodeContents = FX_WCHAR('0') + encodeContents;\r
+ }\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ FX_INT32 checksum = ((CBC_OnedUPCAWriter *)m_pBCWriter)->CalcChecksum(byteString);\r
+ byteString += checksum - 0 + '0';\r
+ encodeContents = byteString.UTF8Decode();\r
+ }\r
+ if (length > 12) {\r
+ encodeContents = encodeContents.Mid(0, 12);\r
+ }\r
+ return encodeContents;\r
+}\r
+FX_BOOL CBC_UPCA::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ if(contents.IsEmpty()) {\r
+ e = BCExceptionNoContents;\r
+ return FALSE;\r
+ }\r
+ BCFORMAT format = BCFORMAT_UPC_A;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ CFX_WideString encodeContents = Preprocess(contents);\r
+ CFX_ByteString byteString = encodeContents.UTF8Encode();\r
+ m_renderContents = encodeContents;\r
+ ((CBC_OnedUPCAWriter*)m_pBCWriter)->Init();\r
+ FX_BYTE *data = m_pBCWriter->Encode(byteString, format, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderResult(encodeContents, data, outWidth, isDevice, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_OneDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, m_renderContents, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_UPCA::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_UPCA::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString str = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(str, str.GetLength());\r
+}\r
+CBC_QRCode::CBC_QRCode()\r
+{\r
+ m_pBCReader = (CBC_Reader *) FX_NEW (CBC_QRCodeReader);\r
+ ((CBC_QRCodeReader*)m_pBCReader)->Init();\r
+ m_pBCWriter = (CBC_Writer *) FX_NEW (CBC_QRCodeWriter);\r
+}\r
+CBC_QRCode ::~CBC_QRCode()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_QRCode::SetVersion(FX_INT32 version)\r
+{\r
+ if (version < 0 || version > 40) {\r
+ return FALSE;\r
+ }\r
+ if (m_pBCWriter == NULL) {\r
+ return FALSE;\r
+ }\r
+ return((CBC_QRCodeWriter*)m_pBCWriter)->SetVersion(version);\r
+}\r
+FX_BOOL CBC_QRCode::SetErrorCorrectionLevel (FX_INT32 level)\r
+{\r
+ if (level < 0 || level > 3) {\r
+ return FALSE;\r
+ }\r
+ if (m_pBCWriter == NULL) {\r
+ return FALSE;\r
+ }\r
+ return ((CBC_TwoDimWriter*)m_pBCWriter)->SetErrorCorrectionLevel(level);\r
+}\r
+FX_BOOL CBC_QRCode::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ FX_BYTE *data = ((CBC_QRCodeWriter*)m_pBCWriter)->Encode(contents, ((CBC_QRCodeWriter*)m_pBCWriter)->GetErrorCorrectionLevel(), outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_QRCode::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_QRCode::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_QRCode::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_QRCode::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(retStr, retStr.GetLength());\r
+}\r
+CBC_PDF417I::CBC_PDF417I()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_PDF417Reader);\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_PDF417Writer);\r
+}\r
+CBC_PDF417I::~CBC_PDF417I()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_PDF417I::SetErrorCorrectionLevel (FX_INT32 level)\r
+{\r
+ ((CBC_PDF417Writer*)m_pBCWriter)->SetErrorCorrectionLevel(level);\r
+ return TRUE;\r
+}\r
+void CBC_PDF417I::SetTruncated(FX_BOOL truncated)\r
+{\r
+ ((CBC_PDF417Writer*)m_pBCWriter)->SetTruncated(truncated);\r
+}\r
+FX_BOOL CBC_PDF417I::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ BCFORMAT format = BCFORMAT_PDF_417;\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ FX_BYTE *data = ((CBC_PDF417Writer*)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_PDF417I::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_PDF417I::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_PDF417I::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_PDF417I::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString bytestring = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(bytestring, bytestring.GetLength());\r
+}\r
+CBC_DataMatrix::CBC_DataMatrix()\r
+{\r
+ m_pBCReader = (CBC_Reader*) FX_NEW (CBC_DataMatrixReader);\r
+ ((CBC_DataMatrixReader*)m_pBCReader)->Init();\r
+ m_pBCWriter = (CBC_Writer*) FX_NEW (CBC_DataMatrixWriter);\r
+}\r
+CBC_DataMatrix::~CBC_DataMatrix()\r
+{\r
+ if(m_pBCReader) {\r
+ delete(m_pBCReader);\r
+ m_pBCReader = NULL;\r
+ }\r
+ if(m_pBCWriter) {\r
+ delete(m_pBCWriter);\r
+ m_pBCWriter = NULL;\r
+ }\r
+}\r
+FX_BOOL CBC_DataMatrix::Encode(FX_WSTR contents, FX_BOOL isDevice, FX_INT32 &e)\r
+{\r
+ FX_INT32 outWidth = 0;\r
+ FX_INT32 outHeight = 0;\r
+ FX_BYTE *data = ((CBC_DataMatrixWriter *)m_pBCWriter)->Encode(contents, outWidth, outHeight, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderResult(data, outWidth, outHeight, e);\r
+ FX_Free(data);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_DataMatrix::RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matirx, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderDeviceResult(device, matirx);\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_DataMatrix::RenderBitmap(CFX_DIBitmap *&pOutBitmap, FX_INT32 &e)\r
+{\r
+ ((CBC_TwoDimWriter*)m_pBCWriter)->RenderBitmapResult(pOutBitmap, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);\r
+ return TRUE;\r
+}\r
+CFX_WideString CBC_DataMatrix::Decode(FX_BYTE* buf, FX_INT32 width, FX_INT32 hight, FX_INT32 &e)\r
+{\r
+ CFX_WideString str;\r
+ return str;\r
+}\r
+CFX_WideString CBC_DataMatrix::Decode(CFX_DIBitmap *pBitmap, FX_INT32 &e)\r
+{\r
+ CBC_BufferedImageLuminanceSource source(pBitmap);\r
+ CBC_GlobalHistogramBinarizer binarizer(&source);\r
+ CBC_BinaryBitmap bitmap(&binarizer);\r
+ CFX_ByteString retStr = m_pBCReader->Decode(&bitmap, 0, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, FX_WSTRC(L""));\r
+ return CFX_WideString::FromUTF8(retStr, retStr.GetLength());\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_LuminanceSource.h"\r
+#include "BC_Binarizer.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonBitArray.h"\r
+CBC_Binarizer::CBC_Binarizer(CBC_LuminanceSource *source)\r
+{\r
+ m_source = source;\r
+}\r
+CBC_Binarizer::~CBC_Binarizer()\r
+{\r
+}\r
+CBC_LuminanceSource *CBC_Binarizer::GetLuminanceSource()\r
+{\r
+ return m_source;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_BINARIZER_H_\r
+#define _BC_BINARIZER_H_\r
+class CBC_LuminanceSource;\r
+class CBC_CommonBitMatrix;\r
+class CBC_CommonBitArray;\r
+class CBC_BinaryBitmap;\r
+class CBC_Binarizer : public CFX_Object\r
+{\r
+public:\r
+ CBC_Binarizer(CBC_LuminanceSource *source);\r
+ virtual ~CBC_Binarizer();\r
+ CBC_LuminanceSource *GetLuminanceSource();\r
+ virtual CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e) = 0;\r
+ virtual CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e) = 0;\r
+private:\r
+ CBC_LuminanceSource *m_source;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_Binarizer.h"\r
+#include "BC_LuminanceSource.h"\r
+#include "BC_BinaryBitmap.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonBitArray.h"\r
+CBC_BinaryBitmap::CBC_BinaryBitmap(CBC_Binarizer *binarizer): m_binarizer(binarizer), m_matrix(NULL)\r
+{\r
+}\r
+CBC_BinaryBitmap::~CBC_BinaryBitmap()\r
+{\r
+ if (m_matrix != NULL) {\r
+ delete m_matrix;\r
+ }\r
+ m_matrix = NULL;\r
+}\r
+FX_INT32 CBC_BinaryBitmap::GetHeight()\r
+{\r
+ return m_binarizer->GetLuminanceSource()->GetHeight();\r
+}\r
+FX_INT32 CBC_BinaryBitmap::GetWidth()\r
+{\r
+ return m_binarizer->GetLuminanceSource()->GetWidth();\r
+}\r
+CBC_CommonBitMatrix *CBC_BinaryBitmap::GetMatrix(FX_INT32 &e)\r
+{\r
+ if (m_matrix == NULL) {\r
+ m_matrix = m_binarizer->GetBlackMatrix(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ return m_matrix;\r
+}\r
+FX_BOOL CBC_BinaryBitmap::IsCropSupported()\r
+{\r
+ return m_binarizer->GetLuminanceSource()->IsCropSupported();\r
+}\r
+FX_BOOL CBC_BinaryBitmap::IsRotateSupported()\r
+{\r
+ return m_binarizer->GetLuminanceSource()->IsRotateSupported();\r
+}\r
+CBC_CommonBitArray *CBC_BinaryBitmap::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e)\r
+{\r
+ CBC_CommonBitArray *temp = m_binarizer->GetBlackRow(y, row, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ return temp;\r
+}\r
+CBC_CommonBitMatrix *CBC_BinaryBitmap::GetBlackMatrix(FX_INT32 &e)\r
+{\r
+ if (m_matrix == NULL) {\r
+ m_matrix = m_binarizer->GetBlackMatrix(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ return m_matrix;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_BINARYBITMAP_H_\r
+#define _BC_BINARYBITMAP_H_\r
+class CBC_Binarizer;\r
+class CBC_CommonBitMatrix;\r
+class CBC_CommonBitArray;\r
+class CBC_BinaryBitmap;\r
+class CBC_BinaryBitmap : public CFX_Object\r
+{\r
+public:\r
+ CBC_BinaryBitmap(CBC_Binarizer *binarizer);\r
+ virtual ~CBC_BinaryBitmap();\r
+ FX_INT32 GetWidth();\r
+ FX_INT32 GetHeight();\r
+ CBC_CommonBitMatrix * GetMatrix(FX_INT32 &e);\r
+ CBC_CommonBitArray * GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);\r
+ CBC_CommonBitMatrix * GetBlackMatrix(FX_INT32 &e);\r
+ FX_BOOL IsCropSupported();\r
+ FX_BOOL IsRotateSupported();\r
+private:\r
+ CBC_Binarizer * m_binarizer;\r
+ CBC_CommonBitMatrix * m_matrix;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_LuminanceSource.h"\r
+#include "BC_BufferedImageLuminanceSource.h"\r
+class CBC_Pause : public IFX_Pause\r
+{\r
+public:\r
+ virtual FX_BOOL NeedToPauseNow()\r
+ {\r
+ return TRUE;\r
+ }\r
+};\r
+static CFX_DIBitmap* CreateDIBSource(IFX_FileRead* fileread)\r
+{\r
+ CFX_DIBitmap* bitmap = NULL;\r
+ CCodec_ModuleMgr* pCodecMgr = NULL;\r
+ ICodec_ProgressiveDecoder* pImageCodec = NULL;\r
+ pCodecMgr = CCodec_ModuleMgr::Create();\r
+ pImageCodec = pCodecMgr->CreateProgressiveDecoder();\r
+ FXCODEC_STATUS status = FXCODEC_STATUS_DECODE_FINISH;\r
+ status = pImageCodec->LoadImageInfo(fileread, FXCODEC_IMAGE_UNKNOWN);\r
+ if (status != FXCODEC_STATUS_FRAME_READY) {\r
+ return NULL;\r
+ }\r
+ bitmap = FX_NEW CFX_DIBitmap;\r
+ bitmap->Create(pImageCodec->GetWidth(), pImageCodec->GetHeight(), FXDIB_Argb);\r
+ bitmap->Clear(FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF));\r
+ CBC_Pause pause;\r
+ FX_INT32 frames;\r
+ status = pImageCodec->GetFrames(frames, &pause);\r
+ while (status == FXCODEC_STATUS_FRAME_TOBECONTINUE) {\r
+ status = pImageCodec->GetFrames(frames, &pause);\r
+ }\r
+ if (status != FXCODEC_STATUS_DECODE_READY) {\r
+ goto except;\r
+ }\r
+ status = pImageCodec->StartDecode(bitmap,\r
+ 0,\r
+ 0,\r
+ bitmap->GetWidth(),\r
+ bitmap->GetHeight(),\r
+ 0,\r
+ FALSE);\r
+ if (status == FXCODEC_STATUS_ERR_PARAMS) {\r
+ goto except;\r
+ }\r
+ if (status != FXCODEC_STATUS_DECODE_TOBECONTINUE) {\r
+ goto except;\r
+ }\r
+ while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) {\r
+ status = pImageCodec->ContinueDecode(&pause);\r
+ }\r
+ if (status != FXCODEC_STATUS_DECODE_FINISH) {\r
+ goto except;\r
+ }\r
+ if (pImageCodec) {\r
+ delete pImageCodec;\r
+ pImageCodec = NULL;\r
+ }\r
+ if (pCodecMgr) {\r
+ pCodecMgr->Destroy();\r
+ pCodecMgr = NULL;\r
+ }\r
+ return bitmap;\r
+except:\r
+ if (pImageCodec) {\r
+ delete pImageCodec;\r
+ pImageCodec = NULL;\r
+ }\r
+ if (pCodecMgr) {\r
+ pCodecMgr->Destroy();\r
+ pCodecMgr = NULL;\r
+ }\r
+ if (bitmap) {\r
+ delete bitmap;\r
+ }\r
+ return NULL;\r
+}\r
+CBC_BufferedImageLuminanceSource::CBC_BufferedImageLuminanceSource(const CFX_WideString &filename): CBC_LuminanceSource(0, 0), m_filename(filename)\r
+{\r
+ m_height = 0;\r
+ m_width = 0;\r
+ m_bytesPerLine = 0;\r
+ m_top = 0;\r
+ m_left = 0;\r
+}\r
+void CBC_BufferedImageLuminanceSource::Init(FX_INT32 &e)\r
+{\r
+ IFX_FileRead* fileread = FX_CreateFileRead(m_filename);\r
+ m_pBitmap = CreateDIBSource(fileread);\r
+ if (m_pBitmap == NULL) {\r
+ e = BCExceptionLoadFile;\r
+ return;\r
+ }\r
+ m_pBitmap->ConvertFormat(FXDIB_Argb);\r
+ m_height = m_pBitmap->GetHeight();\r
+ m_width = m_pBitmap->GetWidth();\r
+ m_rgbData.SetSize(m_height * m_width);\r
+ m_bytesPerLine = m_width * 4;\r
+ m_top = 0;\r
+ m_left = 0;\r
+}\r
+CBC_BufferedImageLuminanceSource::CBC_BufferedImageLuminanceSource(CFX_DIBitmap *pBitmap): CBC_LuminanceSource(0, 0)\r
+{\r
+ m_pBitmap = pBitmap->Clone();\r
+ m_pBitmap->ConvertFormat(FXDIB_Argb);\r
+ m_height = m_pBitmap->GetHeight();\r
+ m_width = m_pBitmap->GetWidth();\r
+ m_rgbData.SetSize(m_height * m_width);\r
+ m_bytesPerLine = m_width * 4;\r
+ m_top = 0;\r
+ m_left = 0;\r
+}\r
+CBC_BufferedImageLuminanceSource::~CBC_BufferedImageLuminanceSource()\r
+{\r
+ delete m_pBitmap;\r
+ m_pBitmap = NULL;\r
+}\r
+CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e)\r
+{\r
+ if (y < 0 || y >= m_height) {\r
+ e = BCExceptionRequestedRowIsOutSizeTheImage;\r
+ return NULL;\r
+ }\r
+ FX_INT32 width = m_width;\r
+ if(row.GetSize() == 0 || row.GetSize() < width) {\r
+ row.SetSize(width);\r
+ }\r
+ if(m_rgbData.GetSize() == 0 || m_rgbData.GetSize() < width) {\r
+ m_rgbData.SetSize(width);\r
+ }\r
+ FX_INT32* rowLine = (FX_INT32*)m_pBitmap->GetScanline(y);\r
+ FX_INT32 x;\r
+ for (x = 0; x < width; x++) {\r
+ FX_INT32 pixel = rowLine[x];\r
+ FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) +\r
+ 601 * ((pixel >> 8) & 0xFF) +\r
+ 117 * (pixel & 0xFF)) >> 10;\r
+ row[x] = (FX_BYTE) luminance;\r
+ }\r
+ return &row;\r
+}\r
+CFX_ByteArray *CBC_BufferedImageLuminanceSource::GetMatrix()\r
+{\r
+ CFX_ByteArray *matirx = FX_NEW CFX_ByteArray();\r
+ matirx->SetSize(m_bytesPerLine * m_height);\r
+ FX_INT32 *rgb = (FX_INT32*)m_pBitmap->GetBuffer();\r
+ FX_INT32 y;\r
+ for(y = 0; y < m_height; y++) {\r
+ FX_INT32 offset = y * m_width;\r
+ FX_INT32 x;\r
+ for(x = 0; x < m_width; x++) {\r
+ FX_INT32 pixel = rgb[offset + x];\r
+ FX_INT32 luminance = (306 * ((pixel >> 16) & 0xFF) +\r
+ 601 * ((pixel >> 8) & 0xFF) +\r
+ 117 * (pixel & 0xFF)) >> 10;\r
+ (*matirx)[offset + x] = (FX_BYTE) luminance;\r
+ }\r
+ }\r
+ return matirx;\r
+}\r
+FX_BOOL CBC_BufferedImageLuminanceSource::IsCropSupported()\r
+{\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_BufferedImageLuminanceSource::IsRotateSupported()\r
+{\r
+ return TRUE;\r
+}\r
+CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height)\r
+{\r
+ return NULL;\r
+}\r
+CBC_LuminanceSource *CBC_BufferedImageLuminanceSource::RotateCounterClockwise(FX_INT32 &e)\r
+{\r
+ if (!IsRotateSupported()) {\r
+ e = BCExceptionRotateNotSupported;\r
+ return NULL;\r
+ }\r
+ FX_INT32 sourceWidth = m_width;\r
+ FX_INT32 sourceHeight = m_height;\r
+ return NULL;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_BUFFEREDIMAGELUMINANCESOURCE_H_\r
+#define _BC_BUFFEREDIMAGELUMINANCESOURCE_H_\r
+class CBC_LuminanceSource;\r
+class CBC_BufferedImageLuminanceSource;\r
+class CBC_BufferedImageLuminanceSource : public CBC_LuminanceSource\r
+{\r
+public:\r
+ CBC_BufferedImageLuminanceSource(const CFX_WideString &filename);\r
+ CBC_BufferedImageLuminanceSource(CFX_DIBitmap *pBitmap);\r
+ virtual ~CBC_BufferedImageLuminanceSource();\r
+ CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e);\r
+ CBC_LuminanceSource *Crop(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height);\r
+\r
+ CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e);\r
+ CFX_ByteArray *GetMatrix();\r
+ FX_BOOL IsCropSupported();\r
+ FX_BOOL IsRotateSupported();\r
+ virtual void Init(FX_INT32 &e);\r
+private:\r
+ FX_INT32 m_bytesPerLine;\r
+ FX_INT32 m_left;\r
+ FX_INT32 m_top;\r
+ CFX_Int32Array m_rgbData;\r
+ CFX_DIBitmap *m_pBitmap;\r
+ const CFX_WideString m_filename;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_DECODERRESULT_H_\r
+#define _BC_DECODERRESULT_H_\r
+class CBC_DecoderResult;\r
+class CBC_DecoderResult : public CFX_Object\r
+{\r
+public:\r
+ CBC_DecoderResult(CFX_ByteArray* rawBytes, CFX_ByteString text, CFX_ByteString ecLevel);\r
+ virtual ~CBC_DecoderResult();\r
+ CFX_ByteArray* getRawBytes();\r
+ CFX_ByteString getText();\r
+ CFX_ByteString getECLevel();\r
+ FX_INT32 getErrorsCorrected();\r
+ void setErrorsCorrected(FX_INT32 errorsCorrected);\r
+ FX_INT32 getErasures();\r
+ void setErasures(FX_INT32 erasures);\r
+ CFX_Object* getOther();\r
+ void setOther(CFX_Object* other);\r
+private:\r
+ CFX_ByteArray* m_rawBytes;\r
+ CFX_ByteString m_text;\r
+ CFX_ByteString m_ecLevel;\r
+ FX_INT32 m_errorsCorrected;\r
+ FX_INT32 m_erasures;\r
+ CFX_Object* m_other;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2012 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_Dimension.h"\r
+#include "datamatrix/BC_Encoder.h"\r
+CBC_Dimension::CBC_Dimension()\r
+{\r
+}\r
+CBC_Dimension::CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e)\r
+{\r
+ if (width < 0 || height < 0) {\r
+ e = BCExceptionHeightAndWidthMustBeAtLeast1;\r
+ }\r
+ m_width = width;\r
+ m_height = height;\r
+}\r
+CBC_Dimension::~CBC_Dimension()\r
+{\r
+}\r
+FX_INT32 CBC_Dimension::getWidth()\r
+{\r
+ return m_width;\r
+}\r
+FX_INT32 CBC_Dimension::getHeight()\r
+{\r
+ return m_height;\r
+}\r
+FX_INT32 CBC_Dimension::hashCode()\r
+{\r
+ return m_width * 32713 + m_height;\r
+}\r
+CFX_WideString CBC_Dimension::toString()\r
+{\r
+ return (FX_WCHAR)(m_width + (FX_WCHAR)'x' + m_height);\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_DIMENSION_H_\r
+#define _BC_DIMENSION_H_\r
+class CBC_Dimension;\r
+class CBC_Dimension : public CFX_Object\r
+{\r
+public:\r
+ CBC_Dimension();\r
+ CBC_Dimension(FX_INT32 width, FX_INT32 height, FX_INT32 &e);\r
+ virtual ~CBC_Dimension();\r
+ FX_INT32 getWidth();\r
+ FX_INT32 getHeight();\r
+ FX_INT32 hashCode();\r
+ CFX_WideString toString();\r
+private:\r
+ FX_INT32 m_width;\r
+ FX_INT32 m_height;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+#include "BC_Reader.h"\r
+#include "BC_UtilCodingConvert.h"\r
+#include "BC_BinaryBitmap.h"\r
+#include "BC_LuminanceSource.h"\r
+#include "BC_BufferedImageLuminanceSource.h"\r
+#include "BC_Binarizer.h"\r
+#include "BC_Writer.h"\r
+#include "BC_Dimension.h"\r
+#include "BC_UtilCodingConvert.h"\r
+#include "BC_ResultPoint.h"\r
+#include "BC_BinaryBitmap.h"\r
+#include "BC_DecoderResult.h"\r
+#include "BC_TwoDimWriter.h"\r
+#include "common/BC_GlobalHistogramBinarizer.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/reedsolomon/BC_ReedSolomonGF256.h"\r
+#include "common/BC_CommonByteMatrix.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonBitArray.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "common/BC_CommonDecoderResult.h"\r
+#include "datamatrix/BC_DataMatrixVersion.h"\r
+#include "datamatrix/BC_DataMatrixReader.h"\r
+#include "datamatrix/BC_Encoder.h"\r
+#include "datamatrix/BC_DefaultPlacement.h"\r
+#include "datamatrix/BC_SymbolShapeHint.h"\r
+#include "datamatrix/BC_SymbolInfo.h"\r
+#include "datamatrix/BC_DataMatrixSymbolInfo144.h"\r
+#include "datamatrix/BC_ErrorCorrection.h"\r
+#include "datamatrix/BC_EncoderContext.h"\r
+#include "datamatrix/BC_C40Encoder.h"\r
+#include "datamatrix/BC_TextEncoder.h"\r
+#include "datamatrix/BC_X12Encoder.h"\r
+#include "datamatrix/BC_EdifactEncoder.h"\r
+#include "datamatrix/BC_Base256Encoder.h"\r
+#include "datamatrix/BC_ASCIIEncoder.h"\r
+#include "datamatrix/BC_HighLevelEncoder.h"\r
+#include "datamatrix/BC_DataMatrixWriter.h"\r
+#include "oned/BC_OneDReader.h"\r
+#include "oned/BC_OnedCode128Reader.h"\r
+#include "oned/BC_OnedCode39Reader.h"\r
+#include "oned/BC_OneDimReader.h"\r
+#include "oned/BC_OnedEAN13Reader.h"\r
+#include "oned/BC_OnedEAN8Reader.h"\r
+#include "oned/BC_OnedUPCAReader.h"\r
+#include "oned/BC_OnedCodaBarReader.h"\r
+#include "oned/BC_OneDimWriter.h"\r
+#include "oned/BC_OnedCode128Writer.h"\r
+#include "oned/BC_OnedCode39Writer.h"\r
+#include "oned/BC_OnedEAN13Writer.h"\r
+#include "oned/BC_OnedEAN8Writer.h"\r
+#include "oned/BC_OnedUPCAWriter.h"\r
+#include "pdf417/BC_PDF417DetectorResult.h"\r
+#include "pdf417/BC_PDF417Compaction.h"\r
+#include "pdf417/BC_PDF417HighLevelEncoder.h"\r
+#include "pdf417/BC_PDF417Detector.h"\r
+#include "pdf417/BC_PDF417DetectorResult.h"\r
+#include "pdf417/BC_PDF417Codeword.h"\r
+#include "pdf417/BC_PDF417Common.h"\r
+#include "pdf417/BC_PDF417BarcodeValue.h"\r
+#include "pdf417/BC_PDF417BarcodeMetadata.h"\r
+#include "pdf417/BC_PDF417BoundingBox.h"\r
+#include "pdf417/BC_PDF417DetectionResultColumn.h"\r
+#include "pdf417/BC_PDF417DetectionResultRowIndicatorColumn.h"\r
+#include "pdf417/BC_PDF417DetectionResult.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417CodewordDecoder.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417ECModulusPoly.h"\r
+#include "pdf417/BC_PDF417ECModulusGF.h"\r
+#include "pdf417/BC_PDF417ECErrorCorrection.h"\r
+#include "pdf417/BC_PDF417DecodedBitStreamParser.h"\r
+#include "pdf417/BC_PDF417ScanningDecoder.h"\r
+#include "pdf417/BC_PDF417Reader.h"\r
+#include "qrcode/BC_QRCodeReader.h"\r
+#include "qrcode/BC_QRCodeWriter.h"\r
+#include "qrcode/BC_QRCoderErrorCorrectionLevel.h"\r
+#include "qrcode/BC_QRCoderMode.h"\r
+#include "qrcode/BC_QRCoderVersion.h"\r
+#include "qrcode/BC_QRDataMask.h"\r
+#include "qrcode/BC_QRDecodedBitStreamParser.h"\r
+void BC_Library_Init()\r
+{\r
+ CBC_QRCoderErrorCorrectionLevel::Initialize();\r
+ CBC_QRCoderMode::Initialize();\r
+ CBC_QRCoderVersion::Initialize();\r
+ CBC_QRDataMask::Initialize();\r
+ CBC_ReedSolomonGF256::Initialize();\r
+ CBC_DataMatrixVersion::Initialize();\r
+ CBC_SymbolInfo::Initialize();\r
+ CBC_ErrorCorrection::Initialize();\r
+ CBC_PDF417HighLevelEncoder::Initialize();\r
+ FX_INT32 e = 0;\r
+ CBC_PDF417ECModulusGF::Initialize(e);\r
+ CBC_DecodedBitStreamPaser::Initialize();\r
+ CBC_PDF417CodewordDecoder::Initialize();\r
+ CBC_PDF417ECErrorCorrection::Initialize(e);\r
+ CBC_PDF417ScanningDecoder::Initialize();\r
+}\r
+void BC_Library_Destory()\r
+{\r
+ CBC_QRCoderErrorCorrectionLevel::Finalize();\r
+ CBC_QRCoderMode::Finalize();\r
+ CBC_QRCoderVersion::Finalize();\r
+ CBC_QRDataMask::Finalize();\r
+ CBC_ReedSolomonGF256::Finalize();\r
+ CBC_DataMatrixVersion::Finalize();\r
+ CBC_SymbolInfo::Finalize();\r
+ CBC_ErrorCorrection::Finalize();\r
+ CBC_PDF417HighLevelEncoder::Finalize();\r
+ CBC_DecodedBitStreamPaser::Finalize();\r
+ CBC_PDF417CodewordDecoder::Finalize();\r
+ CBC_PDF417ECErrorCorrection::Finalize();\r
+ CBC_PDF417ECModulusGF::Finalize();\r
+ CBC_PDF417ScanningDecoder::Finalize();\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_LuminanceSource.h"\r
+CBC_LuminanceSource::CBC_LuminanceSource(FX_INT32 width, FX_INT32 height): m_width(width), m_height(height)\r
+{\r
+}\r
+CBC_LuminanceSource::~CBC_LuminanceSource()\r
+{\r
+}\r
+FX_INT32 CBC_LuminanceSource::GetWidth()\r
+{\r
+ return m_width;\r
+}\r
+FX_INT32 CBC_LuminanceSource::GetHeight()\r
+{\r
+ return m_height;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_LUMINANCESOURCE_H\r
+#define _BC_LUMINANCESOURCE_H\r
+class CBC_LuminanceSource;\r
+class CBC_LuminanceSource : public CFX_Object\r
+{\r
+public:\r
+ CBC_LuminanceSource(FX_INT32 width, FX_INT32 height);\r
+ virtual ~CBC_LuminanceSource();\r
+ FX_INT32 GetWidth();\r
+ FX_INT32 GetHeight();\r
+\r
+ virtual CFX_ByteArray *GetRow(FX_INT32 y, CFX_ByteArray &row, FX_INT32 &e) = 0;\r
+ virtual CFX_ByteArray *GetMatrix() = 0;\r
+ virtual FX_BOOL IsCropSupported()\r
+ {\r
+ return FALSE;\r
+ }\r
+ virtual FX_BOOL IsRotateSupported()\r
+ {\r
+ return FALSE;\r
+ }\r
+\r
+ virtual CBC_LuminanceSource *RotateCounterClockwise(FX_INT32 &e) = 0;\r
+protected:\r
+ FX_INT32 m_width;\r
+ FX_INT32 m_height;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+#include "BC_Reader.h"\r
+CBC_Reader::CBC_Reader()\r
+{\r
+}\r
+CBC_Reader::~CBC_Reader()\r
+{\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_READER_H_\r
+#define _BC_READER_H_\r
+class CBC_BinaryBitmap;\r
+class CBC_Reader;\r
+class CBC_Reader : public CFX_Object\r
+{\r
+public:\r
+ CBC_Reader();\r
+ virtual ~CBC_Reader();\r
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 &e) = 0;\r
+ virtual CFX_ByteString Decode(CBC_BinaryBitmap *image, FX_INT32 hints, FX_INT32 &e) = 0;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_ResultPoint.h"\r
+CBC_ResultPoint::CBC_ResultPoint(FX_FLOAT x, FX_FLOAT y): m_x(x), m_y(y)\r
+{\r
+}\r
+FX_FLOAT CBC_ResultPoint::GetX()\r
+{\r
+ return m_x;\r
+}\r
+FX_FLOAT CBC_ResultPoint::GetY()\r
+{\r
+ return m_y;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_RESULTPOINT_H_\r
+#define _BC_RESULTPOINT_H_\r
+class CBC_ResultPoint;\r
+class CBC_ResultPoint : public CFX_Object\r
+{\r
+public:\r
+ CBC_ResultPoint();\r
+ CBC_ResultPoint(FX_FLOAT x, FX_FLOAT y);\r
+ virtual ~CBC_ResultPoint()\r
+ {\r
+ }\r
+ virtual FX_FLOAT GetX();\r
+ virtual FX_FLOAT GetY();\r
+protected:\r
+ FX_FLOAT m_x;\r
+ FX_FLOAT m_y;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+#include "common/BC_CommonBitMatrix.h"\r
+#include "BC_Writer.h"\r
+#include "BC_TwoDimWriter.h"\r
+CBC_TwoDimWriter::CBC_TwoDimWriter()\r
+{\r
+ m_iCorrectLevel = 1;\r
+ m_bFixedSize = TRUE;\r
+ m_output = NULL;\r
+}\r
+CBC_TwoDimWriter::~CBC_TwoDimWriter()\r
+{\r
+ if (m_output != NULL) {\r
+ delete m_output;\r
+ m_output = NULL;\r
+ }\r
+}\r
+void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix)\r
+{\r
+ CFX_GraphStateData stateData;\r
+ CFX_PathData path;\r
+ path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height);\r
+ device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE);\r
+ FX_INT32 leftPos = 0;\r
+ FX_INT32 topPos = 0;\r
+ if ( m_bFixedSize) {\r
+ leftPos = (m_Width - m_output->GetWidth()) / 2;\r
+ topPos = (m_Height - m_output->GetHeight()) / 2;\r
+ }\r
+ CFX_Matrix matri = *matrix;\r
+ if (m_Width < m_output->GetWidth() && m_Height < m_output->GetHeight()) {\r
+ CFX_Matrix matriScale((FX_FLOAT)m_Width / (FX_FLOAT)m_output->GetWidth(), 0.0, 0.0, (FX_FLOAT)m_Height / (FX_FLOAT)m_output->GetHeight(), 0.0, 0.0);\r
+ matriScale.Concat(*matrix);\r
+ matri = matriScale;\r
+ }\r
+ for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {\r
+ for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {\r
+ CFX_PathData rect;\r
+ rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1));\r
+ CFX_GraphStateData stateData;\r
+ if(m_output->Get(x, y)) {\r
+ device->DrawPath(&rect, &matri, &stateData, m_barColor, 0, FXFILL_WINDING);\r
+ }\r
+ }\r
+ }\r
+}\r
+void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e)\r
+{\r
+ if (m_bFixedSize) {\r
+ pOutBitmap = CreateDIBitmap(m_Width, m_Height);\r
+ } else {\r
+ pOutBitmap = CreateDIBitmap(m_output->GetWidth(), m_output->GetHeight());\r
+ }\r
+ if (!pOutBitmap) {\r
+ e = BCExceptionFailToCreateBitmap;\r
+ return;\r
+ }\r
+ pOutBitmap->Clear(m_backgroundColor);\r
+ FX_INT32 leftPos = 0;\r
+ FX_INT32 topPos = 0;\r
+ if ( m_bFixedSize) {\r
+ leftPos = (m_Width - m_output->GetWidth()) / 2;\r
+ topPos = (m_Height - m_output->GetHeight()) / 2;\r
+ }\r
+ for (FX_INT32 x = 0; x < m_output->GetWidth(); x++) {\r
+ for (FX_INT32 y = 0; y < m_output->GetHeight(); y++) {\r
+ if (m_output->Get(x, y)) {\r
+ pOutBitmap->SetPixel(leftPos + x, topPos + y, m_barColor);\r
+ }\r
+ }\r
+ }\r
+ if (!m_bFixedSize) {\r
+ CFX_DIBitmap * pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height);\r
+ if (pOutBitmap) {\r
+ delete pOutBitmap;\r
+ }\r
+ pOutBitmap = pStretchBitmap;\r
+ }\r
+}\r
+void CBC_TwoDimWriter::RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e)\r
+{\r
+ FX_INT32 inputWidth = codeWidth;\r
+ FX_INT32 inputHeight = codeHeight;\r
+ FX_INT32 tempWidth = inputWidth + (1 << 1);\r
+ FX_INT32 tempHeight = inputHeight + (1 << 1);\r
+ FX_FLOAT moduleHSize = (FX_FLOAT)FX_MIN(m_ModuleWidth, m_ModuleHeight);\r
+ if (moduleHSize > 8) {\r
+ moduleHSize = 8;\r
+ } else if (moduleHSize < 1) {\r
+ moduleHSize = 1;\r
+ }\r
+ FX_INT32 outputWidth = (FX_INT32)FX_MAX(tempWidth * moduleHSize, tempWidth);\r
+ FX_INT32 outputHeight = (FX_INT32)FX_MAX(tempHeight * moduleHSize, tempHeight);\r
+ FX_INT32 multiX = 1;\r
+ FX_INT32 multiY = 1;\r
+ if (m_bFixedSize) {\r
+ if (m_Width < outputWidth || m_Height < outputHeight) {\r
+ e = BCExceptionBitmapSizeError;\r
+ return;\r
+ }\r
+ } else {\r
+ if (m_Width > outputWidth || m_Height > outputHeight) {\r
+ outputWidth = (FX_INT32)(outputWidth * ceil ( (FX_FLOAT)m_Width / (FX_FLOAT)outputWidth));\r
+ outputHeight = (FX_INT32)(outputHeight * ceil ( (FX_FLOAT)m_Height / (FX_FLOAT)outputHeight));\r
+ }\r
+ }\r
+ multiX = (FX_INT32)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth);\r
+ multiY = (FX_INT32)ceil((FX_FLOAT)outputHeight / (FX_FLOAT) tempHeight);\r
+ if (m_bFixedSize) {\r
+ multiX = FX_MIN(multiX, multiY);\r
+ multiY = multiX;\r
+ }\r
+ FX_INT32 leftPadding = (outputWidth - (inputWidth * multiX)) / 2;\r
+ FX_INT32 topPadding = (outputHeight - (inputHeight * multiY)) / 2;\r
+ if (leftPadding < 0) {\r
+ leftPadding = 0;\r
+ }\r
+ if (topPadding < 0) {\r
+ topPadding = 0;\r
+ }\r
+ m_output = FX_NEW CBC_CommonBitMatrix;\r
+ m_output->Init(outputWidth, outputHeight);\r
+ for (FX_INT32 inputY = 0, outputY = topPadding; (inputY < inputHeight) && (outputY < outputHeight - multiY); inputY++, outputY += multiY) {\r
+ for (FX_INT32 inputX = 0, outputX = leftPadding; (inputX < inputWidth) && (outputX < outputWidth - multiX); inputX++, outputX += multiX) {\r
+ if (code[inputX + inputY * inputWidth] == 1) {\r
+ m_output->SetRegion(outputX, outputY, multiX, multiY, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_TWODIMWRITER_H_\r
+#define _BC_TWODIMWRITER_H_\r
+#include "BC_Writer.h"\r
+class CBC_Writer;\r
+class CBC_CommonBitMatrix;\r
+class CBC_TwoDimWriter;\r
+class CBC_TwoDimWriter : public CBC_Writer\r
+{\r
+public:\r
+ CBC_TwoDimWriter();\r
+ virtual ~CBC_TwoDimWriter();\r
+ virtual FX_BYTE* Encode(const CFX_WideString& contents, FX_INT32 ecLevel, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)\r
+ {\r
+ return NULL;\r
+ };\r
+ virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e)\r
+ {\r
+ return NULL;\r
+ };\r
+ virtual FX_BYTE* Encode(const CFX_ByteString& contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e)\r
+ {\r
+ return NULL;\r
+ };\r
+ virtual void RenderResult(FX_BYTE *code, FX_INT32 codeWidth, FX_INT32 codeHeight, FX_INT32 &e);\r
+ virtual void RenderBitmapResult(CFX_DIBitmap *&pOutBitmap, FX_INT32& e);\r
+ virtual void RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix);\r
+ virtual FX_BOOL SetErrorCorrectionLevel (FX_INT32 level) = 0;\r
+ virtual FX_INT32 GetErrorCorrectionLevel()\r
+ {\r
+ return m_iCorrectLevel;\r
+ };\r
+\r
+protected:\r
+ FX_INT32 m_iCorrectLevel;\r
+ FX_BOOL m_bFixedSize;\r
+ CBC_CommonBitMatrix* m_output;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+#include "BC_UtilCodingConvert.h"\r
+CBC_UtilCodingConvert::CBC_UtilCodingConvert()\r
+{\r
+}\r
+CBC_UtilCodingConvert::~CBC_UtilCodingConvert()\r
+{\r
+}\r
+void CBC_UtilCodingConvert::UnicodeToLocale(const CFX_WideString &src, CFX_ByteString &dst)\r
+{\r
+ dst.ConvertFrom(src);\r
+}\r
+void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString &src, CFX_ByteString &dst)\r
+{\r
+ CFX_WideString unicode = CFX_WideString::FromLocal(src, src.GetLength());\r
+ dst = unicode.UTF8Encode();\r
+}\r
+void CBC_UtilCodingConvert::LocaleToUtf8(const CFX_ByteString &src, CFX_ByteArray &dst)\r
+{\r
+ CFX_WideString unicode = CFX_WideString::FromLocal(src, src.GetLength());\r
+ CFX_ByteString utf8 = unicode.UTF8Encode();\r
+ for (FX_INT32 i = 0; i < utf8.GetLength(); i ++) {\r
+ dst.Add(utf8[i]);\r
+ }\r
+}\r
+void CBC_UtilCodingConvert::Utf8ToLocale(const CFX_ByteArray &src, CFX_ByteString &dst)\r
+{\r
+ CFX_ByteString utf8;\r
+ for (FX_INT32 i = 0; i < src.GetSize(); i ++) {\r
+ utf8 += src[i];\r
+ }\r
+ CFX_WideString unicode = CFX_WideString::FromUTF8(utf8, utf8.GetLength());\r
+ dst.ConvertFrom(unicode);\r
+}\r
+void CBC_UtilCodingConvert::Utf8ToLocale(const FX_BYTE *src, FX_INT32 count, CFX_ByteString &dst)\r
+{\r
+ CFX_WideString unicode = CFX_WideString::FromUTF8((const char*)src, count);\r
+ dst.ConvertFrom(unicode);\r
+}\r
+void CBC_UtilCodingConvert::UnicodeToUTF8(const CFX_WideString &src, CFX_ByteString &dst)\r
+{\r
+ dst = src.UTF8Encode();\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_UTILCODINGCONVERT_H_\r
+#define _BC_UTILCODINGCONVERT_H_\r
+class CBC_UtilCodingConvert;\r
+class CBC_UtilCodingConvert : public CFX_Object\r
+{\r
+public:\r
+ CBC_UtilCodingConvert();\r
+ virtual ~CBC_UtilCodingConvert();\r
+ static void UnicodeToLocale(const CFX_WideString &source, CFX_ByteString &result);\r
+ static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteString &result);\r
+ static void LocaleToUtf8(const CFX_ByteString &source, CFX_ByteArray &result);\r
+ static void Utf8ToLocale(const CFX_ByteArray &source, CFX_ByteString &result);\r
+ static void Utf8ToLocale(const FX_BYTE *source, FX_INT32 count, CFX_ByteString &result);\r
+ static void UnicodeToUTF8(const CFX_WideString &source, CFX_ByteString &result);\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "barcode.h"\r
+#include "BC_UtilRSS.h"\r
+CBC_UtilRSS::CBC_UtilRSS()\r
+{\r
+}\r
+CBC_UtilRSS::~CBC_UtilRSS()\r
+{\r
+}\r
+CFX_Int32Array *CBC_UtilRSS::GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow)\r
+{\r
+ CFX_Int32Array *iTemp = FX_NEW CFX_Int32Array;\r
+ iTemp->SetSize(elements);\r
+ CBC_AutoPtr<CFX_Int32Array > widths(iTemp);\r
+ FX_INT32 bar;\r
+ FX_INT32 narrowMask = 0;\r
+ for (bar = 0; bar < elements - 1; bar++) {\r
+ narrowMask |= (1 << bar);\r
+ FX_INT32 elmWidth = 1;\r
+ FX_INT32 subVal;\r
+ while (TRUE) {\r
+ subVal = Combins(n - elmWidth - 1, elements - bar - 2);\r
+ if (noNarrow && (narrowMask == 0) &&\r
+ (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) {\r
+ subVal -= Combins(n - elmWidth - (elements - bar), elements - bar - 2);\r
+ }\r
+ if (elements - bar - 1 > 1) {\r
+ FX_INT32 lessVal = 0;\r
+ for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2);\r
+ mxwElement > maxWidth;\r
+ mxwElement--) {\r
+ lessVal += Combins(n - elmWidth - mxwElement - 1, elements - bar - 3);\r
+ }\r
+ subVal -= lessVal * (elements - 1 - bar);\r
+ } else if (n - elmWidth > maxWidth) {\r
+ subVal--;\r
+ }\r
+ val -= subVal;\r
+ if (val < 0) {\r
+ break;\r
+ }\r
+ elmWidth++;\r
+ narrowMask &= ~(1 << bar);\r
+ }\r
+ val += subVal;\r
+ n -= elmWidth;\r
+ (*widths)[bar] = elmWidth;\r
+ }\r
+ (*widths)[bar] = n;\r
+ return widths.release();\r
+}\r
+FX_INT32 CBC_UtilRSS::GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow)\r
+{\r
+ FX_INT32 elements = widths.GetSize();\r
+ FX_INT32 n = 0;\r
+ for (FX_INT32 i = 0; i < elements; i++) {\r
+ n += widths[i];\r
+ }\r
+ FX_INT32 val = 0;\r
+ FX_INT32 narrowMask = 0;\r
+ for (FX_INT32 bar = 0; bar < elements - 1; bar++) {\r
+ FX_INT32 elmWidth;\r
+ for (elmWidth = 1, narrowMask |= (1 << bar);\r
+ elmWidth < widths[bar];\r
+ elmWidth++, narrowMask &= ~(1 << bar)) {\r
+ FX_INT32 subVal = Combins(n - elmWidth - 1, elements - bar - 2);\r
+ if (noNarrow && (narrowMask == 0) &&\r
+ (n - elmWidth - (elements - bar - 1) >= elements - bar - 1)) {\r
+ subVal -= Combins(n - elmWidth - (elements - bar),\r
+ elements - bar - 2);\r
+ }\r
+ if (elements - bar - 1 > 1) {\r
+ FX_INT32 lessVal = 0;\r
+ for (FX_INT32 mxwElement = n - elmWidth - (elements - bar - 2);\r
+ mxwElement > maxWidth; mxwElement--) {\r
+ lessVal += Combins(n - elmWidth - mxwElement - 1,\r
+ elements - bar - 3);\r
+ }\r
+ subVal -= lessVal * (elements - 1 - bar);\r
+ } else if (n - elmWidth > maxWidth) {\r
+ subVal--;\r
+ }\r
+ val += subVal;\r
+ }\r
+ n -= elmWidth;\r
+ }\r
+ return val;\r
+}\r
+FX_INT32 CBC_UtilRSS::Combins(FX_INT32 n, FX_INT32 r)\r
+{\r
+ FX_INT32 maxDenom;\r
+ FX_INT32 minDenom;\r
+ if (n - r > r) {\r
+ minDenom = r;\r
+ maxDenom = n - r;\r
+ } else {\r
+ minDenom = n - r;\r
+ maxDenom = r;\r
+ }\r
+ FX_INT32 val = 1;\r
+ FX_INT32 j = 1;\r
+ for (FX_INT32 i = n; i > maxDenom; i--) {\r
+ val *= i;\r
+ if (j <= minDenom) {\r
+ val /= j;\r
+ j++;\r
+ }\r
+ }\r
+ while (j <= minDenom) {\r
+ val /= j;\r
+ j++;\r
+ }\r
+ return val;\r
+}\r
+CFX_Int32Array *CBC_UtilRSS::Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K)\r
+{\r
+ CFX_Int32Array *widths = FX_NEW CFX_Int32Array;\r
+ widths->SetSize(eDist.GetSize() + 2);\r
+ FX_INT32 twoK = K << 1;\r
+ (*widths)[0] = 1;\r
+ FX_INT32 i;\r
+ FX_INT32 minEven = 10;\r
+ FX_INT32 barSum = 1;\r
+ for (i = 1; i < twoK - 2; i += 2) {\r
+ (*widths)[i] = eDist[i - 1] - (*widths)[i - 1];\r
+ (*widths)[i + 1] = eDist[i] - (*widths)[i];\r
+ barSum += (*widths)[i] + (*widths)[i + 1];\r
+ if ((*widths)[i] < minEven) {\r
+ minEven = (*widths)[i];\r
+ }\r
+ }\r
+ (*widths)[twoK - 1] = N - barSum;\r
+ if ((*widths)[twoK - 1] < minEven) {\r
+ minEven = (*widths)[twoK - 1];\r
+ }\r
+ if (minEven > 1) {\r
+ for (i = 0; i < twoK; i += 2) {\r
+ (*widths)[i] += minEven - 1;\r
+ (*widths)[i + 1] -= minEven - 1;\r
+ }\r
+ }\r
+ return widths;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_UTILRESS_H_\r
+#define _BC_UTILRESS_H_\r
+class CBC_RssPair;\r
+class CBC_UtilRSS : public CFX_Object\r
+{\r
+public:\r
+ virtual ~CBC_UtilRSS();\r
+ static FX_INT32 GetRSSvalue(CFX_Int32Array &widths, FX_INT32 maxWidth, FX_BOOL noNarrow);\r
+\r
+protected:\r
+ static CFX_Int32Array *GetRssWidths(FX_INT32 val, FX_INT32 n, FX_INT32 elements, FX_INT32 maxWidth, FX_BOOL noNarrow);\r
+ static FX_INT32 Combins(FX_INT32 n, FX_INT32 r);\r
+ static CFX_Int32Array *Elements(CFX_Int32Array &eDist, FX_INT32 N, FX_INT32 K);\r
+private:\r
+ CBC_UtilRSS();\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+FX_BOOL BC_FX_ByteString_Replace(CFX_ByteString &dst, FX_DWORD first, FX_DWORD last, FX_INT32 count, FX_CHAR c)\r
+{\r
+ if (first > last || count <= 0) {\r
+ return FALSE;\r
+ }\r
+ dst.Delete(first, last - first);\r
+ for (FX_INT32 i = 0; i < count; i ++) {\r
+ dst.Insert(0, c);\r
+ }\r
+ return TRUE;\r
+}\r
+void BC_FX_ByteString_Append(CFX_ByteString &dst, FX_INT32 count, FX_CHAR c)\r
+{\r
+ for (FX_INT32 i = 0; i < count; i ++) {\r
+ dst += c;\r
+ }\r
+}\r
+void BC_FX_ByteString_Append(CFX_ByteString &dst, const CFX_ByteArray &ba)\r
+{\r
+ for (FX_INT32 i = 0; i < ba.GetSize(); i ++) {\r
+ dst += ba[i];\r
+ }\r
+}\r
+void BC_FX_PtrArray_Sort(CFX_PtrArray &src, BC_PtrArrayCompareCallback fun)\r
+{\r
+ FX_INT32 nLength = src.GetSize();\r
+ FX_BOOL changed = true;\r
+ do {\r
+ changed = false;\r
+ for (FX_INT32 i = 0; i < nLength - 1; i++) {\r
+ if ( fun(src[i + 1], src[i]) ) {\r
+ void *temp = src[i];\r
+ src.SetAt(i, src[i + 1]);\r
+ src.SetAt(i + 1, temp);\r
+ changed = true;\r
+ }\r
+ }\r
+ } while (changed);\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "barcode.h"\r
+#include "BC_Writer.h"\r
+CBC_Writer::CBC_Writer()\r
+{\r
+ m_CharEncoding = 0;\r
+ m_ModuleHeight = 1;\r
+ m_ModuleWidth = 1;\r
+ m_Height = 320;\r
+ m_Width = 640;\r
+ m_colorSpace = FXDIB_Argb;\r
+ m_barColor = 0xff000000;\r
+ m_backgroundColor = 0xffffffff;\r
+}\r
+CBC_Writer::~CBC_Writer()\r
+{\r
+}\r
+FX_BOOL CBC_Writer::SetCharEncoding(FX_INT32 encoding)\r
+{\r
+ m_CharEncoding = encoding;\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Writer::SetModuleHeight(FX_INT32 moduleHeight)\r
+{\r
+ if (moduleHeight > 10 || moduleHeight < 1) {\r
+ return FALSE;\r
+ }\r
+ m_ModuleHeight = moduleHeight;\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Writer::SetModuleWidth(FX_INT32 moduleWidth)\r
+{\r
+ if ( moduleWidth > 10 || moduleWidth < 1) {\r
+ return FALSE;\r
+ }\r
+ m_ModuleWidth = moduleWidth;\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Writer::SetHeight(FX_INT32 height)\r
+{\r
+ m_Height = height;\r
+ return TRUE;\r
+}\r
+FX_BOOL CBC_Writer::SetWidth(FX_INT32 width)\r
+{\r
+ m_Width = width;\r
+ return TRUE;\r
+}\r
+void CBC_Writer::SetBackgroundColor(FX_ARGB backgroundColor)\r
+{\r
+ m_backgroundColor = backgroundColor;\r
+}\r
+void CBC_Writer::SetBarcodeColor(FX_ARGB foregroundColor)\r
+{\r
+ m_barColor = foregroundColor;\r
+}\r
+CFX_DIBitmap* CBC_Writer::CreateDIBitmap(FX_INT32 width, FX_INT32 height)\r
+{\r
+ CFX_DIBitmap *pDIBitmap = NULL;\r
+ pDIBitmap = FX_NEW CFX_DIBitmap;\r
+ if(pDIBitmap != NULL) {\r
+ pDIBitmap->Create(width, height, m_colorSpace);\r
+ }\r
+ return pDIBitmap;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_WRITER_H_\r
+#define _BC_WRITER_H_\r
+class CBC_Writer;\r
+class CBC_Writer : public CFX_Object\r
+{\r
+public:\r
+ CBC_Writer();\r
+ virtual ~CBC_Writer();\r
+ virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 &e) = 0;\r
+ virtual FX_BYTE *Encode(const CFX_ByteString &contents, BCFORMAT format, FX_INT32 &outWidth, FX_INT32 &outHeight, FX_INT32 hints, FX_INT32 &e) = 0;\r
+ virtual FX_BOOL SetCharEncoding(FX_INT32 encoding);\r
+ virtual FX_BOOL SetModuleHeight(FX_INT32 moduleHeight);\r
+ virtual FX_BOOL SetModuleWidth(FX_INT32 moduleWidth);\r
+ virtual FX_BOOL SetHeight(FX_INT32 height);\r
+ virtual FX_BOOL SetWidth(FX_INT32 width);\r
+ virtual void SetBackgroundColor(FX_ARGB backgroundColor);\r
+ virtual void SetBarcodeColor(FX_ARGB foregroundColor);\r
+protected:\r
+ CFX_DIBitmap* CreateDIBitmap(FX_INT32 width, FX_INT32 height);\r
+ FX_INT32 m_CharEncoding;\r
+ FX_INT32 m_ModuleHeight;\r
+ FX_INT32 m_ModuleWidth;\r
+ FX_INT32 m_Height;\r
+ FX_INT32 m_Width;\r
+ FXDIB_Format m_colorSpace;\r
+ FX_ARGB m_barColor;\r
+ FX_ARGB m_backgroundColor;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#include "../foxitlib.h"\r
+#include "utils.h"\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonBitArray.h"\r
+CBC_CommonBitArray::CBC_CommonBitArray(CBC_CommonBitArray* array)\r
+{\r
+ m_size = array->GetSize();\r
+ m_bits.Copy(array->GetBits());\r
+}\r
+CBC_CommonBitArray::CBC_CommonBitArray()\r
+{\r
+ m_bits.SetSize(1);\r
+ m_size = 0;\r
+}\r
+CBC_CommonBitArray::CBC_CommonBitArray(FX_INT32 size)\r
+{\r
+ m_bits.SetSize((size + 31) >> 5);\r
+ m_size = size;\r
+}\r
+CBC_CommonBitArray::~CBC_CommonBitArray()\r
+{\r
+ m_size = 0;\r
+}\r
+FX_INT32 CBC_CommonBitArray::GetSize()\r
+{\r
+ return m_size;\r
+}\r
+CFX_Int32Array& CBC_CommonBitArray::GetBits()\r
+{\r
+ return m_bits;\r
+}\r
+FX_INT32 CBC_CommonBitArray::GetSizeInBytes()\r
+{\r
+ return (m_size + 7) >> 3;\r
+}\r
+FX_BOOL CBC_CommonBitArray::Get(FX_INT32 i)\r
+{\r
+ return (m_bits[i >> 5] & (1 << (i & 0x1f))) != 0;\r
+}\r
+void CBC_CommonBitArray::Set(FX_INT32 i)\r
+{\r
+ m_bits[i >> 5] |= 1 << (i & 0x1F);\r
+}\r
+void CBC_CommonBitArray::Flip(FX_INT32 i)\r
+{\r
+ m_bits[i >> 5] ^= 1 << (i & 0x1F);\r
+}\r
+void CBC_CommonBitArray::SetBulk(FX_INT32 i, FX_INT32 newBits)\r
+{\r
+ m_bits[i >> 5] = newBits;\r
+}\r
+void CBC_CommonBitArray::Clear()\r
+{\r
+ FXSYS_memset32(&m_bits[0], 0x00, m_bits.GetSize() * sizeof(FX_INT32));\r
+}\r
+FX_BOOL CBC_CommonBitArray::IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e)\r
+{\r
+ if (end < start) {\r
+ e = BCExceptionEndLessThanStart;\r
+ return FALSE;\r
+ }\r
+ if (end == start) {\r
+ return TRUE;\r
+ }\r
+ end--;\r
+ FX_INT32 firstInt = start >> 5;\r
+ FX_INT32 lastInt = end >> 5;\r
+ FX_INT32 i;\r
+ for (i = firstInt; i <= lastInt; i++) {\r
+ FX_INT32 firstBit = i > firstInt ? 0 : start & 0x1F;\r
+ FX_INT32 lastBit = i < lastInt ? 31 : end & 0x1F;\r
+ FX_INT32 mask;\r
+ if (firstBit == 0 && lastBit == 31) {\r
+ mask = -1;\r
+ } else {\r
+ mask = 0;\r
+ for (FX_INT32 j = firstBit; j <= lastBit; j++) {\r
+ mask |= 1 << j;\r
+ }\r
+ }\r
+ if ((m_bits[i] & mask) != (value ? mask : 0)) {\r
+ return FALSE;\r
+ }\r
+ }\r
+ return TRUE;\r
+}\r
+FX_INT32* CBC_CommonBitArray::GetBitArray()\r
+{\r
+ return &m_bits[0];\r
+}\r
+void CBC_CommonBitArray::Reverse()\r
+{\r
+ FX_INT32* newBits = FX_Alloc(FX_INT32, m_bits.GetSize());\r
+ FXSYS_memset32(newBits, 0x00, m_bits.GetSize() * sizeof(FX_INT32));\r
+ FX_INT32 size = m_size;\r
+ FX_INT32 i;\r
+ for (i = 0; i < size; i++) {\r
+ if (Get(size - i - 1)) {\r
+ newBits[i >> 5] |= 1 << (i & 0x1F);\r
+ }\r
+ }\r
+ FXSYS_memcpy32(&m_bits[0], newBits, m_bits.GetSize() * sizeof(FX_INT32));\r
+ FX_Free(newBits);\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONBITARRAY_H_\r
+#define _BC_COMMONBITARRAY_H_\r
+class CBC_CommonBitArray;\r
+class CBC_CommonBitArray : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonBitArray(CBC_CommonBitArray* array);\r
+ CBC_CommonBitArray(FX_INT32 size);\r
+ CBC_CommonBitArray();\r
+ virtual ~CBC_CommonBitArray();\r
+ FX_INT32 GetSize();\r
+ CFX_Int32Array& GetBits();\r
+ FX_INT32 GetSizeInBytes();\r
+ FX_BOOL Get(FX_INT32 i);\r
+ void Set(FX_INT32 i);\r
+ void Flip(FX_INT32 i);\r
+ void SetBulk(FX_INT32 i, FX_INT32 newBits);\r
+ FX_BOOL IsRange(FX_INT32 start, FX_INT32 end, FX_BOOL value, FX_INT32 &e);\r
+ FX_INT32 *GetBitArray();\r
+ void Reverse();\r
+ void Clear();\r
+private:\r
+ FX_INT32 m_size;\r
+ CFX_Int32Array m_bits;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonBitArray.h"\r
+#include "BC_CommonBitMatrix.h"\r
+CBC_CommonBitMatrix::CBC_CommonBitMatrix()\r
+{\r
+ m_width = 0;\r
+ m_height = 0;\r
+ m_rowSize = 0;\r
+ m_bits = NULL;\r
+}\r
+void CBC_CommonBitMatrix::Init(FX_INT32 dimension)\r
+{\r
+ m_width = dimension;\r
+ m_height = dimension;\r
+ FX_INT32 rowSize = (m_height + 31) >> 5;\r
+ m_rowSize = rowSize;\r
+ m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);\r
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));\r
+}\r
+void CBC_CommonBitMatrix::Init(FX_INT32 width, FX_INT32 height)\r
+{\r
+ m_width = width;\r
+ m_height = height;\r
+ FX_INT32 rowSize = (width + 31) >> 5;\r
+ m_rowSize = rowSize;\r
+ m_bits = FX_Alloc(FX_INT32, m_rowSize * m_height);\r
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));\r
+}\r
+CBC_CommonBitMatrix::~CBC_CommonBitMatrix()\r
+{\r
+ if (m_bits != NULL) {\r
+ FX_Free(m_bits);\r
+ }\r
+ m_bits = NULL;\r
+ m_height = m_width = m_rowSize = 0;\r
+}\r
+FX_BOOL CBC_CommonBitMatrix::Get(FX_INT32 x, FX_INT32 y)\r
+{\r
+ FX_INT32 offset = y * m_rowSize + (x >> 5);\r
+ if (offset >= m_rowSize * m_height || offset < 0) {\r
+ return false;\r
+ }\r
+ return ((((FX_DWORD)m_bits[offset]) >> (x & 0x1f)) & 1) != 0;\r
+}\r
+FX_INT32* CBC_CommonBitMatrix::GetBits()\r
+{\r
+ return m_bits;\r
+}\r
+void CBC_CommonBitMatrix::Set(FX_INT32 x, FX_INT32 y)\r
+{\r
+ FX_INT32 offset = y * m_rowSize + (x >> 5);\r
+ if (offset >= m_rowSize * m_height || offset < 0) {\r
+ return;\r
+ }\r
+ m_bits[offset] |= 1 << (x & 0x1f);\r
+}\r
+void CBC_CommonBitMatrix::Flip(FX_INT32 x, FX_INT32 y)\r
+{\r
+ FX_INT32 offset = y * m_rowSize + (x >> 5);\r
+ m_bits[offset] ^= 1 << (x & 0x1f);\r
+}\r
+void CBC_CommonBitMatrix::Clear()\r
+{\r
+ FXSYS_memset32(m_bits, 0, m_rowSize * m_height * sizeof(FX_INT32));\r
+}\r
+void CBC_CommonBitMatrix::SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e)\r
+{\r
+ if (top < 0 || left < 0) {\r
+ e = BCExceptionLeftAndTopMustBeNonnegative;\r
+ return;\r
+ }\r
+ if (height < 1 || width < 1) {\r
+ e = BCExceptionHeightAndWidthMustBeAtLeast1;\r
+ return;\r
+ }\r
+ FX_INT32 right = left + width;\r
+ FX_INT32 bottom = top + height;\r
+ if (m_height < bottom || m_width < right) {\r
+ e = BCExceptionRegionMustFitInsideMatrix;\r
+ return;\r
+ }\r
+ FX_INT32 y;\r
+ for (y = top; y < bottom; y++) {\r
+ FX_INT32 offset = y * m_rowSize;\r
+ FX_INT32 x;\r
+ for (x = left; x < right; x++) {\r
+ m_bits[offset + (x >> 5)] |= 1 << (x & 0x1f);\r
+ }\r
+ }\r
+}\r
+CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(FX_INT32 y, CBC_CommonBitArray* row)\r
+{\r
+ CBC_CommonBitArray* rowArray = NULL;\r
+ if (row == NULL || row->GetSize() < m_width) {\r
+ rowArray = FX_NEW CBC_CommonBitArray(m_width);\r
+ } else {\r
+ rowArray = FX_NEW CBC_CommonBitArray(row);\r
+ }\r
+ FX_INT32 offset = y * m_rowSize;\r
+ FX_INT32 x;\r
+ for (x = 0; x < m_rowSize; x++) {\r
+ rowArray->SetBulk(x << 5, m_bits[offset + x]);\r
+ }\r
+ return rowArray;\r
+}\r
+void CBC_CommonBitMatrix::SetRow(FX_INT32 y, CBC_CommonBitArray* row)\r
+{\r
+ FX_INT32 l = y * m_rowSize;\r
+ for (FX_INT32 i = 0; i < m_rowSize; i++) {\r
+ m_bits[l] = row->GetBitArray()[i];\r
+ l++;\r
+ }\r
+}\r
+void CBC_CommonBitMatrix::SetCol(FX_INT32 y, CBC_CommonBitArray* col)\r
+{\r
+ for (FX_INT32 i = 0; i < col->GetBits().GetSize(); i++) {\r
+ m_bits[i * m_rowSize + y] = col->GetBitArray()[i];\r
+ }\r
+}\r
+FX_INT32 CBC_CommonBitMatrix::GetWidth()\r
+{\r
+ return m_width;\r
+}\r
+FX_INT32 CBC_CommonBitMatrix::GetHeight()\r
+{\r
+ return m_height;\r
+}\r
+FX_INT32 CBC_CommonBitMatrix::GetRowSize()\r
+{\r
+ return m_rowSize;\r
+}\r
+FX_INT32 CBC_CommonBitMatrix::GetDimension(FX_INT32 &e)\r
+{\r
+ if (m_width != m_height) {\r
+ e = BCExceptionCanNotCallGetDimensionOnNonSquareMatrix;\r
+ return 0;\r
+ }\r
+ return m_width;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONBITMATRIX_H_\r
+#define _BC_COMMONBITMATRIX_H_\r
+class CBC_CommonBitArray;\r
+class CBC_CommonBitMatrix;\r
+class CBC_CommonBitMatrix : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonBitMatrix();\r
+ virtual ~CBC_CommonBitMatrix();\r
+ FX_BOOL Get(FX_INT32 x, FX_INT32 y);\r
+ void Set(FX_INT32 x, FX_INT32 y);\r
+ void Flip(FX_INT32 x, FX_INT32 y);\r
+ void Clear();\r
+ void SetRegion(FX_INT32 left, FX_INT32 top, FX_INT32 width, FX_INT32 height, FX_INT32 &e);\r
+ CBC_CommonBitArray* GetRow(FX_INT32 y, CBC_CommonBitArray* row);\r
+ void SetRow(FX_INT32 y, CBC_CommonBitArray* row);\r
+ CBC_CommonBitArray* GetCol(FX_INT32 y, CBC_CommonBitArray* row);\r
+ void SetCol(FX_INT32 y, CBC_CommonBitArray* col);\r
+ FX_INT32 GetWidth();\r
+ FX_INT32 GetHeight();\r
+ FX_INT32 GetRowSize();\r
+ FX_INT32 GetDimension(FX_INT32 &e);\r
+ virtual void Init(FX_INT32 dimension);\r
+ virtual void Init(FX_INT32 width, FX_INT32 height);\r
+ FX_INT32* GetBits();\r
+private:\r
+ FX_INT32 m_width;\r
+ FX_INT32 m_height;\r
+ FX_INT32 m_rowSize;\r
+ FX_INT32* m_bits;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonBitSource.h"\r
+CBC_CommonBitSource::CBC_CommonBitSource(CFX_ByteArray* bytes)\r
+{\r
+ m_bytes.Copy((*bytes));\r
+ m_bitOffset = 0;\r
+ m_byteOffset = 0;\r
+}\r
+CBC_CommonBitSource::~CBC_CommonBitSource()\r
+{\r
+}\r
+FX_INT32 CBC_CommonBitSource::ReadBits(FX_INT32 numBits, FX_INT32 &e)\r
+{\r
+ if (numBits < 1 || numBits > 32) {\r
+ e = BCExceptionIllegalArgument;\r
+ return 0;\r
+ }\r
+ FX_INT32 result = 0;\r
+ if (m_bitOffset > 0) {\r
+ FX_INT32 bitsLeft = 8 - m_bitOffset;\r
+ FX_INT32 toRead = numBits < bitsLeft ? numBits : bitsLeft;\r
+ FX_INT32 bitsToNotRead = bitsLeft - toRead;\r
+ FX_INT32 mask = (0xff >> (8 - toRead)) << bitsToNotRead;\r
+ result = (m_bytes[m_byteOffset] & mask) >> bitsToNotRead;\r
+ numBits -= toRead;\r
+ m_bitOffset += toRead;\r
+ if (m_bitOffset == 8) {\r
+ m_bitOffset = 0;\r
+ m_byteOffset++;\r
+ }\r
+ }\r
+ if (numBits > 0) {\r
+ while(numBits >= 8) {\r
+ result = (result << 8) | (m_bytes[m_byteOffset] & 0xff);\r
+ m_byteOffset++;\r
+ numBits -= 8;\r
+ }\r
+ if (numBits > 0) {\r
+ FX_INT32 bitsToNotRead = 8 - numBits;\r
+ FX_INT32 mask = (0xff >> bitsToNotRead) << bitsToNotRead;\r
+ result = (result << numBits) | ((m_bytes[m_byteOffset] & mask) >> bitsToNotRead);\r
+ m_bitOffset += numBits;\r
+ }\r
+ }\r
+ return result;\r
+}\r
+FX_INT32 CBC_CommonBitSource::Available()\r
+{\r
+ return 8 * (m_bytes.GetSize() - m_byteOffset) - m_bitOffset;\r
+}\r
+FX_INT32 CBC_CommonBitSource::getByteOffset()\r
+{\r
+ return m_byteOffset;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONBITSOURCE_H_\r
+#define _BC_COMMONBITSOURCE_H_\r
+class CBC_CommonBitSource;\r
+class CBC_CommonBitSource : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonBitSource(CFX_ByteArray *bytes);\r
+ virtual ~CBC_CommonBitSource();\r
+ FX_INT32 ReadBits(FX_INT32 numBits, FX_INT32 &e);\r
+ FX_INT32 Available();\r
+ FX_INT32 getByteOffset();\r
+private:\r
+ CFX_ByteArray m_bytes;\r
+ FX_INT32 m_byteOffset;\r
+ FX_INT32 m_bitOffset;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2008 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonByteArray.h"\r
+CBC_CommonByteArray::CBC_CommonByteArray()\r
+{\r
+ m_bytes = NULL;\r
+ m_size = 0;\r
+ m_index = 0;\r
+}\r
+CBC_CommonByteArray::CBC_CommonByteArray(FX_INT32 size)\r
+{\r
+ m_size = size;\r
+ m_bytes = FX_Alloc(FX_BYTE, size);\r
+ FXSYS_memset32(m_bytes, 0, size);\r
+ m_index = 0;\r
+}\r
+CBC_CommonByteArray::CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size)\r
+{\r
+ m_size = size;\r
+ m_bytes = FX_Alloc(FX_BYTE, size);\r
+ FXSYS_memcpy32(m_bytes, byteArray, size);\r
+ m_index = size;\r
+}\r
+CBC_CommonByteArray::~CBC_CommonByteArray()\r
+{\r
+ if ( m_bytes != NULL) {\r
+ FX_Free( m_bytes );\r
+ m_bytes = NULL;\r
+ }\r
+ m_index = 0;\r
+ m_size = 0;\r
+}\r
+FX_INT32 CBC_CommonByteArray::At(FX_INT32 index)\r
+{\r
+ return m_bytes[index] & 0xff;\r
+}\r
+void CBC_CommonByteArray::Set(FX_INT32 index, FX_INT32 value)\r
+{\r
+ m_bytes[index] = (FX_BYTE) value;\r
+}\r
+FX_INT32 CBC_CommonByteArray::Size()\r
+{\r
+ return m_size;\r
+}\r
+FX_BOOL CBC_CommonByteArray::IsEmpty()\r
+{\r
+ return m_size == 0;\r
+}\r
+void CBC_CommonByteArray::AppendByte(FX_INT32 value)\r
+{\r
+ if (m_size == 0 || m_index >= m_size) {\r
+ FX_INT32 newSize = FX_MAX(32, m_size << 1);\r
+ Reserve(newSize);\r
+ }\r
+ m_bytes[m_index] = (FX_BYTE)value;\r
+ m_index++;\r
+}\r
+void CBC_CommonByteArray::Reserve(FX_INT32 capacity)\r
+{\r
+ if (m_bytes == NULL || m_size < capacity) {\r
+ FX_BYTE *newArray = FX_Alloc(FX_BYTE, capacity);\r
+ FXSYS_memset32(newArray, 0, capacity);\r
+ if (m_bytes != NULL) {\r
+ FXSYS_memcpy32(newArray, m_bytes, m_size);\r
+ FX_Free( m_bytes );\r
+ }\r
+ m_bytes = newArray;\r
+ m_size = capacity;\r
+ }\r
+}\r
+void CBC_CommonByteArray::Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count)\r
+{\r
+ if (m_bytes != NULL) {\r
+ FX_Free( m_bytes );\r
+ }\r
+ m_bytes = FX_Alloc(FX_BYTE, count);\r
+ m_size = count;\r
+ FXSYS_memcpy32(m_bytes, source + offset, count);\r
+ m_index = count;\r
+}\r
+void CBC_CommonByteArray::Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count)\r
+{\r
+ if (m_bytes != NULL) {\r
+ FX_Free( m_bytes );\r
+ }\r
+ m_bytes = FX_Alloc(FX_BYTE, count);\r
+ m_size = count;\r
+ FX_INT32 i;\r
+ for(i = 0; i < count; i++) {\r
+ m_bytes[i] = source->operator [](i + offset);\r
+ }\r
+ m_index = m_size;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONBYTEARRAY_H_\r
+#define _BC_COMMONBYTEARRAY_H_\r
+class CBC_CommonByteArray;\r
+class CBC_CommonByteArray : public CFX_Object\r
+{\r
+private:\r
+ FX_INT32 m_size;\r
+ FX_INT32 m_index;\r
+ FX_BYTE* m_bytes;\r
+public:\r
+ CBC_CommonByteArray();\r
+ CBC_CommonByteArray(FX_INT32 size);\r
+ CBC_CommonByteArray(FX_BYTE* byteArray, FX_INT32 size);\r
+ virtual ~CBC_CommonByteArray();\r
+ FX_INT32 At(FX_INT32 index);\r
+ void Set(FX_INT32 index, FX_INT32 value);\r
+ FX_INT32 Size();\r
+ FX_BOOL IsEmpty();\r
+ void AppendByte(FX_INT32 value);\r
+ void Reserve(FX_INT32 capacity);\r
+ void Set(FX_BYTE* source, FX_INT32 offset, FX_INT32 count);\r
+ void Set(CFX_ByteArray* source, FX_INT32 offset, FX_INT32 count);\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2008 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonByteMatrix.h"\r
+CBC_CommonByteMatrix::CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height)\r
+{\r
+ m_height = height;\r
+ m_width = width;\r
+ m_bytes = NULL;\r
+}\r
+void CBC_CommonByteMatrix::Init()\r
+{\r
+ m_bytes = FX_Alloc(FX_BYTE, m_height * m_width);\r
+ FXSYS_memset8(m_bytes, 0xff, m_height * m_width);\r
+}\r
+CBC_CommonByteMatrix::~CBC_CommonByteMatrix()\r
+{\r
+ if(m_bytes != NULL) {\r
+ FX_Free(m_bytes);\r
+ m_bytes = NULL;\r
+ }\r
+}\r
+FX_INT32 CBC_CommonByteMatrix::GetHeight()\r
+{\r
+ return m_height;\r
+}\r
+FX_INT32 CBC_CommonByteMatrix::GetWidth()\r
+{\r
+ return m_width;\r
+}\r
+FX_BYTE CBC_CommonByteMatrix::Get(FX_INT32 x, FX_INT32 y)\r
+{\r
+ return m_bytes[y * m_width + x];\r
+}\r
+void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_INT32 value)\r
+{\r
+ m_bytes[y * m_width + x] = (FX_BYTE)value;\r
+}\r
+void CBC_CommonByteMatrix::Set(FX_INT32 x, FX_INT32 y, FX_BYTE value)\r
+{\r
+ m_bytes[y * m_width + x] = value;\r
+}\r
+void CBC_CommonByteMatrix::clear(FX_BYTE value)\r
+{\r
+ FX_INT32 y;\r
+ for(y = 0; y < m_height; y++) {\r
+ FX_INT32 x;\r
+ for(x = 0; x < m_width; x++) {\r
+ m_bytes[y * m_width + x] = value;\r
+ }\r
+ }\r
+}\r
+FX_BYTE* CBC_CommonByteMatrix::GetArray()\r
+{\r
+ return m_bytes;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONBYTEMATRIX_H_\r
+#define _BC_COMMONBYTEMATRIX_H_\r
+class CBC_CommonByteMatrix;\r
+class CBC_CommonByteMatrix : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonByteMatrix(FX_INT32 width, FX_INT32 height);\r
+ virtual ~CBC_CommonByteMatrix();\r
+ FX_INT32 GetHeight();\r
+ FX_INT32 GetWidth();\r
+ FX_BYTE Get(FX_INT32 x, FX_INT32 y);\r
+ FX_BYTE* GetArray();\r
+\r
+ void Set(FX_INT32 x, FX_INT32 y, FX_INT32 value);\r
+ void Set(FX_INT32 x, FX_INT32 y, FX_BYTE value);\r
+ void clear(FX_BYTE value);\r
+ virtual void Init();\r
+private:\r
+ FX_BYTE *m_bytes;\r
+ FX_INT32 m_width;\r
+ FX_INT32 m_height;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2008 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonECI.h"\r
+#include "BC_CommonCharacterSetECI.h"\r
+void CBC_CommonCharacterSetECI::initialize()\r
+{\r
+}\r
+CBC_CommonCharacterSetECI::CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName):\r
+ CBC_CommonECI(value), m_encodingName(encodingName)\r
+{\r
+}\r
+CBC_CommonCharacterSetECI::~CBC_CommonCharacterSetECI()\r
+{\r
+}\r
+CFX_ByteString CBC_CommonCharacterSetECI::GetEncodingName()\r
+{\r
+ return m_encodingName;\r
+}\r
+void CBC_CommonCharacterSetECI::AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName)\r
+{\r
+}\r
+CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByValue(FX_INT32 value)\r
+{\r
+ return NULL;\r
+}\r
+CBC_CommonCharacterSetECI* CBC_CommonCharacterSetECI::GetCharacterSetECIByName(const CFX_ByteString& name)\r
+{\r
+ return NULL;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONCHARACTERSETECI_H_\r
+#define _BC_COMMONCHARACTERSETECI_H_\r
+class CBC_CommonECI;\r
+class CBC_CommonCharacterSetECI;\r
+class CBC_CommonCharacterSetECI : public CBC_CommonECI\r
+{\r
+public:\r
+ CBC_CommonCharacterSetECI(FX_INT32 value, CFX_ByteString encodingName);\r
+ virtual ~CBC_CommonCharacterSetECI();\r
+ CFX_ByteString GetEncodingName();\r
+ static void AddCharacterSet(FX_INT32 value, CFX_ByteString encodingName);\r
+ FX_INT32 GetValue();\r
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByValue(FX_INT32 value);\r
+ static CBC_CommonCharacterSetECI* GetCharacterSetECIByName(const CFX_ByteString& name);\r
+private:\r
+ CFX_ByteString m_encodingName;\r
+ static void initialize();\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "../qrcode/BC_QRCoderErrorCorrectionLevel.h"\r
+#include "../pdf417/BC_PDF417ResultMetadata.h"\r
+#include "BC_CommonDecoderResult.h"\r
+CBC_CommonDecoderResult::CBC_CommonDecoderResult()\r
+{\r
+}\r
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e)\r
+{\r
+ if(text.IsEmpty()) {\r
+ e = BCExceptionIllegalArgument;\r
+ return;\r
+ }\r
+ m_rawBytes.Copy(rawBytes);\r
+ m_text = text;\r
+ m_byteSegments.Copy(byteSegments);\r
+ m_ecLevel = ecLevel;\r
+ m_other = NULL;\r
+}\r
+void CBC_CommonDecoderResult::Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e)\r
+{\r
+ if(text.IsEmpty()) {\r
+ e = BCExceptionIllegalArgument;\r
+ return;\r
+ }\r
+ m_rawBytes.Copy(rawBytes);\r
+ m_text = text;\r
+ m_pdf417byteSegments.Copy(byteSegments);\r
+ m_pdf417ecLevel = ecLevel;\r
+ m_other = NULL;\r
+}\r
+void CBC_CommonDecoderResult::setOther(CBC_PDF417ResultMetadata* other)\r
+{\r
+ m_other = other;\r
+}\r
+CBC_CommonDecoderResult::~CBC_CommonDecoderResult()\r
+{\r
+ if (m_other != NULL) {\r
+ delete m_other;\r
+ }\r
+}\r
+const CFX_ByteArray& CBC_CommonDecoderResult::GetRawBytes()\r
+{\r
+ return m_rawBytes;\r
+}\r
+const CFX_Int32Array& CBC_CommonDecoderResult::GetByteSegments()\r
+{\r
+ return m_byteSegments;\r
+}\r
+const CFX_ByteString& CBC_CommonDecoderResult::GetText()\r
+{\r
+ return m_text;\r
+}\r
+CBC_QRCoderErrorCorrectionLevel* CBC_CommonDecoderResult::GetECLevel()\r
+{\r
+ return m_ecLevel;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONDECODERRESULT_H_\r
+#define _BC_COMMONDECODERRESULT_H_\r
+class CBC_QRCoderErrorCorrectionLevel;\r
+class CBC_PDF417ResultMetadata;\r
+class CBC_CommonDecoderResult;\r
+class CBC_CommonDecoderResult : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonDecoderResult();\r
+ virtual ~CBC_CommonDecoderResult();\r
+ const CFX_ByteArray& GetRawBytes();\r
+ const CFX_ByteString& GetText();\r
+ const CFX_Int32Array& GetByteSegments();\r
+ CBC_QRCoderErrorCorrectionLevel* GetECLevel();\r
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_Int32Array &byteSegments, CBC_QRCoderErrorCorrectionLevel* ecLevel, FX_INT32 &e);\r
+ virtual void Init(const CFX_ByteArray &rawBytes, const CFX_ByteString &text, const CFX_PtrArray &byteSegments, const CFX_ByteString &ecLevel, FX_INT32 &e);\r
+ void setOther(CBC_PDF417ResultMetadata* other);\r
+private:\r
+ CFX_ByteArray m_rawBytes;\r
+ CFX_ByteString m_text;\r
+ CFX_Int32Array m_byteSegments;\r
+ CFX_PtrArray m_pdf417byteSegments;\r
+ CBC_QRCoderErrorCorrectionLevel* m_ecLevel;\r
+ CFX_ByteString m_pdf417ecLevel;\r
+ CBC_PDF417ResultMetadata* m_other;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2008 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonECI.h"\r
+#include "BC_CommonCharacterSetECI.h"\r
+CBC_CommonECI::CBC_CommonECI(FX_INT32 value)\r
+{\r
+ m_value = value;\r
+}\r
+CBC_CommonECI::~CBC_CommonECI()\r
+{\r
+}\r
+FX_INT32 CBC_CommonECI::GetValue()\r
+{\r
+ return m_value;\r
+}\r
+CBC_CommonECI* CBC_CommonECI::GetEICByValue(FX_INT32 value, FX_INT32 &e)\r
+{\r
+ if(value < 0 || value > 999999) {\r
+ e = BCExceptionBadECI;\r
+ return NULL;\r
+ }\r
+ if(value < 900) {\r
+ }\r
+ return NULL;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONECI_H_\r
+#define _BC_COMMONECI_H_\r
+class CBC_CommonECI;\r
+class CBC_CommonECI : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonECI(FX_INT32 value);\r
+ virtual ~CBC_CommonECI();\r
+\r
+ FX_INT32 GetValue();\r
+ static CBC_CommonECI* GetEICByValue(FX_INT32 value, FX_INT32 &e);\r
+private:\r
+ FX_INT32 m_value;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_CommonPerspectiveTransform.h"\r
+CBC_CommonPerspectiveTransform::CBC_CommonPerspectiveTransform(FX_FLOAT a11, FX_FLOAT a21, FX_FLOAT a31,\r
+ FX_FLOAT a12, FX_FLOAT a22, FX_FLOAT a32,\r
+ FX_FLOAT a13, FX_FLOAT a23, FX_FLOAT a33) :\r
+ m_a11(a11), m_a21(a21), m_a31(a31),\r
+ m_a12(a12), m_a22(a22), m_a32(a32),\r
+ m_a13(a13), m_a23(a23), m_a33(a33)\r
+{\r
+}\r
+CBC_CommonPerspectiveTransform::~CBC_CommonPerspectiveTransform()\r
+{\r
+}\r
+CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::QuadrilateralToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3,\r
+ FX_FLOAT x0p, FX_FLOAT y0p,\r
+ FX_FLOAT x1p, FX_FLOAT y1p,\r
+ FX_FLOAT x2p, FX_FLOAT y2p,\r
+ FX_FLOAT x3p, FX_FLOAT y3p)\r
+{\r
+ CBC_AutoPtr<CBC_CommonPerspectiveTransform> qToS(QuadrilateralToSquare(x0, y0, x1, y1, x2, y2, x3, y3));\r
+ CBC_AutoPtr<CBC_CommonPerspectiveTransform> sToQ(SquareToQuadrilateral(x0p, y0p, x1p, y1p, x2p, y2p, x3p, y3p));\r
+ return sToQ->Times(*(qToS.get()));\r
+}\r
+void CBC_CommonPerspectiveTransform::TransformPoints(CFX_FloatArray *points)\r
+{\r
+ FX_INT32 max = points->GetSize();\r
+ FX_FLOAT a11 = m_a11;\r
+ FX_FLOAT a12 = m_a12;\r
+ FX_FLOAT a13 = m_a13;\r
+ FX_FLOAT a21 = m_a21;\r
+ FX_FLOAT a22 = m_a22;\r
+ FX_FLOAT a23 = m_a23;\r
+ FX_FLOAT a31 = m_a31;\r
+ FX_FLOAT a32 = m_a32;\r
+ FX_FLOAT a33 = m_a33;\r
+ FX_INT32 i;\r
+ for (i = 0; i < max; i += 2) {\r
+ FX_FLOAT x = (*points)[i];\r
+ FX_FLOAT y = (*points)[i + 1];\r
+ FX_FLOAT denominator = a13 * x + a23 * y + a33;\r
+ (*points)[i] = (a11 * x + a21 * y + a31) / denominator;\r
+ (*points)[i + 1] = (a12 * x + a22 * y + a32) / denominator;\r
+ }\r
+}\r
+CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::SquareToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3)\r
+{\r
+ FX_FLOAT dy2 = y3 - y2;\r
+ FX_FLOAT dy3 = y0 - y1 + y2 - y3;\r
+ if ((dy2 == 0.0f) && (dy3 == 0.0f)) {\r
+ return FX_NEW CBC_CommonPerspectiveTransform(x1 - x0, x2 - x1, x0,\r
+ y1 - y0, y2 - y1, y0,\r
+ 0.0f, 0.0f, 1.0f);\r
+ } else {\r
+ FX_FLOAT dx1 = x1 - x2;\r
+ FX_FLOAT dx2 = x3 - x2;\r
+ FX_FLOAT dx3 = x0 - x1 + x2 - x3;\r
+ FX_FLOAT dy1 = y1 - y2;\r
+ FX_FLOAT denominator = dx1 * dy2 - dx2 * dy1;\r
+ FX_FLOAT a13 = (dx3 * dy2 - dx2 * dy3) / denominator;\r
+ FX_FLOAT a23 = (dx1 * dy3 - dx3 * dy1) / denominator;\r
+ return FX_NEW CBC_CommonPerspectiveTransform(x1 - x0 + a13 * x1, x3 - x0 + a23 * x3, x0,\r
+ y1 - y0 + a13 * y1, y3 - y0 + a23 * y3, y0,\r
+ a13, a23, 1.0f);\r
+ }\r
+}\r
+CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::QuadrilateralToSquare(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3)\r
+{\r
+ CBC_AutoPtr<CBC_CommonPerspectiveTransform> temp1(SquareToQuadrilateral(x0, y0, x1, y1, x2, y2, x3, y3));\r
+ return temp1->BuildAdjoint();\r
+}\r
+CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::BuildAdjoint()\r
+{\r
+ return FX_NEW CBC_CommonPerspectiveTransform(m_a22 * m_a33 - m_a23 * m_a32,\r
+ m_a23 * m_a31 - m_a21 * m_a33,\r
+ m_a21 * m_a32 - m_a22 * m_a31,\r
+ m_a13 * m_a32 - m_a12 * m_a33,\r
+ m_a11 * m_a33 - m_a13 * m_a31,\r
+ m_a12 * m_a31 - m_a11 * m_a32,\r
+ m_a12 * m_a23 - m_a13 * m_a22,\r
+ m_a13 * m_a21 - m_a11 * m_a23,\r
+ m_a11 * m_a22 - m_a12 * m_a21);\r
+}\r
+CBC_CommonPerspectiveTransform *CBC_CommonPerspectiveTransform::Times(CBC_CommonPerspectiveTransform &other)\r
+{\r
+ return FX_NEW CBC_CommonPerspectiveTransform(m_a11 * other.m_a11 + m_a21 * other.m_a12 + m_a31 * other.m_a13,\r
+ m_a11 * other.m_a21 + m_a21 * other.m_a22 + m_a31 * other.m_a23,\r
+ m_a11 * other.m_a31 + m_a21 * other.m_a32 + m_a31 * other.m_a33,\r
+ m_a12 * other.m_a11 + m_a22 * other.m_a12 + m_a32 * other.m_a13,\r
+ m_a12 * other.m_a21 + m_a22 * other.m_a22 + m_a32 * other.m_a23,\r
+ m_a12 * other.m_a31 + m_a22 * other.m_a32 + m_a32 * other.m_a33,\r
+ m_a13 * other.m_a11 + m_a23 * other.m_a12 + m_a33 * other.m_a13,\r
+ m_a13 * other.m_a21 + m_a23 * other.m_a22 + m_a33 * other.m_a23,\r
+ m_a13 * other.m_a31 + m_a23 * other.m_a32 + m_a33 * other.m_a33);\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_COMMONPERSPECTIVETRANSFORM_H_\r
+#define _BC_COMMONPERSPECTIVETRANSFORM_H_\r
+class CBC_CommonPerspectiveTransform;\r
+class CBC_CommonPerspectiveTransform : public CFX_Object\r
+{\r
+public:\r
+ CBC_CommonPerspectiveTransform(FX_FLOAT a11, FX_FLOAT a21, FX_FLOAT a31,\r
+ FX_FLOAT a12, FX_FLOAT a22, FX_FLOAT a32,\r
+ FX_FLOAT a13, FX_FLOAT a23, FX_FLOAT a33);\r
+ virtual ~CBC_CommonPerspectiveTransform();\r
+ static CBC_CommonPerspectiveTransform *QuadrilateralToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3,\r
+ FX_FLOAT x0p, FX_FLOAT y0p,\r
+ FX_FLOAT x1p, FX_FLOAT y1p,\r
+ FX_FLOAT x2p, FX_FLOAT y2p,\r
+ FX_FLOAT x3p, FX_FLOAT y3p);\r
+ static CBC_CommonPerspectiveTransform *SquareToQuadrilateral(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3);\r
+ static CBC_CommonPerspectiveTransform *QuadrilateralToSquare(FX_FLOAT x0, FX_FLOAT y0,\r
+ FX_FLOAT x1, FX_FLOAT y1,\r
+ FX_FLOAT x2, FX_FLOAT y2,\r
+ FX_FLOAT x3, FX_FLOAT y3);\r
+ CBC_CommonPerspectiveTransform *BuildAdjoint();\r
+ CBC_CommonPerspectiveTransform *Times(CBC_CommonPerspectiveTransform &other);\r
+ void TransformPoints(CFX_FloatArray *points);\r
+private:\r
+ FX_FLOAT m_a11, m_a12, m_a13, m_a21, m_a22, m_a23, m_a31, m_a32, m_a33;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2009 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "../BC_Binarizer.h"\r
+#include "../BC_LuminanceSource.h"\r
+#include "BC_CommonBitMatrix.h"\r
+#include "BC_CommonBitArray.h"\r
+#include "BC_GlobalHistogramBinarizer.h"\r
+const FX_INT32 LUMINANCE_BITS = 5;\r
+const FX_INT32 LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;\r
+const FX_INT32 LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;\r
+CBC_GlobalHistogramBinarizer::CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source): CBC_Binarizer(source)\r
+{\r
+}\r
+CBC_GlobalHistogramBinarizer::~CBC_GlobalHistogramBinarizer()\r
+{\r
+}\r
+CBC_CommonBitArray *CBC_GlobalHistogramBinarizer::GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e)\r
+{\r
+ CBC_LuminanceSource *source = GetLuminanceSource();\r
+ FX_INT32 width = source->GetWidth();\r
+ CBC_AutoPtr<CBC_CommonBitArray> result(FX_NEW CBC_CommonBitArray(width));\r
+ InitArrays(width);\r
+ CFX_ByteArray *localLuminances = source->GetRow(y, m_luminance, e);\r
+ if (e != BCExceptionNO) {\r
+ return result.release();\r
+ }\r
+ CFX_Int32Array localBuckets;\r
+ localBuckets.Copy(m_buckets);\r
+ FX_INT32 x;\r
+ for (x = 0; x < width; x++) {\r
+ FX_INT32 pixel = (*localLuminances)[x] & 0xff;\r
+ localBuckets[pixel >> LUMINANCE_SHIFT]++;\r
+ }\r
+ FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);\r
+ if (e != BCExceptionNO) {\r
+ return result.release();\r
+ }\r
+ FX_INT32 left = (*localLuminances)[0] & 0xff;\r
+ FX_INT32 center = (*localLuminances)[1] & 0xff;\r
+ for (x = 1; x < width - 1; x++) {\r
+ FX_INT32 right = (*localLuminances)[x + 1] & 0xff;\r
+ FX_INT32 luminance = ((center << 2) - left - right) >> 1;\r
+ if (luminance < blackPoint) {\r
+ result->Set(x);\r
+ }\r
+ left = center;\r
+ center = right;\r
+ }\r
+ return result.release();\r
+}\r
+CBC_CommonBitMatrix *CBC_GlobalHistogramBinarizer::GetBlackMatrix(FX_INT32 &e)\r
+{\r
+ CBC_LuminanceSource *source = GetLuminanceSource();\r
+ FX_INT32 width = source->GetWidth();\r
+ FX_INT32 height = source->GetHeight();\r
+ CBC_CommonBitMatrix *BitMatrixTemp = FX_NEW CBC_CommonBitMatrix();\r
+ BitMatrixTemp->Init(width, height);\r
+ CBC_AutoPtr<CBC_CommonBitMatrix> matrix(BitMatrixTemp);\r
+ InitArrays(width);\r
+ CFX_Int32Array localBuckets;\r
+ localBuckets.Copy(m_buckets);\r
+ FX_INT32 y;\r
+ for (y = 1; y < 5; y++) {\r
+ FX_INT32 row = height * y / 5;\r
+ CFX_ByteArray *localLuminances = source->GetRow(row, m_luminance, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ FX_INT32 right = (width << 2) / 5;\r
+ FX_INT32 x;\r
+ for (x = width / 5; x < right; x++) {\r
+ FX_INT32 pixel = (*localLuminances)[x] & 0xff;\r
+ localBuckets[pixel >> LUMINANCE_SHIFT]++;\r
+ }\r
+ }\r
+ FX_INT32 blackPoint = EstimateBlackPoint(localBuckets, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CFX_ByteArray> localLuminances(source->GetMatrix());\r
+ for (y = 0; y < height; y++) {\r
+ FX_INT32 offset = y * width;\r
+ for (FX_INT32 x = 0; x < width; x++) {\r
+ FX_INT32 pixel = (*localLuminances)[offset + x] & 0xff;\r
+ if (pixel < blackPoint) {\r
+ matrix->Set(x, y);\r
+ }\r
+ }\r
+ }\r
+ return matrix.release();\r
+}\r
+void CBC_GlobalHistogramBinarizer::InitArrays(FX_INT32 luminanceSize)\r
+{\r
+ if(m_luminance.GetSize() < luminanceSize) {\r
+ m_luminance.SetSize(luminanceSize);\r
+ }\r
+ if(m_buckets.GetSize() <= 0) {\r
+ m_buckets.SetSize(LUMINANCE_BUCKETS);\r
+ } else {\r
+ FX_INT32 x;\r
+ for(x = 0; x < LUMINANCE_BUCKETS; x++) {\r
+ m_buckets[x] = 0;\r
+ }\r
+ }\r
+}\r
+FX_INT32 CBC_GlobalHistogramBinarizer::EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e)\r
+{\r
+ FX_INT32 numBuckets = buckets.GetSize();\r
+ FX_INT32 maxBucketCount = 0;\r
+ FX_INT32 firstPeak = 0;\r
+ FX_INT32 firstPeakSize = 0;\r
+ FX_INT32 x;\r
+ for (x = 0; x < numBuckets; x++) {\r
+ if (buckets[x] > firstPeakSize) {\r
+ firstPeak = x;\r
+ firstPeakSize = buckets[x];\r
+ }\r
+ if (buckets[x] > maxBucketCount) {\r
+ maxBucketCount = buckets[x];\r
+ }\r
+ }\r
+ FX_INT32 secondPeak = 0;\r
+ FX_INT32 secondPeakScore = 0;\r
+ for (x = 0; x < numBuckets; x++) {\r
+ FX_INT32 distanceToBiggest = x - firstPeak;\r
+ FX_INT32 score = buckets[x] * distanceToBiggest * distanceToBiggest;\r
+ if (score > secondPeakScore) {\r
+ secondPeak = x;\r
+ secondPeakScore = score;\r
+ }\r
+ }\r
+ if (firstPeak > secondPeak) {\r
+ FX_INT32 temp = firstPeak;\r
+ firstPeak = secondPeak;\r
+ secondPeak = temp;\r
+ }\r
+ if (secondPeak - firstPeak <= numBuckets >> 4) {\r
+ e = BCExceptionRead;\r
+ return 0;\r
+ }\r
+ FX_INT32 bestValley = secondPeak - 1;\r
+ FX_INT32 bestValleyScore = -1;\r
+ for (x = secondPeak - 1; x > firstPeak; x--) {\r
+ FX_INT32 fromFirst = x - firstPeak;\r
+ FX_INT32 score = fromFirst * fromFirst * (secondPeak - x) * (maxBucketCount - buckets[x]);\r
+ if (score > bestValleyScore) {\r
+ bestValley = x;\r
+ bestValleyScore = score;\r
+ }\r
+ }\r
+ return bestValley << LUMINANCE_SHIFT;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_GLOBALHISTOGRAMBINARIZER_H_\r
+#define _BC_GLOBALHISTOGRAMBINARIZER_H_\r
+class CBC_CommonBinarizer;\r
+class CBC_CommonBitArray;\r
+class CBC_CommonBitMatrix;\r
+class CBC_LuminanceSource;\r
+class CBC_GlobalHistogramBinarizer;\r
+class CBC_GlobalHistogramBinarizer : public CBC_Binarizer\r
+{\r
+public:\r
+ CBC_GlobalHistogramBinarizer(CBC_LuminanceSource *source);\r
+ virtual ~CBC_GlobalHistogramBinarizer();\r
+\r
+ void InitArrays(FX_INT32 luminanceSize);\r
+ CBC_CommonBitMatrix *GetBlackMatrix(FX_INT32 &e);\r
+ CBC_CommonBitArray *GetBlackRow(FX_INT32 y, CBC_CommonBitArray *row, FX_INT32 &e);\r
+ static FX_INT32 EstimateBlackPoint(CFX_Int32Array &buckets, FX_INT32 &e);\r
+private:\r
+ CFX_ByteArray m_luminance;\r
+ CFX_Int32Array m_buckets;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2010 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../barcode.h"\r
+#include "BC_WhiteRectangleDetector.h"\r
+#include "BC_CommonBitMatrix.h"\r
+#include "../BC_ResultPoint.h"\r
+const FX_INT32 CBC_WhiteRectangleDetector::INIT_SIZE = 30;\r
+const FX_INT32 CBC_WhiteRectangleDetector::CORR = 1;\r
+CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image)\r
+{\r
+ m_image = image;\r
+ m_height = image->GetHeight();\r
+ m_width = image->GetWidth();\r
+ m_leftInit = (m_width - INIT_SIZE) >> 1;\r
+ m_rightInit = (m_width + INIT_SIZE) >> 1;\r
+ m_upInit = (m_height - INIT_SIZE) >> 1;\r
+ m_downInit = (m_height + INIT_SIZE) >> 1;\r
+}\r
+void CBC_WhiteRectangleDetector::Init(FX_INT32 &e)\r
+{\r
+ if (m_upInit < 0 || m_leftInit < 0 || m_downInit >= m_height || m_rightInit >= m_width) {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ }\r
+}\r
+CBC_WhiteRectangleDetector::CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y)\r
+{\r
+ m_image = image;\r
+ m_height = image->GetHeight();\r
+ m_width = image->GetWidth();\r
+ FX_INT32 halfsize = initSize >> 1;\r
+ m_leftInit = x - halfsize;\r
+ m_rightInit = x + halfsize;\r
+ m_upInit = y - halfsize;\r
+ m_downInit = y + halfsize;\r
+}\r
+CBC_WhiteRectangleDetector::~CBC_WhiteRectangleDetector()\r
+{\r
+}\r
+CFX_PtrArray *CBC_WhiteRectangleDetector::Detect(FX_INT32 &e)\r
+{\r
+ FX_INT32 left = m_leftInit;\r
+ FX_INT32 right = m_rightInit;\r
+ FX_INT32 up = m_upInit;\r
+ FX_INT32 down = m_downInit;\r
+ FX_BOOL sizeExceeded = FALSE;\r
+ FX_BOOL aBlackPointFoundOnBorder = TRUE;\r
+ FX_BOOL atLeastOneBlackPointFoundOnBorder = FALSE;\r
+ while (aBlackPointFoundOnBorder) {\r
+ aBlackPointFoundOnBorder = FALSE;\r
+ FX_BOOL rightBorderNotWhite = TRUE;\r
+ while (rightBorderNotWhite && right < m_width) {\r
+ rightBorderNotWhite = ContainsBlackPoint(up, down, right, FALSE);\r
+ if (rightBorderNotWhite) {\r
+ right++;\r
+ aBlackPointFoundOnBorder = TRUE;\r
+ }\r
+ }\r
+ if (right >= m_width) {\r
+ sizeExceeded = TRUE;\r
+ break;\r
+ }\r
+ FX_BOOL bottomBorderNotWhite = TRUE;\r
+ while (bottomBorderNotWhite && down < m_height) {\r
+ bottomBorderNotWhite = ContainsBlackPoint(left, right, down, TRUE);\r
+ if (bottomBorderNotWhite) {\r
+ down++;\r
+ aBlackPointFoundOnBorder = TRUE;\r
+ }\r
+ }\r
+ if (down >= m_height) {\r
+ sizeExceeded = TRUE;\r
+ break;\r
+ }\r
+ FX_BOOL leftBorderNotWhite = TRUE;\r
+ while (leftBorderNotWhite && left >= 0) {\r
+ leftBorderNotWhite = ContainsBlackPoint(up, down, left, FALSE);\r
+ if (leftBorderNotWhite) {\r
+ left--;\r
+ aBlackPointFoundOnBorder = TRUE;\r
+ }\r
+ }\r
+ if (left < 0) {\r
+ sizeExceeded = TRUE;\r
+ break;\r
+ }\r
+ FX_BOOL topBorderNotWhite = TRUE;\r
+ while (topBorderNotWhite && up >= 0) {\r
+ topBorderNotWhite = ContainsBlackPoint(left, right, up, TRUE);\r
+ if (topBorderNotWhite) {\r
+ up--;\r
+ aBlackPointFoundOnBorder = TRUE;\r
+ }\r
+ }\r
+ if (up < 0) {\r
+ sizeExceeded = TRUE;\r
+ break;\r
+ }\r
+ if (aBlackPointFoundOnBorder) {\r
+ atLeastOneBlackPointFoundOnBorder = TRUE;\r
+ }\r
+ }\r
+ if (!sizeExceeded && atLeastOneBlackPointFoundOnBorder) {\r
+ FX_INT32 maxSize = right - left;\r
+ CBC_AutoPtr<CBC_ResultPoint> z(NULL);\r
+ for (FX_INT32 i = 1; i < maxSize; i++) {\r
+ z = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(down - i), (FX_FLOAT)(left + i), (FX_FLOAT)(down)) );\r
+ if (z.get() != NULL) {\r
+ break;\r
+ }\r
+ }\r
+ if (z.get() == NULL) {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ CBC_AutoPtr<CBC_ResultPoint> t(NULL);\r
+ for (FX_INT32 j = 1; j < maxSize; j++) {\r
+ t = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)left, (FX_FLOAT)(up + j), (FX_FLOAT)(left + j), (FX_FLOAT)up));\r
+ if (t.get() != NULL) {\r
+ break;\r
+ }\r
+ }\r
+ if (t.get() == NULL) {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ CBC_AutoPtr<CBC_ResultPoint> x(NULL);\r
+ for (FX_INT32 k = 1; k < maxSize; k++) {\r
+ x = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(up + k), (FX_FLOAT)(right - k), (FX_FLOAT)up));\r
+ if (x.get() != NULL) {\r
+ break;\r
+ }\r
+ }\r
+ if (x.get() == NULL) {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ CBC_AutoPtr<CBC_ResultPoint> y(NULL);\r
+ for (FX_INT32 m = 1; m < maxSize; m++) {\r
+ y = CBC_AutoPtr<CBC_ResultPoint>(GetBlackPointOnSegment((FX_FLOAT)right, (FX_FLOAT)(down - m), (FX_FLOAT)(right - m), (FX_FLOAT) down));\r
+ if (y.get() != NULL) {\r
+ break;\r
+ }\r
+ }\r
+ if (y.get() == NULL) {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ return CenterEdges(y.get(), z.get(), x.get(), t.get());\r
+ } else {\r
+ e = BCExceptionNotFound;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ return NULL;\r
+}\r
+FX_INT32 CBC_WhiteRectangleDetector::Round(FX_FLOAT d)\r
+{\r
+ return (FX_INT32) (d + 0.5f);\r
+}\r
+CBC_ResultPoint *CBC_WhiteRectangleDetector::GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)\r
+{\r
+ FX_INT32 dist = DistanceL2(aX, aY, bX, bY);\r
+ float xStep = (bX - aX) / dist;\r
+ float yStep = (bY - aY) / dist;\r
+ for (FX_INT32 i = 0; i < dist; i++) {\r
+ FX_INT32 x = Round(aX + i * xStep);\r
+ FX_INT32 y = Round(aY + i * yStep);\r
+ if (m_image->Get(x, y)) {\r
+ return FX_NEW CBC_ResultPoint((FX_FLOAT)x, (FX_FLOAT) y);\r
+ }\r
+ }\r
+ return NULL;\r
+}\r
+FX_INT32 CBC_WhiteRectangleDetector::DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY)\r
+{\r
+ float xDiff = aX - bX;\r
+ float yDiff = aY - bY;\r
+ return Round((float)sqrt(xDiff * xDiff + yDiff * yDiff));\r
+}\r
+CFX_PtrArray *CBC_WhiteRectangleDetector::CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z, CBC_ResultPoint *x, CBC_ResultPoint *t)\r
+{\r
+ float yi = y->GetX();\r
+ float yj = y->GetY();\r
+ float zi = z->GetX();\r
+ float zj = z->GetY();\r
+ float xi = x->GetX();\r
+ float xj = x->GetY();\r
+ float ti = t->GetX();\r
+ float tj = t->GetY();\r
+ if (yi < m_width / 2) {\r
+ CFX_PtrArray *result = FX_NEW CFX_PtrArray;\r
+ result->SetSize(4);\r
+ (*result)[0] = FX_NEW CBC_ResultPoint(ti - CORR, tj + CORR);\r
+ (*result)[1] = FX_NEW CBC_ResultPoint(zi + CORR, zj + CORR);\r
+ (*result)[2] = FX_NEW CBC_ResultPoint(xi - CORR, xj - CORR);\r
+ (*result)[3] = FX_NEW CBC_ResultPoint(yi + CORR, yj - CORR);\r
+ return result;\r
+ } else {\r
+ CFX_PtrArray *result = FX_NEW CFX_PtrArray;\r
+ result->SetSize(4);\r
+ (*result)[0] = FX_NEW CBC_ResultPoint(ti + CORR, tj + CORR);\r
+ (*result)[1] = FX_NEW CBC_ResultPoint(zi + CORR, zj - CORR);\r
+ (*result)[2] = FX_NEW CBC_ResultPoint(xi - CORR, xj + CORR);\r
+ (*result)[3] = FX_NEW CBC_ResultPoint(yi - CORR, yj - CORR);\r
+ return result;\r
+ }\r
+}\r
+FX_BOOL CBC_WhiteRectangleDetector::ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal)\r
+{\r
+ if (horizontal) {\r
+ for (FX_INT32 x = a; x <= b; x++) {\r
+ if (m_image->Get(x, fixed)) {\r
+ return TRUE;\r
+ }\r
+ }\r
+ } else {\r
+ for (FX_INT32 y = a; y <= b; y++) {\r
+ if (m_image->Get(fixed, y)) {\r
+ return TRUE;\r
+ }\r
+ }\r
+ }\r
+ return FALSE;\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_WHITERECTANLEDETECTOR_H_\r
+#define _BC_WHITERECTANLEDETECTOR_H_\r
+class CBC_CommonBitMatrix;\r
+class CBC_ResultPoint;\r
+class CBC_WhiteRectangleDetector;\r
+class CBC_WhiteRectangleDetector : public CFX_Object\r
+{\r
+public:\r
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image);\r
+ CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX_INT32 x, FX_INT32 y);\r
+ virtual ~CBC_WhiteRectangleDetector();\r
+ CFX_PtrArray *Detect(FX_INT32 &e);\r
+ virtual void Init(FX_INT32 &e);\r
+private:\r
+ FX_INT32 Round(float d);\r
+ CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);\r
+ FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY);\r
+ CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z,\r
+ CBC_ResultPoint *x, CBC_ResultPoint *t);\r
+ FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL horizontal);\r
+ const static FX_INT32 INIT_SIZE;\r
+ const static FX_INT32 CORR;\r
+\r
+ CBC_CommonBitMatrix *m_image;\r
+ FX_INT32 m_height;\r
+ FX_INT32 m_width;\r
+ FX_INT32 m_leftInit;\r
+ FX_INT32 m_rightInit;\r
+ FX_INT32 m_downInit;\r
+ FX_INT32 m_upInit;\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../../barcode.h"\r
+#include "BC_ReedSolomonGF256.h"\r
+#include "BC_ReedSolomonGF256Poly.h"\r
+#include "BC_ReedSolomon.h"\r
+CBC_ReedSolomonEncoder::CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256* field)\r
+{\r
+ m_field = field;\r
+}\r
+void CBC_ReedSolomonEncoder::Init()\r
+{\r
+ m_cachedGenerators.Add(FX_NEW CBC_ReedSolomonGF256Poly(m_field, 1));\r
+}\r
+CBC_ReedSolomonGF256Poly* CBC_ReedSolomonEncoder::BuildGenerator(FX_INT32 degree, FX_INT32 &e)\r
+{\r
+ if(degree >= m_cachedGenerators.GetSize()) {\r
+ CBC_ReedSolomonGF256Poly* lastGenerator = (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[m_cachedGenerators.GetSize() - 1]);\r
+ for(FX_INT32 d = m_cachedGenerators.GetSize(); d <= degree; d++) {\r
+ CFX_Int32Array temp;\r
+ temp.Add(1);\r
+ temp.Add(m_field->Exp(d - 1));\r
+ CBC_ReedSolomonGF256Poly temp_poly;\r
+ temp_poly.Init(m_field, &temp, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_ReedSolomonGF256Poly* nextGenerator = lastGenerator->Multiply(&temp_poly, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ m_cachedGenerators.Add(nextGenerator);\r
+ lastGenerator = nextGenerator;\r
+ }\r
+ }\r
+ return (CBC_ReedSolomonGF256Poly*)(m_cachedGenerators[degree]);\r
+}\r
+void CBC_ReedSolomonEncoder::Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e)\r
+{\r
+ if(ecBytes == 0) {\r
+ e = BCExceptionNoCorrectionBytes;\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ }\r
+ FX_INT32 dataBytes = toEncode->GetSize() - ecBytes;\r
+ if(dataBytes <= 0) {\r
+ e = BCExceptionNoDataBytesProvided;\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ }\r
+ CBC_ReedSolomonGF256Poly* generator = BuildGenerator(ecBytes, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CFX_Int32Array infoCoefficients;\r
+ infoCoefficients.SetSize(dataBytes);\r
+ for(FX_INT32 x = 0; x < dataBytes; x++) {\r
+ infoCoefficients[x] = toEncode->operator [](x);\r
+ }\r
+ CBC_ReedSolomonGF256Poly info;\r
+ info.Init(m_field, &infoCoefficients, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_ReedSolomonGF256Poly* rsg = info.MultiplyByMonomial(ecBytes, 1, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> infoTemp(rsg);\r
+ CFX_PtrArray *pa = infoTemp->Divide(generator, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CFX_PtrArray > temp(pa);\r
+ CBC_ReedSolomonGF256Poly* remainder = (CBC_ReedSolomonGF256Poly*)(temp->operator [](1));\r
+ CFX_Int32Array* coefficients = remainder->GetCoefficients();\r
+ FX_INT32 numZeroCoefficients = ecBytes - coefficients->GetSize();\r
+ for(FX_INT32 i = 0; i < numZeroCoefficients; i++) {\r
+ (*toEncode)[dataBytes + i] = 0;\r
+ }\r
+ for(FX_INT32 y = 0; y < coefficients->GetSize(); y++) {\r
+ (*toEncode)[dataBytes + numZeroCoefficients + y] =\r
+ coefficients->operator [](y);\r
+ }\r
+ for (FX_INT32 k = 0; k < temp->GetSize(); k++) {\r
+ delete (CBC_ReedSolomonGF256Poly*)(*temp)[k];\r
+ }\r
+}\r
+CBC_ReedSolomonEncoder::~CBC_ReedSolomonEncoder()\r
+{\r
+ for (FX_INT32 i = 0; i < m_cachedGenerators.GetSize(); i++) {\r
+ delete (CBC_ReedSolomonGF256Poly*)m_cachedGenerators[i];\r
+ }\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_READSOLOMON_H_\r
+#define _BC_READSOLOMON_H_\r
+class CBC_ReedSolomonGF256;\r
+class CBC_ReedSolomonGF256Poly;\r
+class CBC_ReedSolomonEncoder;\r
+class CBC_ReedSolomonEncoder : public CFX_Object\r
+{\r
+private:\r
+ CBC_ReedSolomonGF256* m_field;\r
+ CFX_PtrArray m_cachedGenerators;\r
+ CBC_ReedSolomonGF256Poly* BuildGenerator(FX_INT32 degree, FX_INT32 &e);\r
+public:\r
+ CBC_ReedSolomonEncoder(CBC_ReedSolomonGF256 * field);\r
+ virtual ~CBC_ReedSolomonEncoder();\r
+\r
+ void Encode(CFX_Int32Array *toEncode, FX_INT32 ecBytes, FX_INT32 &e);\r
+ virtual void Init();\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../../barcode.h"\r
+#include "BC_ReedSolomonGF256.h"\r
+#include "BC_ReedSolomonGF256Poly.h"\r
+#include "BC_ReedSolomonDecoder.h"\r
+CBC_ReedSolomonDecoder::CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256* field)\r
+{\r
+ m_field = field;\r
+}\r
+CBC_ReedSolomonDecoder::~CBC_ReedSolomonDecoder()\r
+{\r
+}\r
+void CBC_ReedSolomonDecoder::Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e)\r
+{\r
+ CBC_ReedSolomonGF256Poly poly;\r
+ poly.Init(m_field, received, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CFX_Int32Array syndromeCoefficients;\r
+ syndromeCoefficients.SetSize(twoS);\r
+ FX_BOOL dataMatrix = FALSE;\r
+ FX_BOOL noError = TRUE;\r
+ for (FX_INT32 i = 0; i < twoS; i++) {\r
+ FX_INT32 eval = poly.EvaluateAt(m_field->Exp(dataMatrix ? i + 1 : i));\r
+ syndromeCoefficients[twoS - 1 - i] = eval;\r
+ if (eval != 0) {\r
+ noError = FALSE;\r
+ }\r
+ }\r
+ if(noError) {\r
+ return;\r
+ }\r
+ CBC_ReedSolomonGF256Poly syndrome;\r
+ syndrome.Init(m_field, &syndromeCoefficients, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_ReedSolomonGF256Poly* rsg = m_field->BuildMonomial(twoS, 1, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp(rsg);\r
+ CFX_PtrArray* pa = RunEuclideanAlgorithm(temp.get(), &syndrome, twoS, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CFX_PtrArray > sigmaOmega(pa);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> sigma((CBC_ReedSolomonGF256Poly*)(*sigmaOmega)[0]);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> omega((CBC_ReedSolomonGF256Poly*)(*sigmaOmega)[1]);\r
+ CFX_Int32Array* ia1 = FindErrorLocations(sigma.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CFX_Int32Array > errorLocations(ia1);\r
+ CFX_Int32Array* ia2 = FindErrorMagnitudes(omega.get(), errorLocations.get(), dataMatrix, e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ CBC_AutoPtr<CFX_Int32Array > errorMagnitudes(ia2);\r
+ for (FX_INT32 k = 0; k < errorLocations->GetSize(); k++) {\r
+ FX_INT32 position = received->GetSize() - 1 - m_field->Log((*errorLocations)[k], e);\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ if(position < 0) {\r
+ e = BCExceptionBadErrorLocation;\r
+ BC_EXCEPTION_CHECK_ReturnVoid(e);\r
+ }\r
+ (*received)[position] = CBC_ReedSolomonGF256::AddOrSubtract((*received)[position], (*errorMagnitudes)[k]);\r
+ }\r
+}\r
+CFX_PtrArray *CBC_ReedSolomonDecoder::RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e)\r
+{\r
+ if (a->GetDegree() < b->GetDegree()) {\r
+ CBC_ReedSolomonGF256Poly* temp = a;\r
+ a = b;\r
+ b = temp;\r
+ }\r
+ CBC_ReedSolomonGF256Poly* rsg1 = a->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> rLast(rsg1);\r
+ CBC_ReedSolomonGF256Poly* rsg2 = b->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> r(rsg2);\r
+ CBC_ReedSolomonGF256Poly* rsg3 = m_field->GetOne()->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> sLast(rsg3);\r
+ CBC_ReedSolomonGF256Poly* rsg4 = m_field->GetZero()->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> s(rsg4);\r
+ CBC_ReedSolomonGF256Poly* rsg5 = m_field->GetZero()->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> tLast(rsg5);\r
+ CBC_ReedSolomonGF256Poly* rsg6 = m_field->GetOne()->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> t(rsg6);\r
+ while (r->GetDegree() >= R / 2) {\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> rLastLast = rLast;\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> sLastLast = sLast;\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> tLastlast = tLast;\r
+ rLast = r;\r
+ sLast = s;\r
+ tLast = t;\r
+ if (rLast->IsZero()) {\r
+ e = BCExceptionR_I_1IsZero;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ CBC_ReedSolomonGF256Poly* rsg7 = rLastLast->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> rTemp(rsg7);\r
+ r = rTemp;\r
+ CBC_ReedSolomonGF256Poly* rsg8 = m_field->GetZero()->Clone(e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> q(rsg8);\r
+ FX_INT32 denominatorLeadingTerm = rLast->GetCoefficients(rLast->GetDegree());\r
+ FX_INT32 dltInverse = m_field->Inverse(denominatorLeadingTerm, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ while (r->GetDegree() >= rLast->GetDegree() && !(r->IsZero())) {\r
+ FX_INT32 degreeDiff = r->GetDegree() - rLast->GetDegree();\r
+ FX_INT32 scale = m_field->Multiply(r->GetCoefficients(r->GetDegree()), dltInverse);\r
+ CBC_ReedSolomonGF256Poly* rsgp1 = m_field->BuildMonomial(degreeDiff, scale, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> build(rsgp1);\r
+ CBC_ReedSolomonGF256Poly* rsgp2 = q->AddOrSubtract(build.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp(rsgp2);\r
+ q = temp;\r
+ CBC_ReedSolomonGF256Poly* rsgp3 = rLast->MultiplyByMonomial(degreeDiff, scale, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> multiply(rsgp3);\r
+ CBC_ReedSolomonGF256Poly* rsgp4 = r->AddOrSubtract(multiply.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp3(rsgp4);\r
+ r = temp3;\r
+ }\r
+ CBC_ReedSolomonGF256Poly* rsg9 = q->Multiply(sLast.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp1(rsg9);\r
+ CBC_ReedSolomonGF256Poly* rsg10 = temp1->AddOrSubtract(sLastLast.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp2(rsg10);\r
+ s = temp2;\r
+ CBC_ReedSolomonGF256Poly* rsg11 = q->Multiply(tLast.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp5(rsg11);\r
+ CBC_ReedSolomonGF256Poly* rsg12 = temp5->AddOrSubtract(tLastlast.get(), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> temp6(rsg12);\r
+ t = temp6;\r
+ }\r
+ FX_INT32 sigmaTildeAtZero = t->GetCoefficients(0);\r
+ if (sigmaTildeAtZero == 0) {\r
+ e = BCExceptionIsZero;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ FX_INT32 inverse = m_field->Inverse(sigmaTildeAtZero, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_ReedSolomonGF256Poly* rsg13 = t->Multiply(inverse, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> sigma(rsg13);\r
+ CBC_ReedSolomonGF256Poly* rsg14 = r->Multiply(inverse, e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ CBC_AutoPtr<CBC_ReedSolomonGF256Poly> omega(rsg14);\r
+ CFX_PtrArray *temp = FX_NEW CFX_PtrArray;\r
+ temp->Add(sigma.release());\r
+ temp->Add(omega.release());\r
+ return temp;\r
+}\r
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e)\r
+{\r
+ FX_INT32 numErrors = errorLocator->GetDegree();\r
+ if (numErrors == 1) {\r
+ CBC_AutoPtr<CFX_Int32Array > temp(FX_NEW CFX_Int32Array);\r
+ temp->Add(errorLocator->GetCoefficients(1));\r
+ return temp.release();\r
+ }\r
+ CFX_Int32Array *tempT = FX_NEW CFX_Int32Array;\r
+ tempT->SetSize(numErrors);\r
+ CBC_AutoPtr<CFX_Int32Array > result(tempT);\r
+ FX_INT32 ie = 0;\r
+ for (FX_INT32 i = 1; i < 256 && ie < numErrors; i++) {\r
+ if(errorLocator->EvaluateAt(i) == 0) {\r
+ (*result)[ie] = m_field->Inverse(i, ie);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ ie++;\r
+ }\r
+ }\r
+ if (ie != numErrors) {\r
+ e = BCExceptionDegreeNotMatchRoots;\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ }\r
+ return result.release();\r
+}\r
+CFX_Int32Array *CBC_ReedSolomonDecoder::FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e)\r
+{\r
+ FX_INT32 s = errorLocations->GetSize();\r
+ CFX_Int32Array * temp = FX_NEW CFX_Int32Array;\r
+ temp->SetSize(s);\r
+ CBC_AutoPtr<CFX_Int32Array > result(temp);\r
+ for (FX_INT32 i = 0; i < s; i++) {\r
+ FX_INT32 xiInverse = m_field->Inverse(errorLocations->operator [](i), e);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ FX_INT32 denominator = 1;\r
+ for(FX_INT32 j = 0; j < s; j++) {\r
+ if(i != j) {\r
+ denominator = m_field->Multiply(denominator,\r
+ CBC_ReedSolomonGF256::AddOrSubtract(1, m_field->Multiply(errorLocations->operator [](j), xiInverse)));\r
+ }\r
+ }\r
+ FX_INT32 temp = m_field->Inverse(denominator, temp);\r
+ BC_EXCEPTION_CHECK_ReturnValue(e, NULL);\r
+ (*result)[i] = m_field->Multiply(errorEvaluator->EvaluateAt(xiInverse),\r
+ temp);\r
+ }\r
+ return result.release();\r
+}\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+\r
+#ifndef _BC_REEDSOLOMONDECODER_H_\r
+#define _BC_REEDSOLOMONDECODER_H_\r
+class CBC_ReedSolomonGF256;\r
+class CBC_ReedSolomonGF256Poly;\r
+class CBC_ReedSolomonDecoder;\r
+class CBC_ReedSolomonDecoder : public CFX_Object\r
+{\r
+private:\r
+ CBC_ReedSolomonGF256 * m_field;\r
+public:\r
+ CBC_ReedSolomonDecoder(CBC_ReedSolomonGF256 * field);\r
+ virtual ~CBC_ReedSolomonDecoder();\r
+ void Decode(CFX_Int32Array* received, FX_INT32 twoS, FX_INT32 &e);\r
+ CFX_PtrArray* RunEuclideanAlgorithm(CBC_ReedSolomonGF256Poly* a, CBC_ReedSolomonGF256Poly* b, FX_INT32 R, FX_INT32 &e);\r
+ CFX_Int32Array* FindErrorLocations(CBC_ReedSolomonGF256Poly* errorLocator, FX_INT32 &e);\r
+ CFX_Int32Array* FindErrorMagnitudes(CBC_ReedSolomonGF256Poly* errorEvaluator, CFX_Int32Array* errorLocations, FX_BOOL dataMatrix, FX_INT32 &e);\r
+};\r
+#endif\r
--- /dev/null
+// Copyright 2014 PDFium Authors. All rights reserved.\r
+// Use of this source code is governed by a BSD-style license that can be\r
+// found in the LICENSE file.\r
+\r
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
+// Original code is licensed as follows:\r
+/*\r
+ * Copyright 2007 ZXing authors\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "../../barcode.h"\r
+#include "BC_ReedSolomonGF256Poly.h"\r
+#include "BC_ReedSolomonGF256.h"\r
+CBC_ReedSolomonGF256 *CBC_ReedSolomonGF256::QRCodeFild = NULL;\r
+CBC_ReedSolomonGF256 *CBC_ReedSolomonGF256::DataMatrixField = NULL;\r
+void CBC_ReedSolomonGF256::Initialize()\r
+{\r
+ QRCodeFild = FX_NEW CBC_ReedSolomonGF256(0x011D);\r
+ QRCodeFild->Init();\r
+ DataMatrixField = FX_NEW CBC_ReedSolomonGF256(0x012D);\r
+ DataMatrixField->Init();\r
+}\r
+void CBC_ReedSolomonGF256::Finalize()\r
+{\r
+ if (QRCodeFild) {\r
+ delete QRCodeFild;\r
+ }\r
+ QRCodeFild = NULL;\r
+ if (DataMatrixField) {\r
+ delete DataMatrixField;\r
+ }\r
+ DataMatrixField = NULL;\r
+}\r
+CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(FX_INT32 primitive)\r
+{\r
+ FX_INT32 x = 1;\r
+ for(FX_INT32 j =