├── readme_rus.txt ├── arm-barcode-scanner ├── Project │ └── OV9655_Camera │ │ ├── EWARM │ │ ├── settings │ │ │ ├── Project.wspos │ │ │ ├── Project.dni │ │ │ ├── Project.cspy.bat │ │ │ └── Project.Discover-More.cspy.bat │ │ ├── Project.eww │ │ ├── stm32f4xx_flash.icf │ │ └── stm32f4xx_sram.icf │ │ ├── src │ │ ├── usb_com │ │ │ └── usbd_cdc_vcp.c │ │ ├── bigint │ │ │ ├── BigIntegerLibrary.hh │ │ │ ├── BigIntegerAlgorithms.hh │ │ │ ├── BigIntegerUtils.cc │ │ │ └── BigIntegerAlgorithms.cc │ │ ├── zxing │ │ │ ├── datamatrix │ │ │ │ ├── detector │ │ │ │ │ ├── DetectorException.cpp │ │ │ │ │ ├── DetectorException.h │ │ │ │ │ ├── CornerPoint.h │ │ │ │ │ └── CornerPoint.cpp │ │ │ │ ├── DataMatrixReader.h │ │ │ │ ├── decoder │ │ │ │ │ ├── DatamatrixDecoder.h │ │ │ │ │ ├── DatamatrixDataBlock.h │ │ │ │ │ └── DatamatrixBitMatrixParser.h │ │ │ │ └── DataMatrixReader.cpp │ │ │ ├── ResultPointCallback.cpp │ │ │ ├── oned │ │ │ │ ├── OneDResultPoint.cpp │ │ │ │ ├── OneDResultPoint.h │ │ │ │ ├── MultiFormatOneDReader.h │ │ │ │ ├── MultiFormatUPCEANReader.h │ │ │ │ ├── EAN8Reader.h │ │ │ │ ├── EAN13Reader.h │ │ │ │ ├── Code128Reader.h │ │ │ │ ├── UPCEReader.h │ │ │ │ ├── UPCAReader.h │ │ │ │ ├── CodaBarReader.h │ │ │ │ ├── Code93Reader.h │ │ │ │ ├── Code39Reader.h │ │ │ │ ├── ITFReader.h │ │ │ │ └── EAN8Reader.cpp │ │ │ ├── Reader.cpp │ │ │ ├── common │ │ │ │ ├── reedsolomon │ │ │ │ │ ├── ReedSolomonException.cpp │ │ │ │ │ ├── ReedSolomonException.h │ │ │ │ │ ├── ReedSolomonDecoder.h │ │ │ │ │ └── GenericGFPoly.h │ │ │ │ ├── BitArrayIO.cpp │ │ │ │ ├── IllegalArgumentException.cpp │ │ │ │ ├── IllegalArgumentException.h │ │ │ │ ├── detector │ │ │ │ │ ├── JavaMath.h │ │ │ │ │ ├── MathUtils.h │ │ │ │ │ ├── WhiteRectangleDetector.h │ │ │ │ │ └── MonochromeRectangleDetector.h │ │ │ │ ├── DetectorResult.cpp │ │ │ │ ├── Point.h │ │ │ │ ├── DetectorResult.h │ │ │ │ ├── FastHybridBinarizer.h │ │ │ │ ├── DecoderResult.cpp │ │ │ │ ├── DecoderResult.h │ │ │ │ ├── GreyscaleRotatedLuminanceSource.h │ │ │ │ ├── Str.h │ │ │ │ ├── StringUtils.h │ │ │ │ ├── GreyscaleLuminanceSource.h │ │ │ │ ├── CharacterSetECI.h │ │ │ │ ├── GlobalHistogramBinarizer.h │ │ │ │ ├── Str.cpp │ │ │ │ ├── GridSampler.h │ │ │ │ ├── HybridBinarizer.h │ │ │ │ └── PerspectiveTransform.h │ │ │ ├── multi │ │ │ │ ├── MultipleBarcodeReader.cpp │ │ │ │ ├── qrcode │ │ │ │ │ ├── detector │ │ │ │ │ │ ├── MultiDetector.h │ │ │ │ │ │ ├── MultiDetector.cpp │ │ │ │ │ │ └── MultiFinderPatternFinder.h │ │ │ │ │ └── QRCodeMultiReader.h │ │ │ │ ├── ByQuadrantReader.h │ │ │ │ ├── MultipleBarcodeReader.h │ │ │ │ └── GenericMultipleBarcodeReader.h │ │ │ ├── BarcodeFormat.cpp │ │ │ ├── FormatException.h │ │ │ ├── ResultIO.cpp │ │ │ ├── ChecksumException.cpp │ │ │ ├── ChecksumException.h │ │ │ ├── Reader.h │ │ │ ├── ResultPointCallback.h │ │ │ ├── NotFoundException.h │ │ │ ├── ReaderException.h │ │ │ ├── IllegalStateException.h │ │ │ ├── FormatException.cpp │ │ │ ├── Exception.cpp │ │ │ ├── qrcode │ │ │ │ ├── decoder │ │ │ │ │ ├── Decoder.h │ │ │ │ │ ├── DataMask.h │ │ │ │ │ ├── DataBlock.h │ │ │ │ │ ├── BitMatrixParser.h │ │ │ │ │ └── Mode.h │ │ │ │ ├── detector │ │ │ │ │ ├── FinderPatternInfo.cpp │ │ │ │ │ ├── AlignmentPattern.h │ │ │ │ │ ├── FinderPatternInfo.h │ │ │ │ │ ├── FinderPattern.h │ │ │ │ │ └── AlignmentPattern.cpp │ │ │ │ ├── QRCodeReader.h │ │ │ │ ├── ErrorCorrectionLevel.h │ │ │ │ ├── QRCodeReader.cpp │ │ │ │ ├── FormatInformation.h │ │ │ │ └── ErrorCorrectionLevel.cpp │ │ │ ├── Binarizer.cpp │ │ │ ├── aztec │ │ │ │ ├── AztecDetectorResult.h │ │ │ │ ├── AztecReader.h │ │ │ │ ├── AztecDetectorResult.cpp │ │ │ │ ├── decoder │ │ │ │ │ └── AztecDecoder.h │ │ │ │ └── AztecReader.cpp │ │ │ ├── MultiFormatReader.h │ │ │ ├── Binarizer.h │ │ │ ├── pdf417 │ │ │ │ ├── PDF417Reader.h │ │ │ │ └── decoder │ │ │ │ │ ├── ec │ │ │ │ │ ├── ModulusGF.h │ │ │ │ │ └── ModulusPoly.h │ │ │ │ │ └── Pdf417Decoder.h │ │ │ ├── InvertedLuminanceSource.h │ │ │ ├── BinaryBitmap.h │ │ │ ├── Exception.h │ │ │ ├── BarcodeFormat.h │ │ │ ├── Result.h │ │ │ ├── ResultPoint.h │ │ │ ├── Result.cpp │ │ │ └── LuminanceSource.h │ │ ├── ImageReaderSource.h │ │ └── ImageReaderSource.cpp │ │ └── inc │ │ └── bmp.h ├── Utilities │ ├── fat_fs │ │ ├── inc │ │ │ ├── fattime.h │ │ │ ├── integer.h │ │ │ └── diskio.h │ │ └── src │ │ │ └── fattime.c │ ├── Binary │ │ └── Media │ │ │ ├── STM3210E-1.bmp │ │ │ ├── STM3210E-2.bmp │ │ │ ├── STM32IMAGE.bmp │ │ │ └── STLOGOIMAGE.bmp │ ├── PC_Software │ │ ├── DfuSe_Demo_V3.0.2 │ │ │ └── DfuSe USB device firmware upgrade user manual.pdf │ │ └── stm32_vcp │ │ │ ├── readme.txt │ │ │ └── version.txt │ ├── FatFs_vR0.08a │ │ └── integer.h │ └── STM32F4-Discovery │ │ └── stm32f4_discovery_debug.h └── Libraries │ ├── CMSIS │ ├── index.htm │ ├── Documentation │ │ ├── CMSIS_Core.htm │ │ ├── CMSIS_History.htm │ │ ├── CMSIS_CM4_SIMD.htm │ │ ├── CMSIS_DebugSupport.htm │ │ ├── CMSIS_Logo_Final.jpg │ │ └── CMSIS_System_View_Description.htm │ ├── CMSIS END USER LICENCE AGREEMENT.pdf │ ├── Device │ │ └── ST │ │ │ └── STM32F4xx │ │ │ └── Include │ │ │ └── stm32f4xx.h │ ├── Include │ │ └── arm_common_tables.h │ └── README.txt │ ├── STM32F4xx_StdPeriph_Driver │ ├── Release_Notes.html │ └── src │ │ ├── stm32f4xx_rcc.c │ │ └── stm32f4xx_flash.c │ └── STM32_USB_Device_Library │ └── Class │ ├── cdc │ └── inc │ │ └── usbd_cdc_if_template.h │ └── dfu │ └── inc │ └── usbd_otp_if.h └── README.md /readme_rus.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/readme_rus.txt -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/settings/Project.wspos: -------------------------------------------------------------------------------- 1 | [MainWindow] 2 | WindowPlacement=_ 185 152 1477 836 2 3 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/fat_fs/inc/fattime.h: -------------------------------------------------------------------------------- 1 | #ifndef FATTIME_H_ 2 | 3 | #include "integer.h" 4 | 5 | DWORD get_fattime(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/index.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/index.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/Binary/Media/STM3210E-1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Utilities/Binary/Media/STM3210E-1.bmp -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/Binary/Media/STM3210E-2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Utilities/Binary/Media/STM3210E-2.bmp -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/Binary/Media/STM32IMAGE.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Utilities/Binary/Media/STM32IMAGE.bmp -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/Binary/Media/STLOGOIMAGE.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Utilities/Binary/Media/STLOGOIMAGE.bmp -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_History.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_History.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_CM4_SIMD.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_CM4_SIMD.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/usb_com/usbd_cdc_vcp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Project/OV9655_Camera/src/usb_com/usbd_cdc_vcp.c -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_DebugSupport.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_DebugSupport.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_Logo_Final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_Logo_Final.jpg -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/fat_fs/src/fattime.c: -------------------------------------------------------------------------------- 1 | 2 | #include "integer.h" 3 | #include "fattime.h" 4 | //#include "rtc.h" //RPi 5 | 6 | DWORD get_fattime(void) { 7 | return 0; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_flash.c -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_System_View_Description.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Libraries/CMSIS/Documentation/CMSIS_System_View_Description.htm -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/Project.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Project.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/PC_Software/DfuSe_Demo_V3.0.2/DfuSe USB device firmware upgrade user manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tachcard/arm-barcode-scanner/HEAD/arm-barcode-scanner/Utilities/PC_Software/DfuSe_Demo_V3.0.2/DfuSe USB device firmware upgrade user manual.pdf -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/bigint/BigIntegerLibrary.hh: -------------------------------------------------------------------------------- 1 | // This header file includes all of the library header files. 2 | 3 | #include "NumberlikeArray.hh" 4 | #include "BigUnsigned.hh" 5 | #include "BigInteger.hh" 6 | #include "BigIntegerAlgorithms.hh" 7 | #include "BigUnsignedInABase.hh" 8 | #include "BigIntegerUtils.hh" 9 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/detector/DetectorException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DetectorException.cpp 3 | * 4 | * Created on: Aug 26, 2011 5 | * Author: luiz 6 | */ 7 | 8 | #include "DetectorException.h" 9 | 10 | namespace zxing { 11 | namespace datamatrix { 12 | 13 | DetectorException::DetectorException(const char *msg) : 14 | Exception(msg) { 15 | 16 | } 17 | 18 | DetectorException::~DetectorException() throw () { 19 | // TODO Auto-generated destructor stub 20 | } 21 | 22 | } 23 | } /* namespace zxing */ 24 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/detector/DetectorException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DetectorException.h 3 | * 4 | * Created on: Aug 26, 2011 5 | * Author: luiz 6 | */ 7 | 8 | #ifndef DETECTOREXCEPTION_H_ 9 | #define DETECTOREXCEPTION_H_ 10 | 11 | #include 12 | 13 | namespace zxing { 14 | namespace datamatrix { 15 | 16 | class DetectorException: public Exception { 17 | public: 18 | DetectorException(const char *msg); 19 | virtual ~DetectorException() throw (); 20 | }; 21 | } /* namespace nexxera */ 22 | } /* namespace zxing */ 23 | #endif /* DETECTOREXCEPTION_H_ */ 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | arm-barcode-scanner 2 | =================== 3 | 4 | qr barcode scanner for ARM 5 | 6 | project works for the controller STM32F407VG. 7 | 8 | This code is based on the ZXing library. See https://code.google.com/p/zxing/ for 9 | more information. 10 | 11 | Hardware requirements 12 | ===================== 13 | The main board is the STM32F4 discovery kit. 14 | See http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF252419 for more information. 15 | 16 | Running in IAR Embedded Workbench 17 | ================================= 18 | 1. Open the project: arm-barcode-scanner\Project\OV9655_Camera\EWARM\Project.eww 19 | 2. Recompile the project: Project -> Rebuild all 20 | 3. Run the debugging: Project -> Download and debug (CTRL + D) 21 | 4. Run the program: Debug -> Go (F5) 22 | 23 | video work 24 | https://vimeo.com/120055682 25 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ResultPointCallback.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ResultPointCallback.cpp 3 | * zxing 4 | * 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | namespace zxing { 23 | 24 | ResultPointCallback::~ResultPointCallback() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/bigint/BigIntegerAlgorithms.hh: -------------------------------------------------------------------------------- 1 | #ifndef BIGINTEGERALGORITHMS_H 2 | #define BIGINTEGERALGORITHMS_H 3 | 4 | #include "BigInteger.hh" 5 | 6 | /* Some mathematical algorithms for big integers. 7 | * This code is new and, as such, experimental. */ 8 | 9 | // Returns the greatest common divisor of a and b. 10 | BigUnsigned gcd(BigUnsigned a, BigUnsigned b); 11 | 12 | /* Extended Euclidean algorithm. 13 | * Given m and n, finds gcd g and numbers r, s such that r*m + s*n == g. */ 14 | void extendedEuclidean(BigInteger m, BigInteger n, BigInteger &g, BigInteger &r, 15 | BigInteger &s); 16 | 17 | /* Returns the multiplicative inverse of x modulo n, or throws an exception if 18 | * they have a common factor. */ 19 | BigUnsigned modinv(const BigInteger &x, const BigUnsigned &n); 20 | 21 | // Returns (base ^ exponent) % modulus. 22 | BigUnsigned modexp(const BigInteger &base, const BigUnsigned &exponent, 23 | const BigUnsigned &modulus); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/OneDResultPoint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OneDResultPoint.cpp 3 | * ZXing 4 | * 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include "OneDResultPoint.h" 21 | 22 | namespace zxing { 23 | namespace oned { 24 | 25 | OneDResultPoint::OneDResultPoint(float posX, float posY) : 26 | ResultPoint(posX, posY) { 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/FatFs_vR0.08a/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _INTEGER 6 | #define _INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | 13 | #else /* Embedded platform */ 14 | 15 | /* These types must be 16-bit, 32-bit or larger integer */ 16 | typedef int INT; 17 | typedef unsigned int UINT; 18 | 19 | /* These types must be 8-bit integer */ 20 | typedef char CHAR; 21 | typedef unsigned char UCHAR; 22 | typedef unsigned char BYTE; 23 | 24 | /* These types must be 16-bit integer */ 25 | typedef short SHORT; 26 | typedef unsigned short USHORT; 27 | typedef unsigned short WORD; 28 | typedef unsigned short WCHAR; 29 | 30 | /* These types must be 32-bit integer */ 31 | typedef long LONG; 32 | typedef unsigned long ULONG; 33 | typedef unsigned long DWORD; 34 | 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Reader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Reader.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 13/05/2008. 6 | * Copyright 2008 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | 25 | Reader::~Reader() { 26 | } 27 | 28 | Ref Reader::decode(Ref image) { 29 | return decode(image, DecodeHints::DEFAULT_HINT); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/OneDResultPoint.h: -------------------------------------------------------------------------------- 1 | #ifndef __ONED_RESULT_POINT_H__ 2 | #define __ONED_RESULT_POINT_H__ 3 | /* 4 | * OneDResultPoint.h 5 | * ZXing 6 | * 7 | * Copyright 2010 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class OneDResultPoint: public ResultPoint { 28 | 29 | public: 30 | OneDResultPoint(float posX, float posY); 31 | }; 32 | } 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/reedsolomon/ReedSolomonException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ReedSolomonException.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 06/05/2008. 6 | * Copyright 2008 Google UK. All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | ReedSolomonException::ReedSolomonException(const char *msg) throw () : 25 | Exception(msg) { 26 | } 27 | ReedSolomonException::~ReedSolomonException() throw () { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/fat_fs/inc/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _INTEGER 6 | 7 | #if 0 8 | #include 9 | #else 10 | 11 | #include "usb_conf.h" 12 | 13 | /* These types must be 16-bit, 32-bit or larger integer */ 14 | typedef int INT; 15 | typedef unsigned int UINT; 16 | 17 | /* These types must be 8-bit integer */ 18 | typedef signed char CHAR; 19 | typedef unsigned char UCHAR; 20 | typedef unsigned char BYTE; 21 | 22 | /* These types must be 16-bit integer */ 23 | typedef short SHORT; 24 | typedef unsigned short USHORT; 25 | typedef unsigned short WORD; 26 | typedef unsigned short WCHAR; 27 | 28 | /* These types must be 32-bit integer */ 29 | typedef long LONG; 30 | typedef unsigned long ULONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* Boolean type */ 34 | // typedef enum { FALSE = 0, TRUE } BOOL; 35 | #include 36 | typedef bool BOOL; 37 | #ifndef FALSE 38 | #define FALSE false 39 | #define TRUE true 40 | #endif 41 | 42 | #endif 43 | 44 | #define _INTEGER 45 | #endif 46 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/MultipleBarcodeReader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 ZXing authors All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | namespace zxing { 20 | namespace multi { 21 | 22 | MultipleBarcodeReader::~MultipleBarcodeReader() { 23 | } 24 | 25 | std::vector > MultipleBarcodeReader::decodeMultiple( 26 | Ref image) { 27 | return decodeMultiple(image, DecodeHints::DEFAULT_HINT); 28 | } 29 | 30 | } // End zxing::multi namespace 31 | } // End zxing namespace 32 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/BitArrayIO.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Copyright 2010 ZXing authors. All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include 19 | 20 | using zxing::BitArray; 21 | using std::ostream; 22 | 23 | ostream& zxing::operator <<(ostream& os, BitArray const& ba) { 24 | for (int i = 0, size = ba.getSize(); i < size; i++) { 25 | if ((i & 0x07) == 0) { 26 | os << ' '; 27 | } 28 | os << (ba.get(i) ? 'X' : '.'); 29 | } 30 | return os; 31 | } 32 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/BarcodeFormat.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Created by Christian Brunschen on 13/05/2008. 4 | * Copyright 2008 ZXing authors All rights reserved. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include 20 | 21 | const char* zxing::BarcodeFormat::barcodeFormatNames[] = { 0, "AZTEC", 22 | "CODABAR", "CODE_39", "CODE_93", "CODE_128", "DATA_MATRIX", "EAN_8", 23 | "EAN_13", "ITF", "MAXICODE", "PDF_417", "QR_CODE", "RSS_14", 24 | "RSS_EXPANDED", "UPC_A", "UPC_E", "UPC_EAN_EXTENSION" }; 25 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/reedsolomon/ReedSolomonException.h: -------------------------------------------------------------------------------- 1 | #ifndef __REED_SOLOMON_EXCEPTION_H__ 2 | #define __REED_SOLOMON_EXCEPTION_H__ 3 | 4 | /* 5 | * ReedSolomonException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | class ReedSolomonException: public Exception { 27 | public: 28 | ReedSolomonException(const char *msg) throw (); 29 | ~ReedSolomonException() throw (); 30 | }; 31 | } 32 | 33 | #endif // __REED_SOLOMON_EXCEPTION_H__ 34 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/FormatException.h: -------------------------------------------------------------------------------- 1 | #ifndef __FORMAT_EXCEPTION_H__ 2 | #define __FORMAT_EXCEPTION_H__ 3 | 4 | /* 5 | * FormatException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class FormatException: public ReaderException { 28 | public: 29 | FormatException(); 30 | FormatException(const char *msg); 31 | ~FormatException() throw (); 32 | 33 | static FormatException const& getFormatInstance(); 34 | }; 35 | 36 | } 37 | #endif // __FORMAT_EXCEPTION_H__ 38 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ResultIO.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * ResultIO.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::Result; 25 | using std::ostream; 26 | 27 | ostream& zxing::operator<<(ostream &out, Result& result) { 28 | if (result.text_ != 0) { 29 | out << result.text_->getText(); 30 | } else { 31 | out << "[" << result.rawBytes_->size() << " bytes]"; 32 | } 33 | return out; 34 | } 35 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ChecksumException.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * ChecksumException.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::ChecksumException; 25 | 26 | ChecksumException::ChecksumException() throw () { 27 | } 28 | ChecksumException::ChecksumException(const char *msg) throw () : 29 | ReaderException(msg) { 30 | } 31 | ChecksumException::~ChecksumException() throw () { 32 | } 33 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/IllegalArgumentException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * IllegalArgumentException.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 06/05/2008. 6 | * Copyright 2008 Google UK. All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | using zxing::IllegalArgumentException; 24 | 25 | IllegalArgumentException::IllegalArgumentException() : 26 | Exception() { 27 | } 28 | IllegalArgumentException::IllegalArgumentException(const char *msg) : 29 | Exception(msg) { 30 | } 31 | IllegalArgumentException::~IllegalArgumentException() throw () { 32 | } 33 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ChecksumException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __CHECKSUM_EXCEPTION_H__ 4 | #define __NOT_FOUND_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | class ChecksumException: public ReaderException { 26 | typedef ReaderException Base; 27 | public: 28 | ChecksumException() throw (); 29 | ChecksumException(const char *msg) throw (); 30 | ~ChecksumException() throw (); 31 | }; 32 | } 33 | 34 | #endif // __CHECKSUM_EXCEPTION_H__ 35 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/IllegalArgumentException.h: -------------------------------------------------------------------------------- 1 | #ifndef __ILLEGAL_ARGUMENT_EXCEPTION_H__ 2 | #define __ILLEGAL_ARGUMENT_EXCEPTION_H__ 3 | 4 | /* 5 | * IllegalArgumentException.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class IllegalArgumentException: public Exception { 28 | public: 29 | IllegalArgumentException(); 30 | IllegalArgumentException(const char *msg); 31 | ~IllegalArgumentException() throw (); 32 | }; 33 | 34 | } 35 | 36 | #endif // __ILLEGAL_ARGUMENT_EXCEPTION_H__ 37 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/MultiFormatOneDReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FORMAT_ONED_READER_H__ 2 | #define __MULTI_FORMAT_ONED_READER_H__ 3 | /* 4 | * MultiFormatOneDReader.h 5 | * ZXing 6 | * 7 | * Copyright 2010 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | class MultiFormatOneDReader: public OneDReader { 27 | 28 | private: 29 | std::vector > readers; 30 | public: 31 | MultiFormatOneDReader(DecodeHints hints); 32 | 33 | Ref decodeRow(int rowNumber, Ref row); 34 | }; 35 | } 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Reader.h: -------------------------------------------------------------------------------- 1 | #ifndef __READER_H__ 2 | #define __READER_H__ 3 | 4 | /* 5 | * Reader.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class Reader: public Counted { 30 | protected: 31 | Reader() { 32 | } 33 | public: 34 | virtual Ref decode(Ref image); 35 | virtual Ref decode(Ref image, DecodeHints hints) = 0; 36 | virtual ~Reader(); 37 | }; 38 | 39 | } 40 | 41 | #endif // __READER_H__ 42 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ResultPointCallback.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESULT_POINT_CALLBACK_H__ 2 | #define __RESULT_POINT_CALLBACK_H__ 3 | 4 | /* 5 | * ResultPointCallback.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class ResultPoint; 28 | 29 | class ResultPointCallback: public Counted { 30 | protected: 31 | ResultPointCallback() { 32 | } 33 | public: 34 | virtual void foundPossibleResultPoint(ResultPoint const& point) = 0; 35 | virtual ~ResultPointCallback(); 36 | }; 37 | 38 | } 39 | 40 | #endif // __RESULT_POINT_CALLBACK_H__ 41 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern uint16_t armBitRevTable[256]; 30 | extern q15_t armRecipTableQ15[64]; 31 | extern q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | 35 | #endif /* ARM_COMMON_TABLES_H */ 36 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/NotFoundException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __NOT_FOUND_EXCEPTION_H__ 4 | #define __NOT_FOUND_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | class NotFoundException: public ReaderException { 27 | public: 28 | NotFoundException() throw () { 29 | } 30 | NotFoundException(const char *msg) throw () : 31 | ReaderException(msg) { 32 | } 33 | ~NotFoundException() throw () { 34 | } 35 | }; 36 | 37 | } 38 | 39 | #endif // __NOT_FOUND_EXCEPTION_H__ 40 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/detector/JavaMath.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __ZXING_COMMON_DETECTOR_MATH_H__ 3 | #define __ZXING_COMMON_DETECTOR_MATH_H__ 4 | /* 5 | * Copyright 2012 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | namespace zxing { 23 | namespace common { 24 | namespace detector { 25 | 26 | class Math { 27 | private: 28 | Math(); 29 | ~Math(); 30 | public: 31 | 32 | // Java standard Math.round 33 | static inline int round(float a) { 34 | return (int) std::floor(a + 0.5f); 35 | } 36 | 37 | }; 38 | 39 | } 40 | } 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/qrcode/detector/MultiDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_DETECTOR_H__ 2 | #define __MULTI_DETECTOR_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace multi { 26 | 27 | class MultiDetector: public zxing::qrcode::Detector { 28 | public: 29 | MultiDetector(Ref image); 30 | virtual ~MultiDetector(); 31 | virtual std::vector > detectMulti(DecodeHints hints); 32 | }; 33 | 34 | } 35 | } 36 | 37 | #endif // __MULTI_DETECTOR_H__ 38 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ReaderException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __READER_EXCEPTION_H__ 3 | #define __READER_EXCEPTION_H__ 4 | 5 | /* 6 | * ReaderException.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | 26 | namespace zxing { 27 | 28 | class ReaderException: public Exception { 29 | public: 30 | ReaderException() throw () { 31 | } 32 | ReaderException(char const* msg) throw () : 33 | Exception(msg) { 34 | } 35 | ~ReaderException() throw () { 36 | } 37 | }; 38 | 39 | } 40 | 41 | #endif // __READER_EXCEPTION_H__ 42 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/IllegalStateException.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __ILLEGAL_STATE_EXCEPTION_H__ 4 | #define __ILLEGAL_STATE_EXCEPTION_H__ 5 | 6 | /* 7 | * Copyright 20011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may illegal use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | class IllegalStateException: public ReaderException { 27 | public: 28 | IllegalStateException() throw () { 29 | } 30 | IllegalStateException(const char *msg) throw () : 31 | ReaderException(msg) { 32 | } 33 | ~IllegalStateException() throw () { 34 | } 35 | }; 36 | 37 | } 38 | 39 | #endif // __ILLEGAL_STATE_EXCEPTION_H__ 40 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/DetectorResult.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * DetectorResult.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 14/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | DetectorResult::DetectorResult(Ref bits, 27 | ArrayRef > points) : 28 | bits_(bits), points_(points) { 29 | } 30 | 31 | Ref DetectorResult::getBits() { 32 | return bits_; 33 | } 34 | 35 | ArrayRef > DetectorResult::getPoints() { 36 | return points_; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/detector/CornerPoint.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORNER_FINDER_H__ 2 | #define __CORNER_FINDER_H__ 3 | 4 | /* 5 | * CornerPoint.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace datamatrix { 29 | 30 | class CornerPoint: public ResultPoint { 31 | private: 32 | int counter_; 33 | 34 | public: 35 | CornerPoint(float posX, float posY); 36 | int getCount() const; 37 | void incrementCount(); 38 | bool equals(Ref other) const; 39 | }; 40 | } 41 | } 42 | 43 | #endif // __CORNER_FINDER_H__ 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/FormatException.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * FormatException.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | namespace zxing { 25 | 26 | FormatException::FormatException() { 27 | } 28 | 29 | FormatException::FormatException(const char *msg) : 30 | ReaderException(msg) { 31 | } 32 | 33 | FormatException::~FormatException() throw () { 34 | } 35 | 36 | FormatException const& 37 | FormatException::getFormatInstance() { 38 | static FormatException instance; 39 | return instance; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Exception.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Exception.cpp 4 | * ZXing 5 | * 6 | * Created by Christian Brunschen on 03/06/2008. 7 | * Copyright 2008-2011 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | using zxing::Exception; 28 | 29 | void Exception::deleteMessage() { 30 | delete[] message; 31 | } 32 | 33 | char const* Exception::copy(char const* msg) { 34 | char* message = 0; 35 | if (msg) { 36 | int l = strlen(msg) + 1; 37 | if (l) { 38 | message = new char[l]; 39 | strcpy(message, msg); 40 | } 41 | } 42 | return message; 43 | } 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/qrcode/QRCodeMultiReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __QRCODE_MULTI_READER_H__ 2 | #define __QRCODE_MULTI_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | namespace zxing { 24 | namespace multi { 25 | 26 | class QRCodeMultiReader: public zxing::qrcode::QRCodeReader, 27 | public MultipleBarcodeReader { 28 | public: 29 | QRCodeMultiReader(); 30 | virtual ~QRCodeMultiReader(); 31 | virtual std::vector > decodeMultiple(Ref image, 32 | DecodeHints hints); 33 | }; 34 | 35 | } 36 | } 37 | 38 | #endif // __QRCODE_MULTI_READER_H__ 39 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/MultiFormatUPCEANReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __MULTI_FORMAT_UPC_EAN_READER_H__ 3 | #define __MULTI_FORMAT_UPC_EAN_READER_H__ 4 | /* 5 | * MultiFormatUPCEANReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | namespace oned { 27 | 28 | class UPCEANReader; 29 | 30 | class MultiFormatUPCEANReader: public OneDReader { 31 | private: 32 | std::vector > readers; 33 | public: 34 | MultiFormatUPCEANReader(DecodeHints hints); 35 | Ref decodeRow(int rowNumber, Ref row); 36 | }; 37 | 38 | } 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/Point.h: -------------------------------------------------------------------------------- 1 | #ifndef __POINT_H__ 2 | #define __POINT_H__ 3 | 4 | /* 5 | * Point.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | namespace zxing { 24 | class PointI { 25 | public: 26 | int x; 27 | int y; 28 | }; 29 | 30 | class Point { 31 | public: 32 | Point() : 33 | x(0.0f), y(0.0f) { 34 | } 35 | ; 36 | Point(float x_, float y_) : 37 | x(x_), y(y_) { 38 | } 39 | ; 40 | 41 | float x; 42 | float y; 43 | }; 44 | 45 | class Line { 46 | public: 47 | Line(Point start_, Point end_) : 48 | start(start_), end(end_) { 49 | } 50 | ; 51 | 52 | Point start; 53 | Point end; 54 | }; 55 | } 56 | #endif // POINT_H_ 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/detector/CornerPoint.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * CornerPoint.cpp 3 | * zxing 4 | * 5 | * Created by Luiz Silva on 09/02/2010. 6 | * Copyright 2010 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | namespace datamatrix { 25 | 26 | using namespace std; 27 | 28 | CornerPoint::CornerPoint(float posX, float posY) : 29 | ResultPoint(posX, posY), counter_(0) { 30 | } 31 | 32 | int CornerPoint::getCount() const { 33 | return counter_; 34 | } 35 | 36 | void CornerPoint::incrementCount() { 37 | counter_++; 38 | } 39 | 40 | bool CornerPoint::equals(Ref other) const { 41 | return posX_ == other->getX() && posY_ == other->getY(); 42 | } 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/ByQuadrantReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __BY_QUADRANT_READER_H__ 2 | #define __BY_QUADRANT_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace zxing { 26 | namespace multi { 27 | 28 | class ByQuadrantReader: public Reader { 29 | private: 30 | Reader& delegate_; 31 | 32 | public: 33 | ByQuadrantReader(Reader& delegate); 34 | virtual ~ByQuadrantReader(); 35 | virtual Ref decode(Ref image); 36 | virtual Ref decode(Ref image, DecodeHints hints); 37 | }; 38 | 39 | } 40 | } 41 | 42 | #endif // __BY_QUADRANT_READER_H__ 43 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/EAN8Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EAN_8_READER_H__ 3 | #define __EAN_8_READER_H__ 4 | 5 | /* 6 | * EAN8Reader.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | class EAN8Reader: public UPCEANReader { 31 | private: 32 | std::vector decodeMiddleCounters; 33 | 34 | public: 35 | EAN8Reader(); 36 | 37 | int decodeMiddle(Ref row, Range const& startRange, 38 | std::string& resultString); 39 | 40 | BarcodeFormat getBarcodeFormat(); 41 | }; 42 | 43 | } 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/DetectorResult.h: -------------------------------------------------------------------------------- 1 | #ifndef __DETECTOR_RESULT_H__ 2 | #define __DETECTOR_RESULT_H__ 3 | 4 | /* 5 | * DetectorResult.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class DetectorResult: public Counted { 31 | private: 32 | Ref bits_; 33 | ArrayRef > points_; 34 | 35 | public: 36 | DetectorResult(Ref bits, ArrayRef > points); 37 | Ref getBits(); 38 | ArrayRef > getPoints(); 39 | }; 40 | 41 | } 42 | 43 | #endif // __DETECTOR_RESULT_H__ 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/decoder/Decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_H__ 2 | #define __DECODER_H__ 3 | 4 | /* 5 | * Decoder.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class Decoder { 33 | private: 34 | ReedSolomonDecoder rsDecoder_; 35 | 36 | void correctErrors(ArrayRef bytes, int numDataCodewords); 37 | 38 | public: 39 | Decoder(); 40 | Ref decode(Ref bits); 41 | }; 42 | 43 | } 44 | } 45 | 46 | #endif // __DECODER_H__ 47 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Binarizer.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Binarizer.cpp 4 | * zxing 5 | * 6 | * Created by Ralf Kistner on 16/10/2009. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * Modified by Lukasz Warchol on 02/02/2010. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | Binarizer::Binarizer(Ref source) : 28 | source_(source) { 29 | } 30 | 31 | Binarizer::~Binarizer() { 32 | } 33 | 34 | Ref Binarizer::getLuminanceSource() const { 35 | return source_; 36 | } 37 | 38 | int Binarizer::getWidth() const { 39 | return source_->getWidth(); 40 | } 41 | 42 | int Binarizer::getHeight() const { 43 | return source_->getHeight(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/DataMatrixReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_MATRIX_READER_H__ 2 | #define __DATA_MATRIX_READER_H__ 3 | 4 | /* 5 | * DataMatrixReader.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace datamatrix { 30 | 31 | class DataMatrixReader: public Reader { 32 | using Reader::decode; 33 | 34 | private: 35 | Decoder decoder_; 36 | 37 | public: 38 | DataMatrixReader(); 39 | virtual Ref decode(Ref image, DecodeHints hints); 40 | virtual ~DataMatrixReader(); 41 | 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif // __DATA_MATRIX_READER_H__ 48 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/detector/FinderPatternInfo.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FinderPatternInfo.cpp 3 | * zxing 4 | * 5 | * Created by Christian Brunschen on 13/05/2008. 6 | * Copyright 2008 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | 23 | namespace zxing { 24 | namespace qrcode { 25 | 26 | FinderPatternInfo::FinderPatternInfo( 27 | std::vector > patternCenters) : 28 | bottomLeft_(patternCenters[0]), topLeft_(patternCenters[1]), topRight_( 29 | patternCenters[2]) { 30 | } 31 | 32 | Ref FinderPatternInfo::getBottomLeft() { 33 | return bottomLeft_; 34 | } 35 | Ref FinderPatternInfo::getTopLeft() { 36 | return topLeft_; 37 | } 38 | Ref FinderPatternInfo::getTopRight() { 39 | return topRight_; 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/QRCodeReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __QR_CODE_READER_H__ 3 | #define __QR_CODE_READER_H__ 4 | 5 | /* 6 | * QRCodeReader.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class QRCodeReader: public Reader { 32 | using Reader::decode; 33 | 34 | private: 35 | Decoder decoder_; 36 | 37 | protected: 38 | Decoder& getDecoder(); 39 | 40 | public: 41 | QRCodeReader(); 42 | virtual ~QRCodeReader(); 43 | 44 | Ref decode(Ref image, DecodeHints hints); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __QR_CODE_READER_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/CMSIS/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011 ARM Limited. All rights reserved. 3 | * 4 | * Date: 25 July 2011 5 | * Revision: V2.10 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Binaries 34 | --- -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/decoder/DatamatrixDecoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_DM_H__ 2 | #define __DECODER_DM_H__ 3 | 4 | /* 5 | * Decoder.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | namespace datamatrix { 32 | 33 | class Decoder { 34 | private: 35 | ReedSolomonDecoder rsDecoder_; 36 | 37 | void correctErrors(ArrayRef bytes, int numDataCodewords); 38 | 39 | public: 40 | Decoder(); 41 | 42 | Ref decode(Ref bits); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif // __DECODER_DM_H__ 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/MultipleBarcodeReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTIPLE_BARCODE_READER_H__ 2 | #define __MULTIPLE_BARCODE_READER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace multi { 28 | 29 | class MultipleBarcodeReader: public Counted { 30 | protected: 31 | MultipleBarcodeReader() { 32 | } 33 | public: 34 | virtual std::vector > decodeMultiple(Ref image); 35 | virtual std::vector > decodeMultiple(Ref image, 36 | DecodeHints hints) = 0; 37 | virtual ~MultipleBarcodeReader(); 38 | }; 39 | 40 | } 41 | } 42 | 43 | #endif // __MULTIPLE_BARCODE_READER_H__ 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/FastHybridBinarizer.h: -------------------------------------------------------------------------------- 1 | #ifndef __FASTHYBRIDBINARIZER_H__ 2 | #define __FASTHYBRIDBINARIZER_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace zxing { 11 | 12 | class FastHybridBinarizer { 13 | 14 | private: 15 | const unsigned int width_; 16 | const unsigned int height_; 17 | uint8_t *workingRows; 18 | const unsigned int workingRowsSize; 19 | int blockRowsWritten; 20 | int blockRowsRead; 21 | unsigned int workingRowWriteOffset; 22 | unsigned int workingRowReadOffset; 23 | uint8_t *blackPoints; 24 | uint8_t *matrix; 25 | 26 | void calculateBlackPoint(uint8_t *block, int x, int y); 27 | void thresholdBlock(uint8_t *out, uint8_t *block, int stride, 28 | int threshold); 29 | void calculateThresholdForBlockRow(uint8_t *blockRow, int y); 30 | 31 | public: 32 | FastHybridBinarizer(unsigned int width, unsigned int height); 33 | ~FastHybridBinarizer(); 34 | 35 | void reset(void); 36 | //void load(Ref source); 37 | void writeBlockRow(uint8_t *blockRow); 38 | uint8_t * getResults(); 39 | Ref getBlackMatrix(); 40 | bool compareBlackPoints(ArrayRef other); 41 | bool compareMatrix(Ref other); 42 | 43 | int getWidth(); 44 | int getHeight(); 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/EAN13Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EAN_13_READER_H__ 3 | #define __EAN_13_READER_H__ 4 | 5 | /* 6 | * EAN13Reader.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | class EAN13Reader: public UPCEANReader { 31 | private: 32 | std::vector decodeMiddleCounters; 33 | static void determineFirstDigit(std::string& resultString, 34 | int lgPatternFound); 35 | 36 | public: 37 | EAN13Reader(); 38 | 39 | int decodeMiddle(Ref row, Range const& startRange, 40 | std::string& resultString); 41 | 42 | BarcodeFormat getBarcodeFormat(); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/detector/AlignmentPattern.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __ALIGNMENT_PATTERN_H__ 4 | #define __ALIGNMENT_PATTERN_H__ 5 | 6 | /* 7 | * AlignmentPattern.h 8 | * zxing 9 | * 10 | * Copyright 2010 ZXing authors All rights reserved. 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class AlignmentPattern: public ResultPoint { 32 | private: 33 | float estimatedModuleSize_; 34 | 35 | public: 36 | AlignmentPattern(float posX, float posY, float estimatedModuleSize); 37 | bool aboutEquals(float moduleSize, float i, float j) const; 38 | Ref combineEstimate(float i, float j, 39 | float newModuleSize) const; 40 | }; 41 | 42 | } 43 | } 44 | 45 | #endif // __ALIGNMENT_PATTERN_H__ 46 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/PC_Software/stm32_vcp/readme.txt: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** 2 | * File Name : readme.txt 3 | * Author : MCD Application Team 4 | * Version : V1.3.1 5 | * Date : 07/23/2010 6 | * Description : read me file for Virtual COM Port driver 7 | ******************************************************************************** 8 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | Last version 17 | *************** 18 | 19 | - V1.3.1 - 07/23/2010 20 | 21 | 22 | Supported OS 23 | *************** 24 | 25 | + Windows 98SE, 2000, XP, Vista, Seven (x86 & x64 Windows platforms) 26 | 27 | 28 | How to use 29 | *************** 30 | 31 | 1- Uninstall previous versions (Start-> Settings-> Control Panel-> Add or remove programs) 32 | 33 | 2- run setup. 34 | 35 | 36 | 37 | ******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****** 38 | 39 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/ImageReaderSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __IMAGE_READER_SOURCE_H_ 3 | #define __IMAGE_READER_SOURCE_H_ 4 | /* 5 | * Copyright 2010-2011 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | namespace zxing { 24 | class ImageReaderSource: public LuminanceSource { 25 | using LuminanceSource::getWidth; 26 | using LuminanceSource::getHeight; 27 | 28 | private: 29 | typedef LuminanceSource Super; 30 | const Ref matrix; 31 | public: 32 | ImageReaderSource(Ref matrix_, int width, int height); 33 | 34 | ArrayRef getRow(int y, ArrayRef row) const; 35 | 36 | // zxing::ArrayRef getRow(int y, zxing::ArrayRef row) const; 37 | ArrayRef getMatrix() const; 38 | }; 39 | } 40 | 41 | #endif /* __IMAGE_READER_SOURCE_H_ */ 42 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/decoder/DataMask.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_MASK_H__ 2 | #define __DATA_MASK_H__ 3 | 4 | /* 5 | * DataMask.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class DataMask: public Counted { 33 | private: 34 | static std::vector > DATA_MASKS; 35 | 36 | protected: 37 | 38 | public: 39 | static int buildDataMasks(); 40 | DataMask(); 41 | virtual ~DataMask(); 42 | void unmaskBitMatrix(BitMatrix& matrix, std::size_t dimension); 43 | virtual bool isMasked(std::size_t x, std::size_t y) = 0; 44 | static DataMask& forReference(int reference); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __DATA_MASK_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/aztec/AztecDetectorResult.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AtztecDetecorResult.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | #ifndef ZXingWidget_AtztecDetecorResult_h 25 | #define ZXingWidget_AtztecDetecorResult_h 26 | 27 | namespace zxing { 28 | namespace aztec { 29 | 30 | class AztecDetectorResult: public DetectorResult { 31 | private: 32 | bool compact_; 33 | int nbDatablocks_, nbLayers_; 34 | public: 35 | AztecDetectorResult(Ref bits, ArrayRef > points, 36 | bool compact, int nbDatablocks, int nbLayers); 37 | bool isCompact(); 38 | int getNBDatablocks(); 39 | int getNBLayers(); 40 | }; 41 | 42 | } 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/aztec/AztecReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AztecReader.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #ifndef ZXingWidget_AztecReader_h 27 | #define ZXingWidget_AztecReader_h 28 | 29 | namespace zxing { 30 | namespace aztec { 31 | 32 | class AztecReader: public Reader { 33 | private: 34 | Decoder decoder_; 35 | 36 | protected: 37 | Decoder &getDecoder(); 38 | 39 | public: 40 | AztecReader(); 41 | virtual Ref decode(Ref image); 42 | virtual Ref decode(Ref image, DecodeHints hints); 43 | virtual ~AztecReader(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/detector/FinderPatternInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef __FINDER_PATTERN_INFO_H__ 2 | #define __FINDER_PATTERN_INFO_H__ 3 | 4 | /* 5 | * FinderPatternInfo.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace qrcode { 30 | 31 | class FinderPatternInfo: public Counted { 32 | private: 33 | Ref bottomLeft_; 34 | Ref topLeft_; 35 | Ref topRight_; 36 | 37 | public: 38 | FinderPatternInfo(std::vector > patternCenters); 39 | 40 | Ref getBottomLeft(); 41 | Ref getTopLeft(); 42 | Ref getTopRight(); 43 | }; 44 | } 45 | } 46 | 47 | #endif // __FINDER_PATTERN_INFO_H__ 48 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/inc/bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | *

© COPYRIGHT 2012 Embest Tech. Co., Ltd.

4 | * @file bmp.h 5 | * @author CMP Team 6 | * @version V1.0.0 7 | * @date 28-December-2012 8 | * @brief Header for bmp.c module. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 15 | * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 16 | * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 17 | * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | ****************************************************************************** 19 | */ 20 | #ifndef __BMP_H 21 | #define __BMP_H 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f4xx.h" 24 | 25 | /* Exported macro ------------------------------------------------------------*/ 26 | /* Exported functions ------------------------------------------------------- */ 27 | int32_t Capture_Image_TO_Bmp(void); 28 | void init_picture_count(void); 29 | 30 | #endif /* #define __BMP_H */ 31 | /******************* COPYRIGHT 2012 Embest Tech. Co., Ltd. *****END OF FILE****/ 32 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/MultiFormatReader.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FORMAT_READER_H__ 2 | #define __MULTI_FORMAT_READER_H__ 3 | 4 | /* 5 | * MultiFormatBarcodeReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | class MultiFormatReader: public Reader { 30 | private: 31 | Ref decodeInternal(Ref image); 32 | 33 | std::vector > readers_; 34 | DecodeHints hints_; 35 | 36 | public: 37 | MultiFormatReader(); 38 | 39 | Ref decode(Ref image); 40 | Ref decode(Ref image, DecodeHints hints); 41 | Ref decodeWithState(Ref image); 42 | void setHints(DecodeHints hints); 43 | ~MultiFormatReader(); 44 | }; 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/DecoderResult.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * DecoderResult.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 20/05/2008. 7 | * Copyright 2008-2011 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using namespace std; 25 | using namespace zxing; 26 | 27 | DecoderResult::DecoderResult(ArrayRef rawBytes, Ref text, 28 | ArrayRef >& byteSegments, string const& ecLevel) : 29 | rawBytes_(rawBytes), text_(text), byteSegments_(byteSegments), ecLevel_( 30 | ecLevel) { 31 | } 32 | 33 | DecoderResult::DecoderResult(ArrayRef rawBytes, Ref text) : 34 | rawBytes_(rawBytes), text_(text) { 35 | } 36 | 37 | ArrayRef DecoderResult::getRawBytes() { 38 | return rawBytes_; 39 | } 40 | 41 | Ref DecoderResult::getText() { 42 | return text_; 43 | } 44 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Binarizer.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARIZER_H_ 2 | #define BINARIZER_H_ 3 | 4 | /* 5 | * Binarizer.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class Binarizer: public Counted { 31 | private: 32 | Ref source_; 33 | 34 | public: 35 | Binarizer(Ref source); 36 | virtual ~Binarizer(); 37 | 38 | virtual Ref getBlackRow(int y, Ref row) = 0; 39 | virtual Ref getBlackMatrix() = 0; 40 | 41 | Ref getLuminanceSource() const; 42 | virtual Ref createBinarizer(Ref source) = 0; 43 | 44 | int getWidth() const; 45 | int getHeight() const; 46 | 47 | }; 48 | 49 | } 50 | #endif /* BINARIZER_H_ */ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/decoder/DatamatrixDataBlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_BLOCK_DM_H__ 2 | #define __DATA_BLOCK_DM_H__ 3 | 4 | /* 5 | * DataBlock.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace datamatrix { 31 | 32 | class DataBlock: public Counted { 33 | private: 34 | int numDataCodewords_; 35 | ArrayRef codewords_; 36 | 37 | DataBlock(int numDataCodewords, ArrayRef codewords); 38 | 39 | public: 40 | static std::vector > getDataBlocks( 41 | ArrayRef rawCodewords, Version *version); 42 | 43 | int getNumDataCodewords(); 44 | ArrayRef getCodewords(); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __DATA_BLOCK_DM_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/Code128Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODE_128_READER_H__ 3 | #define __CODE_128_READER_H__ 4 | /* 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class Code128Reader: public OneDReader { 28 | private: 29 | static const int MAX_AVG_VARIANCE; 30 | static const int MAX_INDIVIDUAL_VARIANCE; 31 | 32 | static std::vector findStartPattern(Ref row); 33 | static int decodeCode(Ref row, std::vector& counters, 34 | int rowOffset); 35 | 36 | public: 37 | Ref decodeRow(int rowNumber, Ref row); 38 | Code128Reader(); 39 | ~Code128Reader(); 40 | 41 | BarcodeFormat getBarcodeFormat(); 42 | }; 43 | 44 | } 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/decoder/DataBlock.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA_BLOCK_H__ 2 | #define __DATA_BLOCK_H__ 3 | 4 | /* 5 | * DataBlock.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | namespace qrcode { 31 | 32 | class DataBlock: public Counted { 33 | private: 34 | int numDataCodewords_; 35 | ArrayRef codewords_; 36 | 37 | DataBlock(int numDataCodewords, ArrayRef codewords); 38 | 39 | public: 40 | static std::vector > 41 | getDataBlocks(ArrayRef rawCodewords, Version *version, 42 | ErrorCorrectionLevel &ecLevel); 43 | 44 | int getNumDataCodewords(); 45 | ArrayRef getCodewords(); 46 | }; 47 | 48 | } 49 | } 50 | 51 | #endif // __DATA_BLOCK_H__ 52 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/DecoderResult.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECODER_RESULT_H__ 2 | #define __DECODER_RESULT_H__ 3 | 4 | /* 5 | * DecoderResult.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class DecoderResult: public Counted { 31 | private: 32 | ArrayRef rawBytes_; 33 | Ref text_; 34 | ArrayRef > byteSegments_; 35 | std::string ecLevel_; 36 | 37 | public: 38 | DecoderResult(ArrayRef rawBytes, Ref text, 39 | ArrayRef >& byteSegments, 40 | std::string const& ecLevel); 41 | 42 | DecoderResult(ArrayRef rawBytes, Ref text); 43 | 44 | ArrayRef getRawBytes(); 45 | Ref getText(); 46 | }; 47 | 48 | } 49 | 50 | #endif // __DECODER_RESULT_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/GreyscaleRotatedLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GREYSCALE_ROTATED_LUMINANCE_SOURCE__ 3 | #define __GREYSCALE_ROTATED_LUMINANCE_SOURCE__ 4 | /* 5 | * GreyscaleRotatedLuminanceSource.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class GreyscaleRotatedLuminanceSource: public LuminanceSource { 28 | private: 29 | typedef LuminanceSource Super; 30 | ArrayRef greyData_; 31 | const int dataWidth_; 32 | const int left_; 33 | const int top_; 34 | 35 | public: 36 | GreyscaleRotatedLuminanceSource(ArrayRef greyData, int dataWidth, 37 | int dataHeight, int left, int top, int width, int height); 38 | 39 | ArrayRef getRow(int y, ArrayRef row) const; 40 | ArrayRef getMatrix() const; 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/Str.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __STR_H__ 3 | #define __STR_H__ 4 | 5 | /* 6 | * Str.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class String; 31 | std::ostream& operator <<(std::ostream& out, String const& s); 32 | 33 | class String: public Counted { 34 | private: 35 | std::string text_; 36 | public: 37 | explicit String(const std::string &text); 38 | explicit String(int); 39 | char charAt(int) const; 40 | Ref substring(int) const; 41 | const std::string& getText() const; 42 | int size() const; 43 | void append(std::string const& tail); 44 | void append(char c); 45 | int length() const; 46 | friend std::ostream& zxing::operator <<(std::ostream& out, String const& s); 47 | }; 48 | 49 | } 50 | 51 | #endif // __COMMON__STRING_H__ 52 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/UPCEReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __UPC_E_READER_H__ 3 | #define __UPC_E_READER_H__ 4 | 5 | /* 6 | * Copyright 2010 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class UPCEReader: public UPCEANReader { 28 | private: 29 | std::vector decodeMiddleCounters; 30 | static bool determineNumSysAndCheckDigit(std::string& resultString, 31 | int lgPatternFound); 32 | 33 | protected: 34 | Range decodeEnd(Ref row, int endStart); 35 | bool checkChecksum(Ref const& s); 36 | public: 37 | UPCEReader(); 38 | 39 | int decodeMiddle(Ref row, Range const& startRange, 40 | std::string& resultString); 41 | static Ref convertUPCEtoUPCA(Ref const& upce); 42 | 43 | BarcodeFormat getBarcodeFormat(); 44 | }; 45 | 46 | } 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/StringUtils.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __STRING_UTILS__ 4 | #define __STRING_UTILS__ 5 | 6 | /* 7 | * Copyright (C) 2010-2011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace common { 28 | 29 | class StringUtils { 30 | private: 31 | static char const* const PLATFORM_DEFAULT_ENCODING; 32 | 33 | StringUtils() { 34 | } 35 | 36 | public: 37 | static char const* const ASCII; 38 | static char const* const SHIFT_JIS; 39 | static char const* const GB2312; 40 | static char const* const EUC_JP; 41 | static char const* const UTF8; 42 | static char const* const ISO88591; 43 | static const bool ASSUME_SHIFT_JIS; 44 | 45 | typedef std::map Hashtable; 46 | 47 | static std::string guessEncoding(char* bytes, int length, 48 | Hashtable const& hints); 49 | }; 50 | 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/aztec/AztecDetectorResult.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AtztecDetecorResult.cpp 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::aztec::AztecDetectorResult; 25 | 26 | // VC++ 27 | using zxing::Ref; 28 | using zxing::ArrayRef; 29 | using zxing::BitMatrix; 30 | using zxing::ResultPoint; 31 | 32 | AztecDetectorResult::AztecDetectorResult(Ref bits, 33 | ArrayRef > points, bool compact, int nbDatablocks, 34 | int nbLayers) : 35 | DetectorResult(bits, points), compact_(compact), nbDatablocks_( 36 | nbDatablocks), nbLayers_(nbLayers) { 37 | } 38 | 39 | bool AztecDetectorResult::isCompact() { 40 | return compact_; 41 | } 42 | 43 | int AztecDetectorResult::getNBDatablocks() { 44 | return nbDatablocks_; 45 | } 46 | 47 | int AztecDetectorResult::getNBLayers() { 48 | return nbLayers_; 49 | } 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/detector/FinderPattern.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __FINDER_PATTERN_H__ 3 | #define __FINDER_PATTERN_H__ 4 | 5 | /* 6 | * FinderPattern.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | class FinderPattern: public ResultPoint { 31 | private: 32 | float estimatedModuleSize_; 33 | int count_; 34 | 35 | FinderPattern(float posX, float posY, float estimatedModuleSize, int count); 36 | 37 | public: 38 | FinderPattern(float posX, float posY, float estimatedModuleSize); 39 | int getCount() const; 40 | float getEstimatedModuleSize() const; 41 | void incrementCount(); 42 | bool aboutEquals(float moduleSize, float i, float j) const; 43 | Ref combineEstimate(float i, float j, 44 | float newModuleSize) const; 45 | }; 46 | } 47 | } 48 | 49 | #endif // __FINDER_PATTERN_H__ 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/ErrorCorrectionLevel.h: -------------------------------------------------------------------------------- 1 | #ifndef __ERROR_CORRECTION_LEVEL_H__ 2 | #define __ERROR_CORRECTION_LEVEL_H__ 3 | 4 | /* 5 | * ErrorCorrectionLevel.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | namespace qrcode { 27 | 28 | class ErrorCorrectionLevel { 29 | private: 30 | int ordinal_; 31 | int bits_; 32 | std::string name_; 33 | ErrorCorrectionLevel(int inOrdinal, int bits, char const* name); 34 | static ErrorCorrectionLevel *FOR_BITS[]; 35 | static int N_LEVELS; 36 | public: 37 | static ErrorCorrectionLevel L; 38 | static ErrorCorrectionLevel M; 39 | static ErrorCorrectionLevel Q; 40 | static ErrorCorrectionLevel H; 41 | 42 | int ordinal() const; 43 | int bits() const; 44 | std::string const& name() const; 45 | operator std::string const&() const; 46 | 47 | static ErrorCorrectionLevel& forBits(int bits); 48 | }; 49 | } 50 | } 51 | 52 | #endif // __ERROR_CORRECTION_LEVEL_H__ 53 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/UPCAReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __UPCA_READER_H__ 3 | #define __UPCA_READER_H__ 4 | /* 5 | * UPCAReader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace oned { 28 | 29 | class UPCAReader: public UPCEANReader { 30 | 31 | private: 32 | EAN13Reader ean13Reader; 33 | static Ref maybeReturnResult(Ref result); 34 | 35 | public: 36 | UPCAReader(); 37 | 38 | int decodeMiddle(Ref row, Range const& startRange, 39 | std::string& resultString); 40 | 41 | Ref decodeRow(int rowNumber, Ref row); 42 | Ref decodeRow(int rowNumber, Ref row, 43 | Range const& startGuardRange); 44 | Ref decode(Ref image, DecodeHints hints); 45 | 46 | BarcodeFormat getBarcodeFormat(); 47 | }; 48 | 49 | } 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/pdf417/PDF417Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __PDF417_READER_H__ 3 | #define __PDF417_READER_H__ 4 | 5 | /* 6 | * PDF417Reader.h 7 | * zxing 8 | * 9 | * Copyright 2010,2012 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | namespace pdf417 { 30 | 31 | class PDF417Reader: public Reader { 32 | using Reader::decode; 33 | 34 | private: 35 | decoder::Decoder decoder; 36 | 37 | static Ref extractPureBits(Ref image); 38 | static int moduleSize(ArrayRef leftTopBlack, Ref image); 39 | static int findPatternStart(int x, int y, Ref image); 40 | static int findPatternEnd(int x, int y, Ref image); 41 | 42 | public: 43 | Ref decode(Ref image, DecodeHints hints); 44 | void reset(); 45 | }; 46 | 47 | } 48 | } 49 | 50 | #endif // __PDF417_READER_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/InvertedLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __INVERTEDLUMINANCESOURCE_H__ 3 | #define __INVERTEDLUMINANCESOURCE_H__ 4 | /* 5 | * Copyright 2013 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | namespace zxing { 24 | 25 | class InvertedLuminanceSource: public LuminanceSource { 26 | private: 27 | typedef LuminanceSource Super; 28 | const Ref delegate; 29 | 30 | public: 31 | InvertedLuminanceSource(Ref const&); 32 | 33 | ArrayRef getRow(int y, ArrayRef row) const; 34 | ArrayRef getMatrix() const; 35 | 36 | boolean isCropSupported() const; 37 | Ref crop(int left, int top, int width, int height) const; 38 | 39 | boolean isRotateSupported() const; 40 | 41 | virtual Ref invert() const; 42 | 43 | Ref rotateCounterClockwise() const; 44 | }; 45 | 46 | } 47 | 48 | #endif /* INVERTEDLUMINANCESOURCE_H_ */ 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/stm32f4xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF; 11 | define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000; 12 | define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x4000; 15 | define symbol __ICFEDIT_size_heap__ = 0x15000; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to __ICFEDIT_region_CCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/stm32f4xx_sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x2000FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20010000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF; 11 | define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000; 12 | define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to __ICFEDIT_region_CCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; 35 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/BinaryBitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef __BINARYBITMAP_H__ 2 | #define __BINARYBITMAP_H__ 3 | 4 | /* 5 | * BinaryBitmap.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class BinaryBitmap: public Counted { 31 | private: 32 | Ref binarizer_; 33 | 34 | public: 35 | BinaryBitmap(Ref binarizer); 36 | virtual ~BinaryBitmap(); 37 | 38 | Ref getBlackRow(int y, Ref row); 39 | Ref getBlackMatrix(); 40 | 41 | Ref getLuminanceSource() const; 42 | 43 | int getWidth() const; 44 | int getHeight() const; 45 | 46 | bool isRotateSupported() const; 47 | Ref rotateCounterClockwise(); 48 | 49 | bool isCropSupported() const; 50 | Ref crop(int left, int top, int width, int height); 51 | 52 | }; 53 | 54 | } 55 | 56 | #endif /* BINARYBITMAP_H_ */ 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Exception.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __EXCEPTION_H__ 3 | #define __EXCEPTION_H__ 4 | 5 | /* 6 | * Exception.h 7 | * ZXing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class Exception: public std::exception { 30 | private: 31 | char const* const message; 32 | 33 | public: 34 | Exception() throw () : 35 | message(0) { 36 | } 37 | Exception(const char* msg) throw () : 38 | message(copy(msg)) { 39 | } 40 | Exception(Exception const& that) throw () : 41 | std::exception(that), message(copy(that.message)) { 42 | } 43 | ~Exception() throw () { 44 | if (message) { 45 | deleteMessage(); 46 | } 47 | } 48 | char const* what() const throw () { 49 | return message ? message : ""; 50 | } 51 | 52 | private: 53 | static char const* copy(char const*); 54 | void deleteMessage(); 55 | }; 56 | 57 | } 58 | 59 | #endif // __EXCEPTION_H__ 60 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/GreyscaleLuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GREYSCALE_LUMINANCE_SOURCE__ 3 | #define __GREYSCALE_LUMINANCE_SOURCE__ 4 | /* 5 | * GreyscaleLuminanceSource.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | 25 | namespace zxing { 26 | 27 | class GreyscaleLuminanceSource: public LuminanceSource { 28 | 29 | private: 30 | typedef LuminanceSource Super; 31 | ArrayRef greyData_; 32 | const int dataWidth_; 33 | const int dataHeight_; 34 | const int left_; 35 | const int top_; 36 | 37 | public: 38 | GreyscaleLuminanceSource(ArrayRef greyData, int dataWidth, 39 | int dataHeight, int left, int top, int width, int height); 40 | 41 | ArrayRef getRow(int y, ArrayRef row) const; 42 | ArrayRef getMatrix() const; 43 | 44 | bool isRotateSupported() const { 45 | return true; 46 | } 47 | 48 | Ref rotateCounterClockwise() const; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/BarcodeFormat.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __BARCODE_FORMAT_H__ 3 | #define __BARCODE_FORMAT_H__ 4 | 5 | /* 6 | * BarcodeFormat.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | namespace zxing { 25 | 26 | class BarcodeFormat { 27 | public: 28 | // if you update the enum, update BarcodeFormat.cpp 29 | 30 | enum Value { 31 | NONE, 32 | AZTEC, 33 | CODABAR, 34 | CODE_39, 35 | CODE_93, 36 | CODE_128, 37 | DATA_MATRIX, 38 | EAN_8, 39 | EAN_13, 40 | ITF, 41 | MAXICODE, 42 | PDF_417, 43 | QR_CODE, 44 | RSS_14, 45 | RSS_EXPANDED, 46 | UPC_A, 47 | UPC_E, 48 | UPC_EAN_EXTENSION 49 | }; 50 | 51 | BarcodeFormat(Value v) : 52 | value(v) { 53 | } 54 | const Value value; 55 | operator Value() const { 56 | return value; 57 | } 58 | 59 | static char const* barcodeFormatNames[]; 60 | }; 61 | 62 | } 63 | 64 | #endif // __BARCODE_FORMAT_H__ 65 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/CharacterSetECI.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __CHARACTERSET_ECI__ 4 | #define __CHARACTERSET_ECI__ 5 | 6 | /* 7 | * Copyright 2008-2011 ZXing authors 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | namespace zxing { 26 | namespace common { 27 | 28 | class CharacterSetECI { 29 | private: 30 | static std::map VALUE_TO_ECI; 31 | static std::map NAME_TO_ECI; 32 | static const bool inited; 33 | static bool init_tables(); 34 | 35 | int const* const values_; 36 | char const* const * const names_; 37 | 38 | CharacterSetECI(int const* values, char const* const * names); 39 | 40 | static void addCharacterSet(int const* value, 41 | char const* const * encodingNames); 42 | 43 | public: 44 | char const* name() const; 45 | int getValue() const; 46 | 47 | static CharacterSetECI* getCharacterSetECIByValue(int value); 48 | static CharacterSetECI* getCharacterSetECIByName(std::string const& name); 49 | }; 50 | 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/GlobalHistogramBinarizer.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GLOBALHISTOGRAMBINARIZER_H__ 3 | #define __GLOBALHISTOGRAMBINARIZER_H__ 4 | /* 5 | * GlobalHistogramBinarizer.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace zxing { 29 | 30 | class GlobalHistogramBinarizer: public Binarizer { 31 | private: 32 | ArrayRef luminances; 33 | ArrayRef buckets; 34 | public: 35 | GlobalHistogramBinarizer(Ref source); 36 | virtual ~GlobalHistogramBinarizer(); 37 | 38 | virtual Ref getBlackRow(int y, Ref row); 39 | virtual Ref getBlackMatrix(); 40 | static int estimateBlackPoint(ArrayRef const& buckets); 41 | Ref createBinarizer(Ref source); 42 | private: 43 | void initArrays(int luminanceSize); 44 | }; 45 | 46 | } 47 | 48 | #endif /* GLOBALHISTOGRAMBINARIZER_H_ */ 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Result.h: -------------------------------------------------------------------------------- 1 | #ifndef __RESULT_H__ 2 | #define __RESULT_H__ 3 | 4 | /* 5 | * Result.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | 32 | class Result: public Counted { 33 | private: 34 | Ref text_; 35 | ArrayRef rawBytes_; 36 | ArrayRef > resultPoints_; 37 | BarcodeFormat format_; 38 | 39 | public: 40 | Result(Ref text, ArrayRef rawBytes, 41 | ArrayRef > resultPoints, BarcodeFormat format); 42 | ~Result(); 43 | Ref getText(); 44 | ArrayRef getRawBytes(); 45 | ArrayRef > const& getResultPoints() const; 46 | ArrayRef >& getResultPoints(); 47 | BarcodeFormat getBarcodeFormat() const; 48 | 49 | friend std::ostream& operator<<(std::ostream &out, Result& result); 50 | }; 51 | 52 | } 53 | #endif // __RESULT_H__ 54 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/CodaBarReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODA_BAR_READER_H__ 3 | #define __CODA_BAR_READER_H__ 4 | /* 5 | * Copyright 2010 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace oned { 26 | 27 | class CodaBarReader: public OneDReader { 28 | private: 29 | static const int MAX_ACCEPTABLE; 30 | static const int PADDING; 31 | 32 | // Keep some instance variables to avoid reallocations 33 | std::string decodeRowResult; 34 | std::vector counters; 35 | int counterLength; 36 | 37 | public: 38 | CodaBarReader(); 39 | 40 | Ref decodeRow(int rowNumber, Ref row); 41 | 42 | void validatePattern(int start); 43 | 44 | private: 45 | void setCounters(Ref row); 46 | void counterAppend(int e); 47 | int findStartPattern(); 48 | 49 | static bool arrayContains(char const array[], char key); 50 | 51 | int toNarrowWidePattern(int position); 52 | }; 53 | 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/bigint/BigIntegerUtils.cc: -------------------------------------------------------------------------------- 1 | #include "BigIntegerUtils.hh" 2 | #include "BigUnsignedInABase.hh" 3 | 4 | std::string bigUnsignedToString(const BigUnsigned &x) { 5 | return std::string(BigUnsignedInABase(x, 10)); 6 | } 7 | 8 | std::string bigIntegerToString(const BigInteger &x) { 9 | return (x.getSign() == BigInteger::negative) ? 10 | (std::string("-") + bigUnsignedToString(x.getMagnitude())) : 11 | (bigUnsignedToString(x.getMagnitude())); 12 | } 13 | 14 | BigUnsigned stringToBigUnsigned(const std::string &s) { 15 | return BigUnsigned(BigUnsignedInABase(s, 10)); 16 | } 17 | 18 | BigInteger stringToBigInteger(const std::string &s) { 19 | // Recognize a sign followed by a BigUnsigned. 20 | return (s[0] == '-') ? 21 | BigInteger(stringToBigUnsigned(s.substr(1, s.length() - 1)), 22 | BigInteger::negative) : 23 | (s[0] == '+') ? 24 | BigInteger( 25 | stringToBigUnsigned(s.substr(1, s.length() - 1))) : 26 | BigInteger(stringToBigUnsigned(s)); 27 | } 28 | 29 | std::ostream &operator <<(std::ostream &os, const BigUnsigned &x) { 30 | BigUnsignedInABase::Base base; 31 | long osFlags = os.flags(); 32 | if (osFlags & os.dec) 33 | base = 10; 34 | else if (osFlags & os.hex) { 35 | base = 16; 36 | if (osFlags & os.showbase) 37 | os << "0x"; 38 | } else if (osFlags & os.oct) { 39 | base = 8; 40 | if (osFlags & os.showbase) 41 | os << '0'; 42 | } else 43 | throw "std::ostream << BigUnsigned: Could not determine the desired base from output-stream flags"; 44 | std::string s = std::string(BigUnsignedInABase(x, base)); 45 | os << s; 46 | return os; 47 | } 48 | 49 | std::ostream &operator <<(std::ostream &os, const BigInteger &x) { 50 | if (x.getSign() == BigInteger::negative) 51 | os << '-'; 52 | os << x.getMagnitude(); 53 | return os; 54 | } 55 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/decoder/BitMatrixParser.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIT_MATRIX_PARSER_H__ 2 | #define __BIT_MATRIX_PARSER_H__ 3 | 4 | /* 5 | * BitMatrixParser.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | namespace qrcode { 32 | 33 | class BitMatrixParser: public Counted { 34 | private: 35 | Ref bitMatrix_; 36 | Version *parsedVersion_; 37 | Ref parsedFormatInfo_; 38 | 39 | int copyBit(std::size_t x, std::size_t y, int versionBits); 40 | 41 | public: 42 | BitMatrixParser(Ref bitMatrix); 43 | Ref readFormatInformation(); 44 | Version *readVersion(); 45 | ArrayRef readCodewords(); 46 | 47 | private: 48 | BitMatrixParser(const BitMatrixParser&); 49 | BitMatrixParser& operator =(const BitMatrixParser&); 50 | 51 | }; 52 | 53 | } 54 | } 55 | 56 | #endif // __BIT_MATRIX_PARSER_H__ 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/reedsolomon/ReedSolomonDecoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __REED_SOLOMON_DECODER_H__ 2 | #define __REED_SOLOMON_DECODER_H__ 3 | 4 | /* 5 | * ReedSolomonDecoder.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | class GenericGFPoly; 32 | class GenericGF; 33 | 34 | class ReedSolomonDecoder { 35 | private: 36 | Ref field; 37 | public: 38 | ReedSolomonDecoder(Ref fld); 39 | ~ReedSolomonDecoder(); 40 | void decode(ArrayRef received, int twoS); 41 | std::vector > runEuclideanAlgorithm(Ref a, 42 | Ref b, int R); 43 | 44 | private: 45 | ArrayRef findErrorLocations(Ref errorLocator); 46 | ArrayRef findErrorMagnitudes(Ref errorEvaluator, 47 | ArrayRef errorLocations); 48 | }; 49 | } 50 | 51 | #endif // __REED_SOLOMON_DECODER_H__ 52 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/qrcode/detector/MultiDetector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace zxing { 22 | namespace multi { 23 | using namespace zxing::qrcode; 24 | 25 | MultiDetector::MultiDetector(Ref image) : 26 | Detector(image) { 27 | } 28 | 29 | MultiDetector::~MultiDetector() { 30 | } 31 | 32 | std::vector > MultiDetector::detectMulti( 33 | DecodeHints hints) { 34 | Ref image = getImage(); 35 | MultiFinderPatternFinder finder = MultiFinderPatternFinder(image, 36 | hints.getResultPointCallback()); 37 | std::vector > info = finder.findMulti(hints); 38 | std::vector > result; 39 | for (unsigned int i = 0; i < info.size(); i++) { 40 | try { 41 | result.push_back(processFinderPatternInfo(info[i])); 42 | } catch (ReaderException const& e) { 43 | (void) e; 44 | // ignore 45 | } 46 | } 47 | 48 | return result; 49 | } 50 | 51 | } // End zxing::multi namespace 52 | } // End zxing namespace 53 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/decoder/Mode.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __MODE_H__ 3 | #define __MODE_H__ 4 | 5 | /* 6 | * Mode.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | class Mode { 31 | private: 32 | int characterCountBitsForVersions0To9_; 33 | int characterCountBitsForVersions10To26_; 34 | int characterCountBitsForVersions27AndHigher_; 35 | std::string name_; 36 | 37 | Mode(int cbv0_9, int cbv10_26, int cbv27, int bits, char const* name); 38 | 39 | public: 40 | static Mode TERMINATOR; 41 | static Mode NUMERIC; 42 | static Mode ALPHANUMERIC; 43 | static Mode STRUCTURED_APPEND; 44 | static Mode BYTE; 45 | static Mode ECI; 46 | static Mode KANJI; 47 | static Mode FNC1_FIRST_POSITION; 48 | static Mode FNC1_SECOND_POSITION; 49 | static Mode HANZI; 50 | 51 | static Mode& forBits(int bits); 52 | int getCharacterCountBits(Version *version); 53 | }; 54 | } 55 | } 56 | 57 | #endif // __MODE_H__ 58 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/settings/Project.dni: -------------------------------------------------------------------------------- 1 | [DebugChecksum] 2 | Checksum=1356118413 3 | [Exceptions] 4 | StopOnUncaught=_ 0 5 | StopOnThrow=_ 0 6 | [Stack] 7 | FillEnabled=0 8 | OverflowWarningsEnabled=1 9 | WarningThreshold=90 10 | SpWarningsEnabled=1 11 | WarnLogOnly=1 12 | UseTrigger=1 13 | TriggerName=main 14 | LimitSize=0 15 | ByteLimit=50 16 | [CallStack] 17 | ShowArgs=0 18 | [Disassembly] 19 | MixedMode=1 20 | [SWOTraceHWSettings] 21 | OverrideDefaultClocks=0 22 | CpuClock=72000000 23 | ClockAutoDetect=0 24 | ClockWanted=2000000 25 | JtagSpeed=2000000 26 | Prescaler=36 27 | TimeStampPrescIndex=0 28 | TimeStampPrescData=0 29 | PcSampCYCTAP=1 30 | PcSampPOSTCNT=15 31 | PcSampIndex=0 32 | DataLogMode=0 33 | ITMportsEnable=0 34 | ITMportsTermIO=0 35 | ITMportsLogFile=0 36 | ITMlogFile=$PROJ_DIR$\ITM.log 37 | [Interrupts] 38 | Enabled=1 39 | [MemoryMap] 40 | Enabled=0 41 | Base=0 42 | UseAuto=0 43 | TypeViolation=1 44 | UnspecRange=1 45 | ActionState=1 46 | [Trace1] 47 | Enabled=0 48 | ShowSource=1 49 | [DataLog] 50 | LogEnabled=0 51 | SumEnabled=0 52 | GraphEnabled=0 53 | ShowTimeLog=1 54 | ShowTimeSum=1 55 | [InterruptLog] 56 | LogEnabled=0 57 | SumEnabled=0 58 | GraphEnabled=0 59 | ShowTimeLog=1 60 | ShowTimeSum=1 61 | SumSortOrder=0 62 | [TermIOLog] 63 | LoggingEnabled=_ 0 64 | LogFile=_ "" 65 | [Trace2] 66 | Enabled=0 67 | ShowSource=0 68 | [SWOTraceWindow] 69 | PcSampling=0 70 | InterruptLogs=0 71 | ForcedTimeStamps=0 72 | EventCPI=0 73 | EventEXC=0 74 | EventFOLD=0 75 | EventLSU=0 76 | EventSLEEP=0 77 | [CallStackLog] 78 | Enabled=0 79 | [DriverProfiling] 80 | Enabled=1 81 | Mode=3 82 | Graph=0 83 | Symbiont=0 84 | Exclusions= 85 | [Log file] 86 | LoggingEnabled=_ 0 87 | LogFile=_ "" 88 | Category=_ 0 89 | [Disassemble mode] 90 | mode=0 91 | [Breakpoints2] 92 | Count=0 93 | [Aliases] 94 | Count=0 95 | SuppressDialog=0 96 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/ResultPoint.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __RESULT_POINT_H__ 3 | #define __RESULT_POINT_H__ 4 | 5 | /* 6 | * ResultPoint.h 7 | * zxing 8 | * 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class ResultPoint: public Counted { 30 | protected: 31 | const float posX_; 32 | const float posY_; 33 | 34 | public: 35 | ResultPoint(); 36 | ResultPoint(float x, float y); 37 | ResultPoint(int x, int y); 38 | virtual ~ResultPoint(); 39 | 40 | virtual float getX() const; 41 | virtual float getY() const; 42 | 43 | bool equals(Ref other); 44 | 45 | static void orderBestPatterns(std::vector > &patterns); 46 | static float distance(Ref point1, Ref point2); 47 | static float distance(float x1, float x2, float y1, float y2); 48 | 49 | private: 50 | static float crossProductZ(Ref pointA, Ref pointB, 51 | Ref pointC); 52 | }; 53 | 54 | } 55 | 56 | #endif // __RESULT_POINT_H__ 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/Result.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Result.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using zxing::Result; 25 | using zxing::Ref; 26 | using zxing::ArrayRef; 27 | using zxing::String; 28 | using zxing::ResultPoint; 29 | 30 | // VC++ 31 | using zxing::BarcodeFormat; 32 | 33 | Result::Result(Ref text, ArrayRef rawBytes, 34 | ArrayRef > resultPoints, BarcodeFormat format) : 35 | text_(text), rawBytes_(rawBytes), resultPoints_(resultPoints), format_( 36 | format) { 37 | } 38 | 39 | Result::~Result() { 40 | } 41 | 42 | Ref Result::getText() { 43 | return text_; 44 | } 45 | 46 | ArrayRef Result::getRawBytes() { 47 | return rawBytes_; 48 | } 49 | 50 | ArrayRef > const& Result::getResultPoints() const { 51 | return resultPoints_; 52 | } 53 | 54 | ArrayRef >& Result::getResultPoints() { 55 | return resultPoints_; 56 | } 57 | 58 | zxing::BarcodeFormat Result::getBarcodeFormat() const { 59 | return format_; 60 | } 61 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h: -------------------------------------------------------------------------------- 1 | #ifndef __MULTI_FINDER_PATTERN_FINDER_H__ 2 | #define __MULTI_FINDER_PATTERN_FINDER_H__ 3 | 4 | /* 5 | * Copyright 2011 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace multi { 26 | 27 | class MultiFinderPatternFinder: zxing::qrcode::FinderPatternFinder { 28 | private: 29 | std::vector > > selectBestPatterns(); 30 | 31 | static const float MAX_MODULE_COUNT_PER_EDGE; 32 | static const float MIN_MODULE_COUNT_PER_EDGE; 33 | static const float DIFF_MODSIZE_CUTOFF_PERCENT; 34 | static const float DIFF_MODSIZE_CUTOFF; 35 | 36 | public: 37 | MultiFinderPatternFinder(Ref image, 38 | Ref resultPointCallback); 39 | virtual ~MultiFinderPatternFinder(); 40 | virtual std::vector > findMulti( 41 | DecodeHints const& hints); 42 | 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif // __MULTI_FINDER_PATTERN_FINDER_H__ 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/settings/Project.cspy.bat: -------------------------------------------------------------------------------- 1 | @REM This batch file has been generated by the IAR Embedded Workbench 2 | @REM C-SPY Debugger, as an aid to preparing a command line for running 3 | @REM the cspybat command line utility using the appropriate settings. 4 | @REM 5 | @REM Note that this file is generated every time a new debug session 6 | @REM is initialized, so you may want to move or rename the file before 7 | @REM making changes. 8 | @REM 9 | @REM You can launch cspybat by typing the name of this batch file followed 10 | @REM by the name of the debug file (usually an ELF/DWARF or UBROF file). 11 | @REM 12 | @REM Read about available command line parameters in the C-SPY Debugging 13 | @REM Guide. Hints about additional command line parameters that may be 14 | @REM useful in specific cases: 15 | @REM --download_only Downloads a code image without starting a debug 16 | @REM session afterwards. 17 | @REM --silent Omits the sign-on message. 18 | @REM --timeout Limits the maximum allowed execution time. 19 | @REM 20 | 21 | 22 | "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\common\bin\cspybat" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\arm\bin\armproc.dll" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\arm\bin\armstlink.dll" %1 --plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\arm\bin\armbat.dll" --macro "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\arm\config\debugger\ST\Trace_STM32F4xx.dmac" --backend -B "--endian=little" "--cpu=Cortex-M4" "--fpu=VFPv4" "-p" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.5 arm\arm\CONFIG\debugger\ST\STM32F407VG.ddf" "--semihosting" "--device=STM32F407VG" "--stlink_interface=SWD" "--stlink_reset_strategy=0,0" "--drv_swo_clock_setup=72000000,0,2000000" 23 | 24 | 25 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/Str.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * String.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 20/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using std::string; 25 | using zxing::String; 26 | using zxing::Ref; 27 | 28 | String::String(const std::string &text) : 29 | text_(text) { 30 | } 31 | 32 | String::String(int capacity) { 33 | text_.reserve(capacity); 34 | } 35 | 36 | const std::string& String::getText() const { 37 | return text_; 38 | } 39 | 40 | char String::charAt(int i) const { 41 | return text_[i]; 42 | } 43 | 44 | int String::size() const { 45 | return text_.size(); 46 | } 47 | 48 | int String::length() const { 49 | return text_.size(); 50 | } 51 | 52 | Ref String::substring(int i) const { 53 | return Ref(new String(text_.substr(i))); 54 | } 55 | 56 | void String::append(const std::string &tail) { 57 | text_.append(tail); 58 | } 59 | 60 | void String::append(char c) { 61 | text_.append(1, c); 62 | } 63 | 64 | std::ostream& zxing::operator <<(std::ostream& out, String const& s) { 65 | out << s.text_; 66 | return out; 67 | } 68 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/DataMatrixReader.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * DataMatrixReader.cpp 4 | * zxing 5 | * 6 | * Created by Luiz Silva on 09/02/2010. 7 | * Copyright 2010 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace datamatrix { 28 | 29 | using namespace std; 30 | 31 | DataMatrixReader::DataMatrixReader() : 32 | decoder_() { 33 | } 34 | 35 | Ref DataMatrixReader::decode(Ref image, 36 | DecodeHints hints) { 37 | (void) hints; 38 | Detector detector(image->getBlackMatrix()); 39 | Ref detectorResult(detector.detect()); 40 | ArrayRef > points(detectorResult->getPoints()); 41 | 42 | Ref decoderResult( 43 | decoder_.decode(detectorResult->getBits())); 44 | 45 | Ref result( 46 | new Result(decoderResult->getText(), decoderResult->getRawBytes(), 47 | points, BarcodeFormat::DATA_MATRIX)); 48 | 49 | return result; 50 | } 51 | 52 | DataMatrixReader::~DataMatrixReader() { 53 | } 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/detector/MathUtils.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __ZXING_COMMON_DETECTOR_MATHUTILS_H__ 3 | #define __ZXING_COMMON_DETECTOR_MATHUTILS_H__ 4 | /* 5 | * Copyright 2012 ZXing authors All rights reserved. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | #include 21 | 22 | namespace zxing { 23 | namespace common { 24 | namespace detector { 25 | 26 | class MathUtils { 27 | private: 28 | MathUtils(); 29 | ~MathUtils(); 30 | public: 31 | 32 | /** 33 | * Ends up being a bit faster than {@link Math#round(float)}. This merely rounds its 34 | * argument to the nearest int, where x.5 rounds up to x+1. 35 | */ 36 | static inline int round(float d) { 37 | return (int) (d + 0.5f); 38 | } 39 | 40 | static inline float distance(float aX, float aY, float bX, float bY) { 41 | float xDiff = aX - bX; 42 | float yDiff = aY - bY; 43 | return std::sqrt(xDiff * xDiff + yDiff * yDiff); 44 | } 45 | 46 | static inline float distance(int aX, int aY, int bX, int bY) { 47 | int xDiff = aX - bX; 48 | int yDiff = aY - bY; 49 | return std::sqrt(float(xDiff * xDiff + yDiff * yDiff)); 50 | } 51 | }; 52 | 53 | } 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/multi/GenericMultipleBarcodeReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __GENERIC_MULTIPLE_BARCODE_READER_H__ 3 | #define __GENERIC_MULTIPLE_BARCODE_READER_H__ 4 | 5 | /* 6 | * Copyright 2011 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | namespace zxing { 25 | namespace multi { 26 | 27 | class GenericMultipleBarcodeReader: public MultipleBarcodeReader { 28 | private: 29 | static Ref translateResultPoints(Ref result, int xOffset, 30 | int yOffset); 31 | void doDecodeMultiple(Ref image, DecodeHints hints, 32 | std::vector >& results, int xOffset, int yOffset, 33 | int currentDepth); 34 | Reader& delegate_; 35 | static const int MIN_DIMENSION_TO_RECUR = 100; 36 | static const int MAX_DEPTH = 4; 37 | 38 | public: 39 | GenericMultipleBarcodeReader(Reader& delegate); 40 | virtual ~GenericMultipleBarcodeReader(); 41 | virtual std::vector > decodeMultiple(Ref image, 42 | DecodeHints hints); 43 | }; 44 | 45 | } 46 | } 47 | 48 | #endif // __GENERIC_MULTIPLE_BARCODE_READER_H__ 49 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/reedsolomon/GenericGFPoly.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * GenericGFPoly.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 13/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef GENERICGFPOLY_H 23 | #define GENERICGFPOLY_H 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | 31 | class GenericGF; 32 | 33 | class GenericGFPoly: public Counted { 34 | private: 35 | Ref field_; 36 | ArrayRef coefficients_; 37 | 38 | public: 39 | GenericGFPoly(Ref field, ArrayRef coefficients); 40 | ArrayRef getCoefficients(); 41 | int getDegree(); 42 | bool isZero(); 43 | int getCoefficient(int degree); 44 | int evaluateAt(int a); 45 | Ref addOrSubtract(Ref other); 46 | Ref multiply(Ref other); 47 | Ref multiply(int scalar); 48 | Ref multiplyByMonomial(int degree, int coefficient); 49 | std::vector > divide(Ref other); 50 | 51 | }; 52 | 53 | } 54 | 55 | #endif //GENERICGFPOLY_H 56 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/QRCodeReader.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * QRCodeReader.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 20/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | using namespace std; 31 | 32 | QRCodeReader::QRCodeReader() : 33 | decoder_() { 34 | } 35 | //TODO: see if any of the other files in the qrcode tree need tryHarder 36 | Ref QRCodeReader::decode(Ref image, DecodeHints hints) { 37 | Detector detector(image); 38 | Ref detectorResult(detector.detect(hints)); 39 | ArrayRef > points(detectorResult->getPoints()); 40 | Ref decoderResult( 41 | decoder_.decode(detectorResult->getBits())); 42 | Ref result( 43 | new Result(decoderResult->getText(), decoderResult->getRawBytes(), 44 | points, BarcodeFormat::QR_CODE)); 45 | return result; 46 | } 47 | 48 | QRCodeReader::~QRCodeReader() { 49 | } 50 | 51 | Decoder& QRCodeReader::getDecoder() { 52 | return decoder_; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/GridSampler.h: -------------------------------------------------------------------------------- 1 | #ifndef __GRID_SAMPLER_H__ 2 | #define __GRID_SAMPLER_H__ 3 | 4 | /* 5 | * GridSampler.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | class GridSampler { 29 | private: 30 | static GridSampler gridSampler; 31 | GridSampler(); 32 | 33 | public: 34 | Ref sampleGrid(Ref image, int dimension, 35 | Ref transform); 36 | Ref sampleGrid(Ref image, int dimensionX, 37 | int dimensionY, Ref transform); 38 | 39 | Ref sampleGrid(Ref image, int dimension, float p1ToX, 40 | float p1ToY, float p2ToX, float p2ToY, float p3ToX, float p3ToY, 41 | float p4ToX, float p4ToY, float p1FromX, float p1FromY, 42 | float p2FromX, float p2FromY, float p3FromX, float p3FromY, 43 | float p4FromX, float p4FromY); 44 | static void checkAndNudgePoints(Ref image, 45 | std::vector &points); 46 | static GridSampler &getInstance(); 47 | }; 48 | } 49 | 50 | #endif // __GRID_SAMPLER_H__ 51 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/Code93Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODE_93_READER_H__ 3 | #define __CODE_93_READER_H__ 4 | /* 5 | * Code93Reader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | /** 31 | *

Decodes Code 93 barcodes. This does not support "Full ASCII Code 93" yet.

32 | * Ported form Java (author Sean Owen) 33 | * @author Lukasz Warchol 34 | */ 35 | class Code93Reader: public OneDReader { 36 | public: 37 | Code93Reader(); 38 | Ref decodeRow(int rowNumber, Ref row); 39 | 40 | private: 41 | std::string decodeRowResult; 42 | std::vector counters; 43 | 44 | Range findAsteriskPattern(Ref row); 45 | 46 | static int toPattern(std::vector& counters); 47 | static char patternToChar(int pattern); 48 | static Ref decodeExtended(std::string const& encoded); 49 | static void checkChecksums(std::string const& result); 50 | static void checkOneChecksum(std::string const& result, int checkPosition, 51 | int weightMax); 52 | }; 53 | 54 | } 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/EWARM/settings/Project.Discover-More.cspy.bat: -------------------------------------------------------------------------------- 1 | @REM This batch file has been generated by the IAR Embedded Workbench 2 | @REM C-SPY Debugger, as an aid to preparing a command line for running 3 | @REM the cspybat command line utility using the appropriate settings. 4 | @REM 5 | @REM Note that this file is generated every time a new debug session 6 | @REM is initialized, so you may want to move or rename the file before 7 | @REM making changes. 8 | @REM 9 | @REM You can launch cspybat by typing the name of this batch file followed 10 | @REM by the name of the debug file (usually an ELF/DWARF or UBROF file). 11 | @REM 12 | @REM Read about available command line parameters in the C-SPY Debugging 13 | @REM Guide. Hints about additional command line parameters that may be 14 | @REM useful in specific cases: 15 | @REM --download_only Downloads a code image without starting a debug 16 | @REM session afterwards. 17 | @REM --silent Omits the sign-on message. 18 | @REM --timeout Limits the maximum allowed execution time. 19 | @REM 20 | 21 | 22 | "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\common\bin\cspybat" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\armproc.dll" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\armstlink.dll" %1 --plugin "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\bin\armbat.dll" --device_macro "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\config\debugger\ST\Trace_STM32F4xx.dmac" --flash_loader "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\config\flashloader\ST\FlashSTM32F4xxx.board" --backend -B "--endian=little" "--cpu=Cortex-M4F" "--fpu=VFPv4" "-p" "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.0\arm\CONFIG\debugger\ST\STM32F407VG.ddf" "--semihosting" "--device=STM32F407VG" "--stlink_interface=SWD" "--stlink_reset_strategy=0,0" "--drv_swo_clock_setup=168000000,1,2000000" 23 | 24 | 25 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/STM32F4-Discovery/stm32f4_discovery_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | *

© COPYRIGHT 2012 Embest Tech. Co., Ltd.

4 | * @file stm32f4_discovery_debug.h 5 | * @author CMP Team 6 | * @version V1.0.0 7 | * @date 28-December-2012 8 | * @brief Header for stm32f4_discovery_debug.c module 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT 15 | * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT 16 | * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION 17 | * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | ****************************************************************************** 19 | */ 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef __STM32F4_DISCOVERY_DEBUG_H 22 | #define __STM32F4_DISCOVERY_DEBUG_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f4xx.h" 30 | 31 | /** @addtogroup Utilities 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup STM32F4_DISCOVERY 36 | * @{ 37 | */ 38 | /** @defgroup STM32F4_DISCOVERY_LOW_LEVEL_Exported_Functions 39 | * @{ 40 | */ 41 | void STM32f4_Discovery_Debug_Init(void); 42 | int Get_Peek_Key(void); 43 | /** 44 | * @} 45 | */ 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __STM32F4_DISCOVERY_DEBUG_H */ 51 | /** 52 | * @} 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** 60 | * @} 61 | */ 62 | 63 | /******************** COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/ 64 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/detector/WhiteRectangleDetector.h: -------------------------------------------------------------------------------- 1 | #ifndef __WHITERECTANGLEDETECTOR_H__ 2 | #define __WHITERECTANGLEDETECTOR_H__ 3 | 4 | /* 5 | * WhiteRectangleDetector.h 6 | * 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace zxing { 32 | 33 | class WhiteRectangleDetector: public Counted { 34 | private: 35 | static int INIT_SIZE; 36 | static int CORR; 37 | Ref image_; 38 | int width_; 39 | int height_; 40 | int leftInit_; 41 | int rightInit_; 42 | int downInit_; 43 | int upInit_; 44 | 45 | public: 46 | WhiteRectangleDetector(Ref image); 47 | WhiteRectangleDetector(Ref image, int initSize, int x, int y); 48 | std::vector > detect(); 49 | 50 | private: 51 | Ref getBlackPointOnSegment(int aX, int aY, int bX, int bY); 52 | std::vector > centerEdges(Ref y, 53 | Ref z, Ref x, Ref t); 54 | bool containsBlackPoint(int a, int b, int fixed, bool horizontal); 55 | }; 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/detector/AlignmentPattern.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AlignmentPattern.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 13/05/2008. 7 | * Copyright 2008 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using std::abs; 25 | using zxing::Ref; 26 | using zxing::qrcode::AlignmentPattern; 27 | 28 | AlignmentPattern::AlignmentPattern(float posX, float posY, 29 | float estimatedModuleSize) : 30 | ResultPoint(posX, posY), estimatedModuleSize_(estimatedModuleSize) { 31 | } 32 | 33 | bool AlignmentPattern::aboutEquals(float moduleSize, float i, float j) const { 34 | if (abs(i - getY()) <= moduleSize && abs(j - getX()) <= moduleSize) { 35 | float moduleSizeDiff = abs(moduleSize - estimatedModuleSize_); 36 | return moduleSizeDiff <= 1.0f || moduleSizeDiff <= estimatedModuleSize_; 37 | } 38 | return false; 39 | } 40 | 41 | Ref AlignmentPattern::combineEstimate(float i, float j, 42 | float newModuleSize) const { 43 | float combinedX = (getX() + j) / 2.0f; 44 | float combinedY = (getY() + i) / 2.0f; 45 | float combinedModuleSize = (estimatedModuleSize_ + newModuleSize) / 2.0f; 46 | Ref result( 47 | new AlignmentPattern(combinedX, combinedY, combinedModuleSize)); 48 | return result; 49 | } 50 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/pdf417/decoder/ec/ModulusGF.h: -------------------------------------------------------------------------------- 1 | #ifndef __MODULUS_GF_PDF_H__ 2 | #define __MODULUS_GF_PDF_H__ 3 | /* 4 | * Copyright 2012 ZXing authors 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * 2012-09-17 HFN translation from Java into C++ 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | namespace pdf417 { 28 | namespace decoder { 29 | namespace ec { 30 | 31 | class ModulusPoly; 32 | 33 | /** 34 | *

A field based on powers of a generator integer, modulo some modulus.

35 | * 36 | * @author Sean Owen 37 | * @see com.google.zxing.common.reedsolomon.GenericGF 38 | */ 39 | class ModulusGF { 40 | 41 | public: 42 | static ModulusGF PDF417_GF; 43 | 44 | private: 45 | ArrayRef expTable_; 46 | ArrayRef logTable_; 47 | Ref zero_; 48 | Ref one_; 49 | int modulus_; 50 | 51 | public: 52 | ModulusGF(int modulus, int generator); 53 | Ref getZero(); 54 | Ref getOne(); 55 | Ref buildMonomial(int degree, int coefficient); 56 | 57 | int add(int a, int b); 58 | int subtract(int a, int b); 59 | int exp(int a); 60 | int log(int a); 61 | int inverse(int a); 62 | int multiply(int a, int b); 63 | int getSize(); 64 | 65 | }; 66 | 67 | } 68 | } 69 | } 70 | } 71 | 72 | #endif /* __MODULUS_GF_PDF_H__ */ 73 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/aztec/decoder/AztecDecoder.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Decoder.h 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef __ZXING_AZTEC_DECODER_DECODER_H__ 23 | #define __ZXING_AZTEC_DECODER_DECODER_H__ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | 31 | class DecoderResult; 32 | 33 | namespace aztec { 34 | 35 | class Decoder: public Counted { 36 | private: 37 | enum Table { 38 | UPPER, LOWER, MIXED, DIGIT, PUNCT, BINARY 39 | }; 40 | 41 | static Table getTable(char t); 42 | static const char* getCharacter(Table table, int code); 43 | 44 | int numCodewords_; 45 | int codewordSize_; 46 | Ref ddata_; 47 | int invertedBitCount_; 48 | 49 | Ref getEncodedData(Ref correctedBits); 50 | Ref correctBits(Ref rawbits); 51 | Ref extractBits(Ref matrix); 52 | static Ref removeDashedLines(Ref matrix); 53 | static int readCode(Ref rawbits, int startIndex, int length); 54 | 55 | public: 56 | Decoder(); 57 | Ref decode(Ref detectorResult); 58 | }; 59 | 60 | } 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/LuminanceSource.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __LUMINANCESOURCE_H__ 3 | #define __LUMINANCESOURCE_H__ 4 | /* 5 | * LuminanceSource.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | 29 | class LuminanceSource: public Counted { 30 | private: 31 | const int width; 32 | const int height; 33 | 34 | public: 35 | LuminanceSource(int width, int height); 36 | virtual ~LuminanceSource(); 37 | 38 | int getWidth() const { 39 | return width; 40 | } 41 | int getHeight() const { 42 | return height; 43 | } 44 | 45 | // Callers take ownership of the returned memory and must call delete [] on it themselves. 46 | virtual ArrayRef getRow(int y, ArrayRef row) const = 0; 47 | virtual ArrayRef getMatrix() const = 0; 48 | 49 | virtual bool isCropSupported() const; 50 | virtual Ref crop(int left, int top, int width, 51 | int height) const; 52 | 53 | virtual bool isRotateSupported() const; 54 | 55 | virtual Ref invert() const; 56 | 57 | virtual Ref rotateCounterClockwise() const; 58 | 59 | operator std::string() const; 60 | }; 61 | 62 | } 63 | 64 | #endif /* LUMINANCESOURCE_H_ */ 65 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/FormatInformation.h: -------------------------------------------------------------------------------- 1 | #ifndef __FORMAT_INFORMATION_H__ 2 | #define __FORMAT_INFORMATION_H__ 3 | 4 | /* 5 | * FormatInformation.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace qrcode { 29 | 30 | class FormatInformation: public Counted { 31 | private: 32 | static int FORMAT_INFO_MASK_QR; 33 | static int FORMAT_INFO_DECODE_LOOKUP[][2]; 34 | static int N_FORMAT_INFO_DECODE_LOOKUPS; 35 | static int BITS_SET_IN_HALF_BYTE[]; 36 | 37 | ErrorCorrectionLevel &errorCorrectionLevel_; 38 | char dataMask_; 39 | 40 | FormatInformation(int formatInfo); 41 | 42 | public: 43 | static int numBitsDiffering(int a, int b); 44 | static Ref decodeFormatInformation(int maskedFormatInfo1, 45 | int maskedFormatInfo2); 46 | static Ref doDecodeFormatInformation( 47 | int maskedFormatInfo1, int maskedFormatInfo2); 48 | ErrorCorrectionLevel &getErrorCorrectionLevel(); 49 | char getDataMask(); 50 | friend bool operator==(const FormatInformation &a, 51 | const FormatInformation &b); 52 | friend std::ostream& operator<<(std::ostream& out, 53 | const FormatInformation& fi); 54 | }; 55 | } 56 | } 57 | 58 | #endif // __FORMAT_INFORMATION_H__ 59 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_cdc_if_template.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 19-March-2012 7 | * @brief Header for dfu_mal.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2012 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_CDC_IF_TEMPLATE_H 30 | #define __USBD_CDC_IF_TEMPLATE_H 31 | 32 | /* Includes ------------------------------------------------------------------*/ 33 | #include "usb_conf.h" 34 | #include "usbd_conf.h" 35 | #include "usbd_cdc_core.h" 36 | 37 | /* Exported types ------------------------------------------------------------*/ 38 | /* Exported constants --------------------------------------------------------*/ 39 | 40 | extern CDC_IF_Prop_TypeDef TEMPLATE_fops; 41 | 42 | /* Exported macro ------------------------------------------------------------*/ 43 | /* Exported functions ------------------------------------------------------- */ 44 | #endif /* __USBD_CDC_IF_TEMPLATE_H */ 45 | 46 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 47 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/PC_Software/stm32_vcp/version.txt: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2010 STMicroelectronics ******************** 2 | * File Name : version.txt 3 | * Author : MCD Application Team 4 | * Version : V1.3.1 5 | * Date : 07/23/2010 6 | * Description : Version file for Virtual COM Port driver 7 | ******************************************************************************** 8 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 12 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 14 | *******************************************************************************/ 15 | 16 | 17 | * V1.3.1 - 07/23/2010 18 | ===================== 19 | 20 | New Features 21 | ************ 22 | + WHQL Certified with and published at WindowsUpdate web site : 23 | - Microsoft Windows 2000 family, 24 | - Microsoft Windows XP family, x86 25 | - Microsoft Windows XP family, x64 26 | - Microsoft Windows Vista family, x86 27 | - Microsoft Windows Vista family, x64 28 | - Microsoft Windows 7 29 | 30 | 31 | * V1.2.0 - 07/21/2009 32 | ===================== 33 | + Solving msports.dll copy issue when this file is already used by the operating system 34 | 35 | 36 | * V1.1.0 - 06/13/2008 37 | ===================== 38 | + Remove the Firmware License Agreement file 39 | + resolved issues 40 | 1) Creation of "WINNT" and "Windows" directories in different disck partitions 41 | 2) Creation of multiple uninstall entries in "Add/Remove programs" service 42 | 43 | * V1.0.0 - 05/08/2008 44 | ==================== 45 | Created. 46 | 47 | 48 | ******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****** -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/ImageReaderSource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2011 ZXing authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "ImageReaderSource.h" 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | using namespace zxing; 27 | 28 | using std::string; 29 | using std::ostringstream; 30 | using zxing::Ref; 31 | using zxing::ArrayRef; 32 | using zxing::LuminanceSource; 33 | 34 | ImageReaderSource::ImageReaderSource(Ref matrix_, int width, 35 | int height) : 36 | matrix(matrix_), Super(width, height) { 37 | } 38 | 39 | ArrayRef ImageReaderSource::getRow(int y, ArrayRef row) const { 40 | if (!row) { 41 | row = ArrayRef(matrix->getWidth()); 42 | } 43 | 44 | Ref rowMatrix = matrix->getRow(y, 45 | Ref(new BitArray(matrix->getWidth()))); 46 | for (int i = 0; i < rowMatrix->getSize(); i++) { 47 | row[i] = (char) rowMatrix->get(i); 48 | } 49 | 50 | return row; 51 | } 52 | 53 | ArrayRef ImageReaderSource::getMatrix() const { 54 | ArrayRef result(matrix->getWidth() * matrix->getHeight()); 55 | //ArrayRef result(30000); 56 | char* m = &result[0]; 57 | for (int y = 0; y < matrix->getHeight(); y++) { 58 | for (int x = 0; x < matrix->getWidth(); x++) { 59 | *m = (char) matrix->get(x, y); 60 | m++; 61 | } 62 | } 63 | 64 | return result; 65 | } 66 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/pdf417/decoder/Pdf417Decoder.h: -------------------------------------------------------------------------------- 1 | #ifndef __DECOCER_PDF_H__ 2 | #define __DECOCER_PDF_H__ 3 | 4 | /* 5 | * Decoder.h 6 | * zxing 7 | * 8 | * Created by Hartmut Neubauer, 2012-05-25 9 | * Copyright 2010,2012 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | namespace zxing { 32 | namespace pdf417 { 33 | namespace decoder { 34 | 35 | /** 36 | *

The main class which implements PDF417 Code decoding -- as 37 | * opposed to locating and extracting the PDF417 Code from an image.

38 | * 39 | *

2012-06-27 HFN Reed-Solomon error correction activated, see class PDF417RSDecoder.

40 | *

2012-09-19 HFN Reed-Solomon error correction via ErrorCorrection/ModulusGF/ModulusPoly.

41 | */ 42 | 43 | class Decoder { 44 | private: 45 | static const int MAX_ERRORS; 46 | static const int MAX_EC_CODEWORDS; 47 | 48 | void correctErrors(ArrayRef codewords, ArrayRef erasures, 49 | int numECCodewords); 50 | static void verifyCodewordCount(ArrayRef codewords, 51 | int numECCodewords); 52 | 53 | public: 54 | 55 | Ref decode(Ref bits, DecodeHints const &hints); 56 | }; 57 | 58 | } 59 | } 60 | } 61 | 62 | #endif // __DECOCER_PDF_H__ 63 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/Code39Reader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __CODE_39_READER_H__ 3 | #define __CODE_39_READER_H__ 4 | /* 5 | * Code39Reader.h 6 | * ZXing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace oned { 29 | 30 | /** 31 | *

Decodes Code 39 barcodes. This does not support "Full ASCII Code 39" yet.

32 | * Ported form Java (author Sean Owen) 33 | * @author Lukasz Warchol 34 | */ 35 | class Code39Reader: public OneDReader { 36 | private: 37 | bool usingCheckDigit; 38 | bool extendedMode; 39 | std::string decodeRowResult; 40 | std::vector counters; 41 | 42 | void init(bool usingCheckDigit = false, bool extendedMode = false); 43 | 44 | static std::vector findAsteriskPattern(Ref row, 45 | std::vector& counters); 46 | static int toNarrowWidePattern(std::vector& counters); 47 | static char patternToChar(int pattern); 48 | static Ref decodeExtended(std::string encoded); 49 | 50 | void append(char* s, char c); 51 | 52 | public: 53 | Code39Reader(); 54 | Code39Reader(bool usingCheckDigit_); 55 | Code39Reader(bool usingCheckDigit_, bool extendedMode_); 56 | 57 | Ref decodeRow(int rowNumber, Ref row); 58 | }; 59 | 60 | } 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/datamatrix/decoder/DatamatrixBitMatrixParser.h: -------------------------------------------------------------------------------- 1 | #ifndef __BIT_MATRIX_PARSER_DM_H__ 2 | #define __BIT_MATRIX_PARSER_DM_H__ 3 | 4 | /* 5 | * BitMatrixParser.h 6 | * zxing 7 | * 8 | * Created by Luiz Silva on 09/02/2010. 9 | * Copyright 2010 ZXing authors All rights reserved. 10 | * 11 | * Licensed under the Apache License, Version 2.0 (the "License"); 12 | * you may not use this file except in compliance with the License. 13 | * You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, software 18 | * distributed under the License is distributed on an "AS IS" BASIS, 19 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | * See the License for the specific language governing permissions and 21 | * limitations under the License. 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace zxing { 31 | namespace datamatrix { 32 | 33 | using std::size_t; 34 | 35 | class BitMatrixParser: public Counted { 36 | private: 37 | Ref bitMatrix_; 38 | Ref parsedVersion_; 39 | Ref readBitMatrix_; 40 | 41 | int copyBit(size_t x, size_t y, int versionBits); 42 | 43 | public: 44 | BitMatrixParser(Ref bitMatrix); 45 | Ref readVersion(Ref bitMatrix); 46 | ArrayRef readCodewords(); 47 | bool readModule(int row, int column, int numRows, int numColumns); 48 | 49 | private: 50 | int readUtah(int row, int column, int numRows, int numColumns); 51 | int readCorner1(int numRows, int numColumns); 52 | int readCorner2(int numRows, int numColumns); 53 | int readCorner3(int numRows, int numColumns); 54 | int readCorner4(int numRows, int numColumns); 55 | Ref extractDataRegion(Ref bitMatrix); 56 | }; 57 | 58 | } 59 | } 60 | 61 | #endif // __BIT_MATRIX_PARSER_DM_H__ 62 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/HybridBinarizer.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __HYBRIDBINARIZER_H__ 3 | #define __HYBRIDBINARIZER_H__ 4 | /* 5 | * HybridBinarizer.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace zxing { 30 | 31 | class HybridBinarizer: public GlobalHistogramBinarizer { 32 | private: 33 | Ref matrix_; 34 | Ref cached_row_; 35 | 36 | public: 37 | HybridBinarizer(Ref source); 38 | virtual ~HybridBinarizer(); 39 | 40 | virtual Ref getBlackMatrix(); 41 | Ref createBinarizer(Ref source); 42 | private: 43 | // We'll be using one-D arrays because C++ can't dynamically allocate 2D 44 | // arrays 45 | ArrayRef calculateBlackPoints(ArrayRef luminances, int subWidth, 46 | int subHeight, int width, int height); 47 | void calculateThresholdForBlock(ArrayRef luminances, int subWidth, 48 | int subHeight, int width, int height, ArrayRef blackPoints, 49 | Ref const& matrix); 50 | void thresholdBlock(ArrayRef luminances, int xoffset, int yoffset, 51 | int threshold, int stride, Ref const& matrix); 52 | }; 53 | 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/pdf417/decoder/ec/ModulusPoly.h: -------------------------------------------------------------------------------- 1 | #ifndef __MODULUS_GFPOLY_PDF_H__ 2 | #define __MODULUS_GFPOLY_PDF_H__ 3 | 4 | /* 5 | * Copyright 2012 ZXing authors 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * 2012-09-17 HFN translation from Java into C++ 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace zxing { 28 | namespace pdf417 { 29 | namespace decoder { 30 | namespace ec { 31 | 32 | class ModulusGF; 33 | 34 | /** 35 | * @author Sean Owen 36 | * @see com.google.zxing.common.reedsolomon.GenericGFPoly 37 | */ 38 | class ModulusPoly: public Counted { 39 | 40 | private: 41 | ModulusGF &field_; 42 | ArrayRef coefficients_; 43 | public: 44 | ModulusPoly(ModulusGF& field, ArrayRef coefficients); 45 | ~ModulusPoly(); 46 | ArrayRef getCoefficients(); 47 | int getDegree(); 48 | bool isZero(); 49 | int getCoefficient(int degree); 50 | int evaluateAt(int a); 51 | Ref add(Ref other); 52 | Ref subtract(Ref other); 53 | Ref multiply(Ref other); 54 | Ref negative(); 55 | Ref multiply(int scalar); 56 | Ref multiplyByMonomial(int degree, int coefficient); 57 | std::vector > divide(Ref other); 58 | #if 0 59 | public String toString(); 60 | #endif 61 | }; 62 | 63 | } 64 | } 65 | } 66 | } 67 | 68 | #endif /* __MODULUS_GFPOLY_PDF_H__ */ 69 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/qrcode/ErrorCorrectionLevel.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * ErrorCorrectionLevel.cpp 4 | * zxing 5 | * 6 | * Created by Christian Brunschen on 15/05/2008. 7 | * Copyright 2008-2011 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | 24 | using std::string; 25 | 26 | namespace zxing { 27 | namespace qrcode { 28 | 29 | ErrorCorrectionLevel::ErrorCorrectionLevel(int inOrdinal, int bits, 30 | char const* name) : 31 | ordinal_(inOrdinal), bits_(bits), name_(name) { 32 | } 33 | 34 | int ErrorCorrectionLevel::ordinal() const { 35 | return ordinal_; 36 | } 37 | 38 | int ErrorCorrectionLevel::bits() const { 39 | return bits_; 40 | } 41 | 42 | string const& ErrorCorrectionLevel::name() const { 43 | return name_; 44 | } 45 | 46 | ErrorCorrectionLevel::operator string const&() const { 47 | return name_; 48 | } 49 | 50 | ErrorCorrectionLevel& ErrorCorrectionLevel::forBits(int bits) { 51 | if (bits < 0 || bits >= N_LEVELS) { 52 | throw ReaderException("Ellegal error correction level bits"); 53 | } 54 | return *FOR_BITS[bits]; 55 | } 56 | 57 | ErrorCorrectionLevel ErrorCorrectionLevel::L(0, 0x01, "L"); 58 | ErrorCorrectionLevel ErrorCorrectionLevel::M(1, 0x00, "M"); 59 | ErrorCorrectionLevel ErrorCorrectionLevel::Q(2, 0x03, "Q"); 60 | ErrorCorrectionLevel ErrorCorrectionLevel::H(3, 0x02, "H"); 61 | ErrorCorrectionLevel *ErrorCorrectionLevel::FOR_BITS[] = { &M, &L, &H, &Q }; 62 | int ErrorCorrectionLevel::N_LEVELS = 4; 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/PerspectiveTransform.h: -------------------------------------------------------------------------------- 1 | #ifndef __PERSPECTIVE_TANSFORM_H__ 2 | #define __PERSPECTIVE_TANSFORM_H__ 3 | 4 | /* 5 | * PerspectiveTransform.h 6 | * zxing 7 | * 8 | * Copyright 2010 ZXing authors All rights reserved. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | namespace zxing { 27 | class PerspectiveTransform: public Counted { 28 | private: 29 | float a11, a12, a13, a21, a22, a23, a31, a32, a33; 30 | PerspectiveTransform(float a11, float a21, float a31, float a12, float a22, 31 | float a32, float a13, float a23, float a33); 32 | 33 | public: 34 | static Ref 35 | quadrilateralToQuadrilateral(float x0, float y0, float x1, float y1, 36 | float x2, float y2, float x3, float y3, float x0p, float y0p, 37 | float x1p, float y1p, float x2p, float y2p, float x3p, float y3p); 38 | static Ref squareToQuadrilateral(float x0, float y0, 39 | float x1, float y1, float x2, float y2, float x3, float y3); 40 | static Ref quadrilateralToSquare(float x0, float y0, 41 | float x1, float y1, float x2, float y2, float x3, float y3); 42 | Ref buildAdjoint(); 43 | Ref times(Ref other); 44 | void transformPoints(std::vector &points); 45 | 46 | friend std::ostream& operator<<(std::ostream& out, 47 | const PerspectiveTransform &pt); 48 | }; 49 | } 50 | 51 | #endif // __PERSPECTIVE_TANSFORM_H__ 52 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/ITFReader.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | #ifndef __ITF_READER_H__ 3 | #define __ITF_READER_H__ 4 | 5 | /* 6 | * Copyright 2010 ZXing authors All rights reserved. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace zxing { 26 | namespace oned { 27 | 28 | class ITFReader: public OneDReader { 29 | private: 30 | enum { 31 | MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR 32 | * 420 / 1000) 33 | }; 34 | enum { 35 | MAX_INDIVIDUAL_VARIANCE = (int) (PATTERN_MATCH_RESULT_SCALE_FACTOR * 780 36 | / 1000) 37 | }; 38 | // Stores the actual narrow line width of the image being decoded. 39 | int narrowLineWidth; 40 | 41 | Range decodeStart(Ref row); 42 | Range decodeEnd(Ref row); 43 | static void decodeMiddle(Ref row, int payloadStart, 44 | int payloadEnd, std::string& resultString); 45 | void validateQuietZone(Ref row, int startPattern); 46 | static int skipWhiteSpace(Ref row); 47 | 48 | static Range findGuardPattern(Ref row, int rowOffset, 49 | std::vector const& pattern); 50 | static int decodeDigit(std::vector& counters); 51 | 52 | void append(char* s, char c); 53 | public: 54 | Ref decodeRow(int rowNumber, Ref row); 55 | ITFReader(); 56 | ~ITFReader(); 57 | }; 58 | 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/aztec/AztecReader.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * AztecReader.cpp 4 | * zxing 5 | * 6 | * Created by Lukas Stabe on 08/02/2012. 7 | * Copyright 2012 ZXing authors All rights reserved. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | using zxing::Ref; 28 | using zxing::ArrayRef; 29 | using zxing::Result; 30 | using zxing::aztec::AztecReader; 31 | 32 | // VC++ 33 | using zxing::BinaryBitmap; 34 | using zxing::DecodeHints; 35 | 36 | AztecReader::AztecReader() : 37 | decoder_() { 38 | // nothing 39 | } 40 | 41 | Ref AztecReader::decode(Ref image) { 42 | Detector detector(image->getBlackMatrix()); 43 | 44 | Ref detectorResult(detector.detect()); 45 | 46 | ArrayRef > points(detectorResult->getPoints()); 47 | 48 | Ref decoderResult(decoder_.decode(detectorResult)); 49 | 50 | Ref result( 51 | new Result(decoderResult->getText(), decoderResult->getRawBytes(), 52 | points, BarcodeFormat::AZTEC)); 53 | 54 | return result; 55 | } 56 | 57 | Ref AztecReader::decode(Ref image, DecodeHints) { 58 | //cout << "decoding with hints not supported for aztec" << "\n" << flush; 59 | return this->decode(image); 60 | } 61 | 62 | AztecReader::~AztecReader() { 63 | // nothing 64 | } 65 | 66 | zxing::aztec::Decoder& AztecReader::getDecoder() { 67 | return decoder_; 68 | } 69 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Utilities/fat_fs/inc/diskio.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | / Low level disk interface modlue include file R0.07 (C)ChaN, 2009 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO 6 | 7 | #define _READONLY 0 /* 1: Read-only mode */ 8 | #define _USE_IOCTL 1 9 | 10 | #include "integer.h" 11 | 12 | /* Status of Disk Functions */ 13 | typedef BYTE DSTATUS; 14 | 15 | /* Results of Disk Functions */ 16 | typedef enum { 17 | RES_OK = 0, /* 0: Successful */ 18 | RES_ERROR, /* 1: R/W Error */ 19 | RES_WRPRT, /* 2: Write Protected */ 20 | RES_NOTRDY, /* 3: Not Ready */ 21 | RES_PARERR /* 4: Invalid Parameter */ 22 | } DRESULT; 23 | 24 | /*---------------------------------------*/ 25 | /* Prototypes for disk control functions */ 26 | 27 | BOOL assign_drives(int argc, char *argv[]); 28 | DSTATUS disk_initialize(BYTE); 29 | DSTATUS disk_status(BYTE); 30 | DRESULT disk_read(BYTE, BYTE*, DWORD, BYTE); 31 | #if _READONLY == 0 32 | DRESULT disk_write(BYTE, const BYTE*, DWORD, BYTE); 33 | #endif 34 | DRESULT disk_ioctl(BYTE, BYTE, void*); 35 | 36 | /* Disk Status Bits (DSTATUS) */ 37 | 38 | #define STA_NOINIT 0x01 /* Drive not initialized */ 39 | #define STA_NODISK 0x02 /* No medium in the drive */ 40 | #define STA_PROTECT 0x04 /* Write protected */ 41 | 42 | /* Command code for disk_ioctrl() */ 43 | 44 | /* Generic command */ 45 | #define CTRL_SYNC 0 /* Mandatory for write functions */ 46 | #define GET_SECTOR_COUNT 1 /* Mandatory for only f_mkfs() */ 47 | #define GET_SECTOR_SIZE 2 48 | #define GET_BLOCK_SIZE 3 /* Mandatory for only f_mkfs() */ 49 | #define CTRL_POWER 4 50 | #define CTRL_LOCK 5 51 | #define CTRL_EJECT 6 52 | /* MMC/SDC command */ 53 | #define MMC_GET_TYPE 10 54 | #define MMC_GET_CSD 11 55 | #define MMC_GET_CID 12 56 | #define MMC_GET_OCR 13 57 | #define MMC_GET_SDSTAT 14 58 | /* ATA/CF command */ 59 | #define ATA_GET_REV 20 60 | #define ATA_GET_MODEL 21 61 | #define ATA_GET_SN 22 62 | 63 | #define _DISKIO 64 | #endif 65 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/bigint/BigIntegerAlgorithms.cc: -------------------------------------------------------------------------------- 1 | #include "BigIntegerAlgorithms.hh" 2 | 3 | BigUnsigned gcd(BigUnsigned a, BigUnsigned b) { 4 | BigUnsigned trash; 5 | // Neat in-place alternating technique. 6 | for (;;) { 7 | if (b.isZero()) 8 | return a; 9 | a.divideWithRemainder(b, trash); 10 | if (a.isZero()) 11 | return b; 12 | b.divideWithRemainder(a, trash); 13 | } 14 | } 15 | 16 | void extendedEuclidean(BigInteger m, BigInteger n, BigInteger &g, BigInteger &r, 17 | BigInteger &s) { 18 | if (&g == &r || &g == &s || &r == &s) 19 | throw "BigInteger extendedEuclidean: Outputs are aliased"; 20 | BigInteger r1(1), s1(0), r2(0), s2(1), q; 21 | /* Invariants: 22 | * r1*m(orig) + s1*n(orig) == m(current) 23 | * r2*m(orig) + s2*n(orig) == n(current) */ 24 | for (;;) { 25 | if (n.isZero()) { 26 | r = r1; 27 | s = s1; 28 | g = m; 29 | return; 30 | } 31 | // Subtract q times the second invariant from the first invariant. 32 | m.divideWithRemainder(n, q); 33 | r1 -= q * r2; 34 | s1 -= q * s2; 35 | 36 | if (m.isZero()) { 37 | r = r2; 38 | s = s2; 39 | g = n; 40 | return; 41 | } 42 | // Subtract q times the first invariant from the second invariant. 43 | n.divideWithRemainder(m, q); 44 | r2 -= q * r1; 45 | s2 -= q * s1; 46 | } 47 | } 48 | 49 | BigUnsigned modinv(const BigInteger &x, const BigUnsigned &n) { 50 | BigInteger g, r, s; 51 | extendedEuclidean(x, n, g, r, s); 52 | if (g == 1) 53 | // r*x + s*n == 1, so r*x === 1 (mod n), so r is the answer. 54 | return (r % n).getMagnitude(); // (r % n) will be nonnegative 55 | else 56 | throw "BigInteger modinv: x and n have a common factor"; 57 | } 58 | 59 | BigUnsigned modexp(const BigInteger &base, const BigUnsigned &exponent, 60 | const BigUnsigned &modulus) { 61 | BigUnsigned ans = 1, base2 = (base % modulus).getMagnitude(); 62 | BigUnsigned::Index i = exponent.bitLength(); 63 | // For each bit of the exponent, most to least significant... 64 | while (i > 0) { 65 | i--; 66 | // Square. 67 | ans *= ans; 68 | ans %= modulus; 69 | // And multiply if the bit is a 1. 70 | if (exponent.getBit(i)) { 71 | ans *= base2; 72 | ans %= modulus; 73 | } 74 | } 75 | return ans; 76 | } 77 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/common/detector/MonochromeRectangleDetector.h: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | 3 | #ifndef __MONOCHROMERECTANGLEDETECTOR_H__ 4 | #define __MONOCHROMERECTANGLEDETECTOR_H__ 5 | 6 | /* 7 | * MonochromeRectangleDetector.h 8 | * y_wmk 9 | * 10 | * Created by Luiz Silva on 09/02/2010. 11 | * Copyright 2010 y_wmk authors All rights reserved. 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | namespace zxing { 34 | 35 | struct TwoInts: public Counted { 36 | int start; 37 | int end; 38 | }; 39 | 40 | class MonochromeRectangleDetector: public Counted { 41 | private: 42 | static const int MAX_MODULES = 32; 43 | Ref image_; 44 | 45 | public: 46 | MonochromeRectangleDetector(Ref image) : 47 | image_(image) { 48 | } 49 | ; 50 | 51 | std::vector > detect(); 52 | 53 | private: 54 | Ref findCornerFromCenter(int centerX, int deltaX, int left, 55 | int right, int centerY, int deltaY, int top, int bottom, 56 | int maxWhiteRun); 57 | 58 | Ref blackWhiteRange(int fixedDimension, int maxWhiteRun, 59 | int minDim, int maxDim, bool horizontal); 60 | 61 | int max(int a, float b) { 62 | return (float) a > b ? a : (int) b; 63 | } 64 | ; 65 | }; 66 | 67 | } 68 | 69 | #endif // __MONOCHROMERECTANGLEDETECTOR_H__ 70 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Project/OV9655_Camera/src/zxing/oned/EAN8Reader.cpp: -------------------------------------------------------------------------------- 1 | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- 2 | /* 3 | * Copyright 2010 ZXing authors All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #include "EAN8Reader.h" 19 | #include 20 | 21 | using std::vector; 22 | using zxing::oned::EAN8Reader; 23 | 24 | // VC++ 25 | using zxing::Ref; 26 | using zxing::BitArray; 27 | 28 | EAN8Reader::EAN8Reader() : 29 | decodeMiddleCounters(4, 0) { 30 | } 31 | 32 | int EAN8Reader::decodeMiddle(Ref row, Range const& startRange, 33 | std::string& result) { 34 | vector& counters(decodeMiddleCounters); 35 | counters[0] = 0; 36 | counters[1] = 0; 37 | counters[2] = 0; 38 | counters[3] = 0; 39 | 40 | int end = row->getSize(); 41 | int rowOffset = startRange[1]; 42 | 43 | for (int x = 0; x < 4 && rowOffset < end; x++) { 44 | int bestMatch = decodeDigit(row, counters, rowOffset, L_PATTERNS); 45 | result.append(1, (char) ('0' + bestMatch)); 46 | for (int i = 0, end = counters.size(); i < end; i++) { 47 | rowOffset += counters[i]; 48 | } 49 | } 50 | 51 | Range middleRange = findGuardPattern(row, rowOffset, true, MIDDLE_PATTERN); 52 | rowOffset = middleRange[1]; 53 | for (int x = 0; x < 4 && rowOffset < end; x++) { 54 | int bestMatch = decodeDigit(row, counters, rowOffset, L_PATTERNS); 55 | result.append(1, (char) ('0' + bestMatch)); 56 | for (int i = 0, end = counters.size(); i < end; i++) { 57 | rowOffset += counters[i]; 58 | } 59 | } 60 | return rowOffset; 61 | } 62 | 63 | zxing::BarcodeFormat EAN8Reader::getBarcodeFormat() { 64 | return BarcodeFormat::EAN_8; 65 | } 66 | -------------------------------------------------------------------------------- /arm-barcode-scanner/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_otp_if.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 19-March-2012 7 | * @brief Header for usbd_otp_if.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2012 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __OTP_IF_MAL_H 30 | #define __OTP_IF_MAL_H 31 | 32 | /* Includes ------------------------------------------------------------------*/ 33 | #include "usbd_dfu_mal.h" 34 | 35 | /* Exported types ------------------------------------------------------------*/ 36 | /* Exported constants --------------------------------------------------------*/ 37 | #define OTP_START_ADD 0x1FFF7800 38 | #define OTP_END_ADD (uint32_t)(OTP_START_ADD + 528) 39 | 40 | #define OTP_IF_STRING "@OTP Area /0x1FFF7800/01*512 g,01*016 g" 41 | 42 | extern DFU_MAL_Prop_TypeDef DFU_Otp_cb; 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* Exported functions ------------------------------------------------------- */ 46 | 47 | #endif /* __OTP_IF_MAL_H */ 48 | 49 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 50 | --------------------------------------------------------------------------------