Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added QZXing. A wrapper library of C++ part of ZXing written in Qt to…

… make it usable in multiple platforms through the same code: Symbian, Windows, Linux. Very simple interface with some basic functions. The library is also accessible through QML. 2 example programs included. Tutorial contained as well.

git-svn-id: http://zxing.googlecode.com/svn/trunk@2089 59b500cc-1b3d-0410-9834-0bbf25fbcc57
  • Loading branch information...
commit a56e382c8686721c00b947788b1903ae7d75729d 1 parent 3885a7c
ftylitak@gmail.com authored
Showing with 10,313 additions and 3,282 deletions.
  1. BIN  symbian/QQrDecoder/QQrDecoder.sis
  2. +0 −91 symbian/QQrDecoder/QQrDecoder.svg
  3. +0 −25 symbian/QQrDecoder/zxing/Exception.cpp
  4. +0 −168 symbian/QQrDecoder/zxing/common/HybridBinarizer.cpp
  5. +0 −404 symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
  6. +0 −315 symbian/QQrDecoder/zxing/datamatrix/detector/Detector.cpp
  7. +0 −79 symbian/QQrDecoder/zxing/datamatrix/detector/Detector.h
  8. +0 −363 symbian/QQrDecoder/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
  9. +0 −73 symbian/QQrDecoder/zxing/qrcode/decoder/Mode.cpp
  10. +12 −0 symbian/QZXing/binary/Harmattan-Maemo5/QZXing_global.h
  11. BIN  symbian/QZXing/binary/Harmattan-Maemo5/libQZXing.rar
  12. +74 −0 symbian/QZXing/binary/Harmattan-Maemo5/qzxing.h
  13. +1 −0  symbian/QZXing/binary/Harmattan-Maemo5/readme.txt
  14. BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/QZXing_S60_FP1_selfsigned.sis
  15. BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/QZXing_selfsigned.sis
  16. BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/qzxing.sis
  17. +12 −0 symbian/QZXing/binary/Qt_4.6.3_Symbian^1/include/QZXing_global.h
  18. +74 −0 symbian/QZXing/binary/Qt_4.6.3_Symbian^1/include/qzxing.h
  19. BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/release/armv5/lib/QZXing.dso
  20. BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/release/armv5/lib/QZXing{000a0000}.dso
  21. BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/InstallToDevice/QZXing.sis
  22. BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/InstallToDevice/QZXing_selfsigned.sis
  23. +74 −0 symbian/QZXing/binary/Qt_4.7.3_Symbian/include/QZXing.h
  24. +12 −0 symbian/QZXing/binary/Qt_4.7.3_Symbian/include/QZXing_global.h
  25. BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/release/armv5/lib/QZXing.dso
  26. BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/release/armv5/lib/QZXing{00010100}.dso
  27. +74 −0 symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing.h
  28. BIN  symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing1.rar
  29. +12 −0 symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing_global.h
  30. +1 −0  symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/readme.txt
  31. +52 −0 symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner.pro
  32. +716 −0 symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner.pro.user
  33. BIN  symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner.sis
  34. +345 −0 symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner.svg
  35. BIN  symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner_installer.sis
  36. +201 −201 symbian/{QQrDecoder → QZXing/examples/QMLBarcodeScanner}/ZXing_Licence.txt
  37. +17 −0 symbian/QZXing/examples/QMLBarcodeScanner/main.cpp
  38. +71 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/CameraButton.qml
  39. +107 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/CameraPropertyButton.qml
  40. +122 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/CameraPropertyPopup.qml
  41. +237 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/CaptureControls.qml
  42. +85 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/ExposureCompensationButton.qml
  43. +128 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/FlickableList.qml
  44. +26 −3 ...QrDecoder/Nokia_Licence.txt → QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/FocusButton.qml}
  45. +118 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/ZoomControl.qml
  46. +144 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/declarative-camera.qml
  47. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_auto_mode.png
  48. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_camera_setting.png
  49. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_flash_auto.png
  50. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_flash_fill.png
  51. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_flash_off.png
  52. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_flash_redeye.png
  53. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_white_balance_cloudy.png
  54. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_white_balance_flourescent.png
  55. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_white_balance_incandescent.png
  56. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/camera_white_balance_sunny.png
  57. BIN  symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/toolbutton.png
  58. +5 −0 symbian/QZXing/examples/QMLBarcodeScanner/qml/QMLBarcodeScanner/images/toolbutton.sci
  59. +200 −0 symbian/QZXing/examples/QMLBarcodeScanner/qmlapplicationviewer/qmlapplicationviewer.cpp
  60. +47 −0 symbian/QZXing/examples/QMLBarcodeScanner/qmlapplicationviewer/qmlapplicationviewer.h
  61. +146 −0 symbian/QZXing/examples/QMLBarcodeScanner/qmlapplicationviewer/qmlapplicationviewer.pri
  62. 0  symbian/{ → QZXing/examples}/QQrDecoder/CameraImageWrapper.cpp
  63. +1 −0  symbian/{ → QZXing/examples}/QQrDecoder/CameraImageWrapper.h
  64. +5 −3 symbian/{ → QZXing/examples}/QQrDecoder/MyVideoSurface.cpp
  65. +452 −408 symbian/{ → QZXing/examples}/QQrDecoder/QCameraControllerWidget.cpp
  66. +122 −114 symbian/{ → QZXing/examples}/QQrDecoder/QCameraControllerWidget.h
  67. +9 −41 symbian/{ → QZXing/examples}/QQrDecoder/QQrDecoder.cpp
  68. +3 −8 symbian/{ → QZXing/examples}/QQrDecoder/QQrDecoder.h
  69. +53 −0 symbian/QZXing/examples/QQrDecoder/QQrDecoder.pro
  70. BIN  symbian/QZXing/examples/QQrDecoder/QQrDecoder.sis
  71. +356 −0 symbian/QZXing/examples/QQrDecoder/QQrDecoder.svg
  72. 0  symbian/{ → QZXing/examples}/QQrDecoder/QQrDecoder.ui
  73. +201 −0 symbian/QZXing/examples/QQrDecoder/ZXing_Licence.txt
  74. +139 −110 symbian/{ → QZXing/examples}/QQrDecoder/button.cpp
  75. +77 −72 symbian/{ → QZXing/examples}/QQrDecoder/button.h
  76. BIN  symbian/QZXing/examples/QQrDecoder/icons/camera.png
  77. BIN  symbian/QZXing/examples/QQrDecoder/icons/flash.png
  78. 0  symbian/{ → QZXing/examples}/QQrDecoder/icons/zoomIn.png
  79. 0  symbian/{ → QZXing/examples}/QQrDecoder/icons/zoomOut.png
  80. 0  symbian/{ → QZXing/examples}/QQrDecoder/main.cpp
  81. 0  symbian/{ → QZXing/examples}/QQrDecoder/myvideosurface.h
  82. +7 −6 symbian/{ → QZXing/examples}/QQrDecoder/resources.qrc
  83. 0  symbian/{ → QZXing/examples}/QQrDecoder_tutorial.txt
  84. +146 −0 symbian/QZXing/source/CameraImageWrapper.cpp
  85. +47 −0 symbian/QZXing/source/CameraImageWrapper.h
  86. +95 −41 symbian/{QQrDecoder/QQrDecoder.pro → QZXing/source/QZXing.pro}
  87. +12 −0 symbian/QZXing/source/QZXing_global.h
  88. +102 −0 symbian/QZXing/source/eabi/QZXingu.def
  89. +6 −0 symbian/QZXing/source/qtc_packaging/debian_fremantle/README
  90. +5 −0 symbian/QZXing/source/qtc_packaging/debian_fremantle/changelog
  91. +1 −0  symbian/QZXing/source/qtc_packaging/debian_fremantle/compat
  92. +15 −0 symbian/QZXing/source/qtc_packaging/debian_fremantle/control
  93. +40 −0 symbian/QZXing/source/qtc_packaging/debian_fremantle/copyright
  94. +91 −0 symbian/QZXing/source/qtc_packaging/debian_fremantle/rules
  95. +6 −0 symbian/QZXing/source/qtc_packaging/debian_harmattan/README
  96. +5 −0 symbian/QZXing/source/qtc_packaging/debian_harmattan/changelog
  97. +1 −0  symbian/QZXing/source/qtc_packaging/debian_harmattan/compat
  98. +15 −0 symbian/QZXing/source/qtc_packaging/debian_harmattan/control
  99. +40 −0 symbian/QZXing/source/qtc_packaging/debian_harmattan/copyright
  100. 0  symbian/QZXing/source/qtc_packaging/debian_harmattan/manifest.aegis
  101. +91 −0 symbian/QZXing/source/qtc_packaging/debian_harmattan/rules
  102. +86 −0 symbian/QZXing/source/qzxing.cpp
  103. +74 −0 symbian/QZXing/source/qzxing.h
  104. 0  symbian/{QQrDecoder → QZXing/source}/zxing/BarcodeFormat.cpp
  105. 0  symbian/{QQrDecoder → QZXing/source}/zxing/BarcodeFormat.h
  106. +2 −1  symbian/{QQrDecoder → QZXing/source}/zxing/Binarizer.cpp
  107. 0  symbian/{QQrDecoder → QZXing/source}/zxing/Binarizer.h
  108. 0  symbian/{QQrDecoder → QZXing/source}/zxing/BinaryBitmap.cpp
  109. 0  symbian/{QQrDecoder → QZXing/source}/zxing/BinaryBitmap.h
  110. +8 −2 symbian/{QQrDecoder → QZXing/source}/zxing/DecodeHints.cpp
  111. +8 −6 symbian/{QQrDecoder → QZXing/source}/zxing/DecodeHints.h
  112. +40 −0 symbian/QZXing/source/zxing/Exception.cpp
  113. +1 −0  symbian/{QQrDecoder → QZXing/source}/zxing/Exception.h
  114. +11 −3 symbian/{QQrDecoder/zxing/ResultPoint.cpp → QZXing/source/zxing/FormatException.cpp}
  115. +9 −13 symbian/{QQrDecoder/zxing/ResultPoint.h → QZXing/source/zxing/FormatException.h}
  116. +29 −0 symbian/{QQrDecoder → QZXing/source}/zxing/LuminanceSource.cpp
  117. +3 −0  symbian/{QQrDecoder → QZXing/source}/zxing/LuminanceSource.h
  118. +5 −5 symbian/{QQrDecoder → QZXing/source}/zxing/MultiFormatReader.cpp
  119. 0  symbian/{QQrDecoder → QZXing/source}/zxing/MultiFormatReader.h
  120. +28 −0 symbian/QZXing/source/zxing/NotFoundException.cpp
  121. +33 −0 symbian/QZXing/source/zxing/NotFoundException.h
  122. 0  symbian/{QQrDecoder → QZXing/source}/zxing/Reader.cpp
  123. 0  symbian/{QQrDecoder → QZXing/source}/zxing/Reader.h
  124. +4 −1 symbian/{QQrDecoder → QZXing/source}/zxing/ReaderException.cpp
  125. +1 −0  symbian/{QQrDecoder → QZXing/source}/zxing/ReaderException.h
  126. +6 −1 symbian/{QQrDecoder → QZXing/source}/zxing/Result.cpp
  127. +1 −0  symbian/{QQrDecoder → QZXing/source}/zxing/Result.h
  128. +100 −0 symbian/QZXing/source/zxing/ResultPoint.cpp
  129. +54 −0 symbian/QZXing/source/zxing/ResultPoint.h
  130. 0  symbian/{QQrDecoder → QZXing/source}/zxing/ResultPointCallback.cpp
  131. 0  symbian/{QQrDecoder → QZXing/source}/zxing/ResultPointCallback.h
  132. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/Array.cpp
  133. +208 −207 symbian/{QQrDecoder → QZXing/source}/zxing/common/Array.h
  134. +27 −8 symbian/{QQrDecoder → QZXing/source}/zxing/common/BitArray.cpp
  135. +11 −2 symbian/{QQrDecoder → QZXing/source}/zxing/common/BitArray.h
  136. +33 −49 symbian/{QQrDecoder → QZXing/source}/zxing/common/BitMatrix.cpp
  137. +25 −3 symbian/{QQrDecoder → QZXing/source}/zxing/common/BitMatrix.h
  138. +0 −1  symbian/{QQrDecoder → QZXing/source}/zxing/common/BitSource.cpp
  139. +3 −0  symbian/{QQrDecoder → QZXing/source}/zxing/common/BitSource.h
  140. +87 −0 symbian/QZXing/source/zxing/common/CharacterSetECI.cpp
  141. +53 −0 symbian/QZXing/source/zxing/common/CharacterSetECI.h
  142. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/Counted.cpp
  143. +2 −3 symbian/{QQrDecoder → QZXing/source}/zxing/common/Counted.h
  144. +16 −7 symbian/{QQrDecoder → QZXing/source}/zxing/common/DecoderResult.cpp
  145. +8 −0 symbian/{QQrDecoder → QZXing/source}/zxing/common/DecoderResult.h
  146. +2 −1  symbian/{QQrDecoder → QZXing/source}/zxing/common/DetectorResult.cpp
  147. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/DetectorResult.h
  148. +39 −0 symbian/QZXing/source/zxing/common/ECI.cpp
  149. +40 −0 symbian/QZXing/source/zxing/common/ECI.h
  150. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/EdgeDetector.cpp
  151. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/EdgeDetector.h
  152. +5 −5 symbian/{QQrDecoder → QZXing/source}/zxing/common/GlobalHistogramBinarizer.cpp
  153. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GlobalHistogramBinarizer.h
  154. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GreyscaleLuminanceSource.cpp
  155. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GreyscaleLuminanceSource.h
  156. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GreyscaleRotatedLuminanceSource.cpp
  157. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GreyscaleRotatedLuminanceSource.h
  158. +21 −0 symbian/{QQrDecoder → QZXing/source}/zxing/common/GridSampler.cpp
  159. +2 −0  symbian/{QQrDecoder → QZXing/source}/zxing/common/GridSampler.h
  160. +211 −0 symbian/QZXing/source/zxing/common/HybridBinarizer.cpp
  161. +23 −10 symbian/{QQrDecoder → QZXing/source}/zxing/common/HybridBinarizer.h
  162. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/IllegalArgumentException.cpp
  163. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/IllegalArgumentException.h
  164. +196 −196 symbian/{QQrDecoder → QZXing/source}/zxing/common/LocalBlockBinarizer.cpp
  165. +47 −47 symbian/{QQrDecoder → QZXing/source}/zxing/common/LocalBlockBinarizer.h
  166. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/PerspectiveTransform.cpp
  167. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/PerspectiveTransform.h
  168. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/Point.h
  169. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/Str.cpp
  170. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/Str.h
  171. +175 −0 symbian/QZXing/source/zxing/common/StringUtils.cpp
  172. +52 −0 symbian/QZXing/source/zxing/common/StringUtils.h
  173. +171 −0 symbian/QZXing/source/zxing/common/detector/MonochromeRectangleDetector.cpp
  174. +60 −0 symbian/QZXing/source/zxing/common/detector/MonochromeRectangleDetector.h
  175. +315 −0 symbian/QZXing/source/zxing/common/detector/WhiteRectangleDetector.cpp
  176. +56 −0 symbian/QZXing/source/zxing/common/detector/WhiteRectangleDetector.h
  177. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/GF256.cpp
  178. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/GF256.h
  179. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/GF256Poly.cpp
  180. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/GF256Poly.h
  181. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/ReedSolomonDecoder.cpp
  182. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/ReedSolomonDecoder.h
  183. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/ReedSolomonException.cpp
  184. 0  symbian/{QQrDecoder → QZXing/source}/zxing/common/reedsolomon/ReedSolomonException.h
  185. +1 −1  symbian/{QQrDecoder → QZXing/source}/zxing/datamatrix/DataMatrixReader.cpp
  186. +1 −1  symbian/{QQrDecoder → QZXing/source}/zxing/datamatrix/DataMatrixReader.h
  187. +2 −2 symbian/{QQrDecoder/zxing/datamatrix/Version.cpp → QZXing/source/zxing/datamatrix/VersionDM.cpp}
  188. +3 −3 symbian/{QQrDecoder/zxing/datamatrix/Version.h → QZXing/source/zxing/datamatrix/VersionDM.h}
  189. +14 −17 ...datamatrix/decoder/BitMatrixParser.cpp → QZXing/source/zxing/datamatrix/decoder/BitMatrixParserDM.cpp}
  190. +1 −1  ...ing/datamatrix/decoder/BitMatrixParser.h → QZXing/source/zxing/datamatrix/decoder/BitMatrixParserDM.h}
  191. +1 −1  ...coder/zxing/datamatrix/decoder/DataBlock.cpp → QZXing/source/zxing/datamatrix/decoder/DataBlockDM.cpp}
  192. +1 −1  ...QrDecoder/zxing/datamatrix/decoder/DataBlock.h → QZXing/source/zxing/datamatrix/decoder/DataBlockDM.h}
  193. +417 −0 symbian/QZXing/source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.cpp
  194. +4 −3 .../decoder/DecodedBitStreamParser.h → QZXing/source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.h}
  195. +39 −41 ...QrDecoder/zxing/datamatrix/decoder/Decoder.cpp → QZXing/source/zxing/datamatrix/decoder/DecoderDM.cpp}
  196. 0  ...n/{QQrDecoder/zxing/datamatrix/decoder/Decoder.h → QZXing/source/zxing/datamatrix/decoder/DecoderDM.h}
  197. +1 −9 symbian/{QQrDecoder → QZXing/source}/zxing/datamatrix/detector/CornerPoint.cpp
  198. +0 −4 symbian/{QQrDecoder → QZXing/source}/zxing/datamatrix/detector/CornerPoint.h
  199. +434 −0 symbian/QZXing/source/zxing/datamatrix/detector/DetectorDM.cpp
  200. +94 −0 symbian/QZXing/source/zxing/datamatrix/detector/DetectorDM.h
  201. +23 −0 symbian/QZXing/source/zxing/datamatrix/detector/DetectorException.cpp
  202. +23 −0 symbian/QZXing/source/zxing/datamatrix/detector/DetectorException.h
  203. +3 −3 ...romeRectangleDetector.cpp → QZXing/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.cpp}
  204. +8 −8 ...nochromeRectangleDetector.h → QZXing/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.h}
  205. +71 −0 symbian/QZXing/source/zxing/multi/ByQuadrantReader.cpp
  206. +40 −0 symbian/QZXing/source/zxing/multi/ByQuadrantReader.h
  207. +128 −0 symbian/QZXing/source/zxing/multi/GenericMultipleBarcodeReader.cpp
  208. +47 −0 symbian/QZXing/source/zxing/multi/GenericMultipleBarcodeReader.h
  209. +29 −0 symbian/QZXing/source/zxing/multi/MultipleBarcodeReader.cpp
  210. +39 −0 symbian/QZXing/source/zxing/multi/MultipleBarcodeReader.h
  211. +57 −0 symbian/QZXing/source/zxing/multi/qrcode/QRCodeMultiReader.cpp
  212. +34 −0 symbian/QZXing/source/zxing/multi/qrcode/QRCodeMultiReader.h
  213. +46 −0 symbian/QZXing/source/zxing/multi/qrcode/detector/MultiDetector.cpp
  214. +35 −0 symbian/QZXing/source/zxing/multi/qrcode/detector/MultiDetector.h
  215. +225 −0 symbian/QZXing/source/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp
  216. +45 −0 symbian/QZXing/source/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h
  217. +16 −4 symbian/{QQrDecoder → QZXing/source}/zxing/oned/Code128Reader.cpp
  218. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/Code128Reader.h
  219. +8 −2 symbian/{QQrDecoder → QZXing/source}/zxing/oned/Code39Reader.cpp
  220. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/Code39Reader.h
  221. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/EAN13Reader.cpp
  222. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/EAN13Reader.h
  223. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/EAN8Reader.cpp
  224. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/EAN8Reader.h
  225. +3 −3 symbian/{QQrDecoder → QZXing/source}/zxing/oned/ITFReader.cpp
  226. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/ITFReader.h
  227. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/MultiFormatOneDReader.cpp
  228. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/MultiFormatOneDReader.h
  229. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/MultiFormatUPCEANReader.cpp
  230. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/MultiFormatUPCEANReader.h
  231. +4 −3 symbian/{QQrDecoder → QZXing/source}/zxing/oned/OneDReader.cpp
  232. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/OneDReader.h
  233. +1 −9 symbian/{QQrDecoder → QZXing/source}/zxing/oned/OneDResultPoint.cpp
  234. +0 −5 symbian/{QQrDecoder → QZXing/source}/zxing/oned/OneDResultPoint.h
  235. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCAReader.cpp
  236. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCAReader.h
  237. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCEANReader.cpp
  238. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCEANReader.h
  239. +1 −1  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCEReader.cpp
  240. 0  symbian/{QQrDecoder → QZXing/source}/zxing/oned/UPCEReader.h
  241. +25 −9 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/ErrorCorrectionLevel.cpp
  242. +8 −2 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/ErrorCorrectionLevel.h
  243. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/FormatInformation.cpp
  244. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/FormatInformation.h
  245. +4 −0 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/QRCodeReader.cpp
  246. +4 −0 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/QRCodeReader.h
  247. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/Version.cpp
  248. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/Version.h
  249. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/BitMatrixParser.cpp
  250. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/BitMatrixParser.h
  251. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/DataBlock.cpp
  252. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/DataBlock.h
  253. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/DataMask.cpp
  254. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/DataMask.h
  255. +402 −0 symbian/QZXing/source/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
  256. +25 −12 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/DecodedBitStreamParser.h
  257. +5 −6 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/Decoder.cpp
  258. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/Decoder.h
  259. +86 −0 symbian/QZXing/source/zxing/qrcode/decoder/Mode.cpp
  260. +9 −1 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/decoder/Mode.h
  261. +15 −10 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/AlignmentPattern.cpp
  262. +4 −4 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/AlignmentPattern.h
  263. +2 −2 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/AlignmentPatternFinder.cpp
  264. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/AlignmentPatternFinder.h
  265. +6 −2 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/Detector.cpp
  266. +3 −1 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/Detector.h
  267. +22 −9 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPattern.cpp
  268. +4 −5 symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPattern.h
  269. +2 −1  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPatternFinder.cpp
  270. +2 −0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPatternFinder.h
  271. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPatternInfo.cpp
  272. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/FinderPatternInfo.h
  273. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/QREdgeDetector.cpp
  274. 0  symbian/{QQrDecoder → QZXing/source}/zxing/qrcode/detector/QREdgeDetector.h
  275. +139 −0 symbian/QZXing_tutorial.txt
View
BIN  symbian/QQrDecoder/QQrDecoder.sis
Binary file not shown
View
91 symbian/QQrDecoder/QQrDecoder.svg
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
-<svg version="1.2" baseProfile="tiny" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- x="0px" y="0px" width="135px" height="135px" viewBox="0 0 135 135" xml:space="preserve">
-<image width="135" height="135" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA
-EAMCAwYAAALJAAAGlAAAErr/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX
-Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa
-JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAIcAhwMBIgACEQEDEQH/
-xACvAAACAwEBAQAAAAAAAAAAAAAABQMEBgIBBwEBAAAAAAAAAAAAAAAAAAAAABAAAgICAQIFAwMF
-AAAAAAAAAwQCBQEGAAcXERITFDUzFTdgIxZAMSI0NhEAAgECAwQECggDAw0AAAAAAQIDABEhEgQx
-QSITUWEyBXGRQlKSs9MUNHSBobHB0eFyIxBissIzBkDxgqLSg5PDJIQVNRYSAQAAAAAAAAAAAAAA
-AAAAAGD/2gAMAwEAAhEDEQAAANFjdBaMqaC4ZPZY3ZFpWvsGmtZnADXZIGplxg2MyaAGQtACwfJ9
-A9YCL6h8v+oHyG9p6BfW1HAltQ2STDa0MF9QVNQALWR3OSDi90Kb8dgqRTRHXfkhz3UCLlxwKeHa
-01pIFZG7RnttVbJl7CgTc9zlC1bmF0L2oVe/ahVt1rhoDoI0z7MEvXdUl8i9KlyT0tt1j4VxP0ZC
-iZ1T2vbomtJQjy2lQks0HpDVvAtar4TTd0gZU4+y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SK5
-c52aQ3KyKNrdFfD6T0JPbV8PpPQk9tSazWJGkiRiICIMq5VZn8tmx4qTR6x5EjSQSgxFVbMqsnlq
-2HFSdxxvIdK0+niLsV5mWYRlsQoW/GbYVqPcpJpPecmfnMrW5ea2XIiefU+sln1Qk1EjyuFeMKGk
-YubXiOGNPo9G8jxvIZSZSrNmZVTyFXDhrUfKP6yGp9ZEAZNPJp5UDXKlo4onF7EYYV8PpPQk9tWl
-/wAUGSb37VJ73JHmXkiTVIS4VcmbKOYbcXjrT/KJ6yavh9J6EntqfvyRIxqlg1EoRQ3LzQmQLgWL
-W4BfH/Iv/9k=">
-</image>
-</svg>
View
25 symbian/QQrDecoder/zxing/Exception.cpp
@@ -1,25 +0,0 @@
-/*
- * Exception.cpp
- * ZXing
- *
- * Created by Christian Brunschen on 03/06/2008.
- * Copyright 2008 ZXing authors All rights reserved.
- *
- */
-
-#include <zxing/Exception.h>
-
-namespace zxing {
-
-Exception::Exception(const char *msg) :
- message(msg) {
-}
-
-const char* Exception::what() const throw() {
- return message.c_str();
-}
-
-Exception::~Exception() throw() {
-}
-
-}
View
168 symbian/QQrDecoder/zxing/common/HybridBinarizer.cpp
@@ -1,168 +0,0 @@
-/*
- * HybridBinarizer.cpp
- * zxing
- *
- * Copyright 2010 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <zxing/common/HybridBinarizer.h>
-
-#include <zxing/common/IllegalArgumentException.h>
-
-namespace zxing {
-using namespace std;
-
-static const int MINIMUM_DIMENSION = 40;
-
-static const int LUMINANCE_BITS = 5;
-static const int LUMINANCE_SHIFT = 8 - LUMINANCE_BITS;
-static const int LUMINANCE_BUCKETS = 1 << LUMINANCE_BITS;
-
-HybridBinarizer::HybridBinarizer(Ref<LuminanceSource> source) :
- GlobalHistogramBinarizer(source), cached_matrix_(NULL), cached_row_(NULL), cached_row_num_(-1) {
-
-}
-
-HybridBinarizer::~HybridBinarizer() {
-}
-
-
-Ref<BitMatrix> HybridBinarizer::getBlackMatrix() {
- binarizeEntireImage();
- return cached_matrix_;
-}
-
-Ref<Binarizer> HybridBinarizer::createBinarizer(Ref<LuminanceSource> source) {
- return Ref<Binarizer> (new HybridBinarizer(source));
-}
-
-void HybridBinarizer::binarizeEntireImage() {
- if (cached_matrix_ == NULL) {
- Ref<LuminanceSource> source = getLuminanceSource();
- if (source->getWidth() >= MINIMUM_DIMENSION && source->getHeight() >= MINIMUM_DIMENSION) {
- unsigned char* luminances = source->getMatrix();
- int width = source->getWidth();
- int height = source->getHeight();
- int subWidth = width >> 3;
- if (width & 0x07) {
- subWidth++;
- }
- int subHeight = height >> 3;
- if (height & 0x07) {
- subHeight++;
- }
- int *blackPoints = calculateBlackPoints(luminances, subWidth, subHeight, width, height);
- cached_matrix_.reset(new BitMatrix(width,height));
- calculateThresholdForBlock(luminances, subWidth, subHeight, width, height, blackPoints, cached_matrix_);
- delete [] blackPoints;
- delete [] luminances;
- } else {
- // If the image is too small, fall back to the global histogram approach.
- cached_matrix_.reset(GlobalHistogramBinarizer::getBlackMatrix());
- }
- }
-}
-
-void HybridBinarizer::calculateThresholdForBlock(unsigned char* luminances, int subWidth, int subHeight,
- int width, int height, int blackPoints[], Ref<BitMatrix> matrix) {
- for (int y = 0; y < subHeight; y++) {
- int yoffset = y << 3;
- if (yoffset + 8 >= height) {
- yoffset = height - 8;
- }
- for (int x = 0; x < subWidth; x++) {
- int xoffset = x << 3;
- if (xoffset + 8 >= width) {
- xoffset = width - 8;
- }
- int left = (x > 1) ? x : 2;
- left = (left < subWidth - 2) ? left : subWidth - 3;
- int top = (y > 1) ? y : 2;
- top = (top < subHeight - 2) ? top : subHeight - 3;
- int sum = 0;
- for (int z = -2; z <= 2; z++) {
- int *blackRow = &blackPoints[(top + z) * subWidth];
- sum += blackRow[left - 2];
- sum += blackRow[left - 1];
- sum += blackRow[left];
- sum += blackRow[left + 1];
- sum += blackRow[left + 2];
- }
- int average = sum / 25;
- threshold8x8Block(luminances, xoffset, yoffset, average, width, matrix);
- }
- }
-}
-
-void HybridBinarizer::threshold8x8Block(unsigned char* luminances, int xoffset, int yoffset, int threshold,
- int stride, Ref<BitMatrix> matrix) {
- for (int y = 0; y < 8; y++) {
- int offset = (yoffset + y) * stride + xoffset;
- for (int x = 0; x < 8; x++) {
- int pixel = luminances[offset + x] & 0xff;
- if (pixel < threshold) {
- matrix->set(xoffset + x, yoffset + y);
- }
- }
- }
-}
-
-int* HybridBinarizer::calculateBlackPoints(unsigned char* luminances, int subWidth, int subHeight,
- int width, int height) {
- int *blackPoints = new int[subHeight * subWidth];
- for (int y = 0; y < subHeight; y++) {
- int yoffset = y << 3;
- if (yoffset + 8 >= height) {
- yoffset = height - 8;
- }
- for (int x = 0; x < subWidth; x++) {
- int xoffset = x << 3;
- if (xoffset + 8 >= width) {
- xoffset = width - 8;
- }
- int sum = 0;
- int min = 255;
- int max = 0;
- for (int yy = 0; yy < 8; yy++) {
- int offset = (yoffset + yy) * width + xoffset;
- for (int xx = 0; xx < 8; xx++) {
- int pixel = luminances[offset + xx] & 0xff;
- sum += pixel;
- if (pixel < min) {
- min = pixel;
- }
- if (pixel > max) {
- max = pixel;
- }
- }
- }
-
- // If the contrast is inadequate, use half the minimum, so that this block will be
- // treated as part of the white background, but won't drag down neighboring blocks
- // too much.
- int average;
- if (max - min > 24) {
- average = (sum >> 6);
- } else {
- average = max == 0 ? 1 : (min >> 1);
- }
- blackPoints[y * subWidth + x] = average;
- }
- }
- return blackPoints;
-}
-
-} // namespace zxing
-
View
404 symbian/QQrDecoder/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp
@@ -1,404 +0,0 @@
-/*
- * DecodedBitStreamParser.cpp
- * zxing
- *
- * Created by Luiz Silva on 09/02/2010.
- * Copyright 2010 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <zxing/ReaderException.h>
-#include <zxing/datamatrix/decoder/DecodedBitStreamParser.h>
-#include <iostream>
-
-namespace zxing {
-namespace datamatrix {
-
-using namespace std;
-
-const char DecodedBitStreamParser::C40_BASIC_SET_CHARS[] = {
- '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
- 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
- };
-
-const char DecodedBitStreamParser::C40_SHIFT2_SET_CHARS[] = {
- '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.',
- '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'
-};
-
-const char DecodedBitStreamParser::TEXT_BASIC_SET_CHARS[] = {
- '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
- };
-
-const char DecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = {
- '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
- 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (char) 127
-};
-
-std::string DecodedBitStreamParser::decode(ArrayRef<unsigned char> bytes) {
- Ref<BitSource> bits(new BitSource(bytes));
- ostringstream result;
- ostringstream resultTrailer;
-// bool trailer = false;
- int mode = ASCII_ENCODE;
- do {
- if (mode == ASCII_ENCODE) {
- mode = decodeAsciiSegment(bits, result, resultTrailer);
- } else {
- switch (mode) {
- case C40_ENCODE:
- decodeC40Segment(bits, result);
- break;
- case TEXT_ENCODE:
- decodeTextSegment(bits, result);
- break;
- case ANSIX12_ENCODE:
- decodeAnsiX12Segment(bits, result);
- break;
- case EDIFACT_ENCODE:
- decodeEdifactSegment(bits, result);
- break;
- case BASE256_ENCODE:
- decodeBase256Segment(bits, result);
- break;
- default:
- throw ReaderException("Unsupported mode indicator");
- }
- mode = ASCII_ENCODE;
- }
- } while (mode != PAD_ENCODE && bits->available() > 0);
-/* if (trailer) {
- result << resultTrailer;
- }
-*/
- return result.str();
-}
-
-int DecodedBitStreamParser::decodeAsciiSegment(Ref<BitSource> bits, ostringstream & result,
- ostringstream & resultTrailer) {
- bool upperShift = false;
- do {
- int oneByte = bits->readBits(8);
- if (oneByte == 0) {
- throw ReaderException("Not enough bits to decode");
- } else if (oneByte <= 128) { // ASCII data (ASCII value + 1)
- oneByte = upperShift ? (oneByte + 128) : oneByte;
- upperShift = false;
- result << (char) (oneByte - 1);
- return ASCII_ENCODE;
- } else if (oneByte == 129) { // Pad
- return PAD_ENCODE;
- } else if (oneByte <= 229) { // 2-digit data 00-99 (Numeric Value + 130)
- int value = oneByte - 130;
- if (value < 10) { // padd with '0' for single digit values
- result << '0';
- }
- result << value;
- } else if (oneByte == 230) { // Latch to C40 encodation
- return C40_ENCODE;
- } else if (oneByte == 231) { // Latch to Base 256 encodation
- return BASE256_ENCODE;
- } else if (oneByte == 232) { // FNC1
- //throw ReaderException.getInstance();
- // Ignore this symbol for now
- } else if (oneByte == 233) { // Structured Append
- //throw ReaderException.getInstance();
- // Ignore this symbol for now
- } else if (oneByte == 234) { // Reader Programming
- //throw ReaderException.getInstance();
- // Ignore this symbol for now
- } else if (oneByte == 235) { // Upper Shift (shift to Extended ASCII)
- upperShift = true;
- } else if (oneByte == 236) { // 05 Macro
- /* trailer = false;
- result << "[)>\u001E05\u001D";
- resultTrailer << "\u001E\u0004";
- // Ignore this symbol for now
- */ } else if (oneByte == 237) { // 06 Macro
- /* trailer = false;
- result << "[)>\u001E06\u001D";
- resultTrailer << "\u001E\u0004";
- // Ignore this symbol for now
- */ } else if (oneByte == 238) { // Latch to ANSI X12 encodation
- return ANSIX12_ENCODE;
- } else if (oneByte == 239) { // Latch to Text encodation
- return TEXT_ENCODE;
- } else if (oneByte == 240) { // Latch to EDIFACT encodation
- return EDIFACT_ENCODE;
- } else if (oneByte == 241) { // ECI Character
- // TODO(bbrown): I think we need to support ECI
- //throw ReaderException.getInstance();
- // Ignore this symbol for now
- } else if (oneByte >= 242) { // Not to be used in ASCII encodation
- throw ReaderException("Not to be used in ASCII encodation");
- }
- } while (bits->available() > 0);
- return ASCII_ENCODE;
-}
-
-void DecodedBitStreamParser::decodeC40Segment(Ref<BitSource> bits, ostringstream & result) {
- // Three C40 values are encoded in a 16-bit value as
- // (1600 * C1) + (40 * C2) + C3 + 1
- // TODO(bbrown): The Upper Shift with C40 doesn't work in the 4 value scenario all the time
- bool upperShift = false;
-
- int* cValues = new int[3];
- do {
- // If there is only one byte left then it will be encoded as ASCII
- if (bits->available() == 8) {
- return;
- }
- int firstByte = bits->readBits(8);
- if (firstByte == 254) { // Unlatch codeword
- return;
- }
-
- parseTwoBytes(firstByte, bits->readBits(8), cValues);
-
- int shift = 0;
- for (int i = 0; i < 3; i++) {
- int cValue = cValues[i];
- switch (shift) {
- case 0:
- if (cValue < 3) {
- shift = cValue + 1;
- } else {
- if (upperShift) {
- result << (char) (C40_BASIC_SET_CHARS[cValue] + 128);
- upperShift = false;
- } else {
- result << C40_BASIC_SET_CHARS[cValue];
- }
- }
- break;
- case 1:
- if (upperShift) {
- result << cValue + 128;
- upperShift = false;
- } else {
- result << cValue;
- }
- shift = 0;
- break;
- case 2:
- if (cValue < 27) {
- if (upperShift) {
- result << (char) (C40_SHIFT2_SET_CHARS[cValue] + 128);
- upperShift = false;
- } else {
- result << C40_SHIFT2_SET_CHARS[cValue];
- }
- } else if (cValue == 27) { // FNC1
- throw ReaderException("FNC1");
- } else if (cValue == 30) { // Upper Shift
- upperShift = true;
- } else {
- throw ReaderException("Upper Shift");
- }
- shift = 0;
- break;
- case 3:
- if (upperShift) {
- result << (char) (cValue + 224);
- upperShift = false;
- } else {
- result << (char) (cValue + 96);
- }
- shift = 0;
- break;
- default:
- throw ReaderException("");
- }
- }
- } while (bits->available() > 0);
-}
-
-void DecodedBitStreamParser::decodeTextSegment(Ref<BitSource> bits, ostringstream & result) {
- // Three Text values are encoded in a 16-bit value as
- // (1600 * C1) + (40 * C2) + C3 + 1
- // TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time
- bool upperShift = false;
-
- int* cValues = new int[3];
- do {
- // If there is only one byte left then it will be encoded as ASCII
- if (bits->available() == 8) {
- return;
- }
- int firstByte = bits->readBits(8);
- if (firstByte == 254) { // Unlatch codeword
- return;
- }
-
- parseTwoBytes(firstByte, bits->readBits(8), cValues);
-
- int shift = 0;
- for (int i = 0; i < 3; i++) {
- int cValue = cValues[i];
- switch (shift) {
- case 0:
- if (cValue < 3) {
- shift = cValue + 1;
- } else {
- if (upperShift) {
- result << (char) (TEXT_BASIC_SET_CHARS[cValue] + 128);
- upperShift = false;
- } else {
- result << (TEXT_BASIC_SET_CHARS[cValue]);
- }
- }
- break;
- case 1:
- if (upperShift) {
- result << (char) (cValue + 128);
- upperShift = false;
- } else {
- result << (cValue);
- }
- shift = 0;
- break;
- case 2:
- // Shift 2 for Text is the same encoding as C40
- if (cValue < 27) {
- if (upperShift) {
- result << (char) (C40_SHIFT2_SET_CHARS[cValue] + 128);
- upperShift = false;
- } else {
- result << (C40_SHIFT2_SET_CHARS[cValue]);
- }
- } else if (cValue == 27) { // FNC1
- throw ReaderException("FNC1");
- } else if (cValue == 30) { // Upper Shift
- upperShift = true;
- } else {
- throw ReaderException("Upper Shift");
- }
- shift = 0;
- break;
- case 3:
- if (upperShift) {
- result << (char) (TEXT_SHIFT3_SET_CHARS[cValue] + 128);
- upperShift = false;
- } else {
- result << (TEXT_SHIFT3_SET_CHARS[cValue]);
- }
- shift = 0;
- break;
- default:
- throw ReaderException("");
- }
- }
- } while (bits->available() > 0);
-}
-
-void DecodedBitStreamParser::decodeAnsiX12Segment(Ref<BitSource> bits, ostringstream & result) {
- // Three ANSI X12 values are encoded in a 16-bit value as
- // (1600 * C1) + (40 * C2) + C3 + 1
-
- int* cValues = new int[3];
- do {
- // If there is only one byte left then it will be encoded as ASCII
- if (bits->available() == 8) {
- return;
- }
- int firstByte = bits->readBits(8);
- if (firstByte == 254) { // Unlatch codeword
- return;
- }
-
- parseTwoBytes(firstByte, bits->readBits(8), cValues);
-
- for (int i = 0; i < 3; i++) {
- int cValue = cValues[i];
- if (cValue == 0) { // X12 segment terminator <CR>
- result << '\r';
- } else if (cValue == 1) { // X12 segment separator *
- result << '*';
- } else if (cValue == 2) { // X12 sub-element separator >
- result << '>';
- } else if (cValue == 3) { // space
- result << ' ';
- } else if (cValue < 14) { // 0 - 9
- result << (char) (cValue + 44);
- } else if (cValue < 40) { // A - Z
- result << (char) (cValue + 51);
- } else {
- throw ReaderException("");
- }
- }
- } while (bits->available() > 0);
-}
-
-void DecodedBitStreamParser::parseTwoBytes(int firstByte, int secondByte, int*& result) {
- int fullBitValue = (firstByte << 8) + secondByte - 1;
- int temp = fullBitValue / 1600;
- result[0] = temp;
- fullBitValue -= temp * 1600;
- temp = fullBitValue / 40;
- result[1] = temp;
- result[2] = fullBitValue - temp * 40;
-}
-
-void DecodedBitStreamParser::decodeEdifactSegment(Ref<BitSource> bits, ostringstream & result) {
- bool unlatch = false;
- do {
- // If there is only two or less bytes left then it will be encoded as ASCII
- if (bits->available() <= 16) {
- return;
- }
-
- for (int i = 0; i < 4; i++) {
- int edifactValue = bits->readBits(6);
-
- // Check for the unlatch character
- if (edifactValue == 0x2B67) { // 011111
- unlatch = true;
- // If we encounter the unlatch code then continue reading because the Codeword triple
- // is padded with 0's
- }
-
- if (!unlatch) {
- if ((edifactValue & 32) == 0) { // no 1 in the leading (6th) bit
- edifactValue |= 64; // Add a leading 01 to the 6 bit binary value
- }
- result << (edifactValue);
- }
- }
- } while (!unlatch && bits->available() > 0);
-}
-
-void DecodedBitStreamParser::decodeBase256Segment(Ref<BitSource> bits, ostringstream & result){//, vector<unsigned char> byteSegments)
- // Figure out how long the Base 256 Segment is.
- int d1 = bits->readBits(8);
- int count;
- if (d1 == 0) { // Read the remainder of the symbol
- count = bits->available() / 8;
- } else if (d1 < 250) {
- count = d1;
- } else {
- count = 250 * (d1 - 249) + bits->readBits(8);
- }
- unsigned char* bytes = new unsigned char[count];
- for (int i = 0; i < count; i++) {
- bytes[i] = unrandomize255State(bits->readBits(8), i);
- }
- //byteSegments.push_back(bytes);
- result << bytes;
-}
-}
-}
-
View
315 symbian/QQrDecoder/zxing/datamatrix/detector/Detector.cpp
@@ -1,315 +0,0 @@
-/*
- * Detector.cpp
- * zxing
- *
- * Created by Luiz Silva on 09/02/2010.
- * Copyright 2010 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <zxing/common/GridSampler.h>
-#include <zxing/datamatrix/detector/Detector.h>
-#include <cmath>
-#include <sstream>
-#include <cstdlib>
-
-namespace zxing {
-namespace datamatrix {
-
-using namespace std;
-
-ResultPointsAndTransitions::ResultPointsAndTransitions() : to_(), from_(), transitions_(0) {
- Ref<CornerPoint> ref(new CornerPoint(0,0));
- from_ = ref;
- to_ = ref;
-}
-
-ResultPointsAndTransitions::ResultPointsAndTransitions(Ref<CornerPoint> from, Ref<CornerPoint> to, int transitions) :
- to_(to), from_(from), transitions_(transitions) {
-}
-
-Ref<CornerPoint> ResultPointsAndTransitions::getFrom() {
- return from_;
-}
-
-Ref<CornerPoint> ResultPointsAndTransitions::getTo() {
- return to_;
-}
-
-int ResultPointsAndTransitions::getTransitions() {
- return transitions_;
-}
-
-Detector::Detector(Ref<BitMatrix> image) : image_(image) { }
-
-Ref<BitMatrix> Detector::getImage() {
- return image_;
-}
-
-Ref<DetectorResult> Detector::detect() {
- Ref<MonochromeRectangleDetector> rectangleDetector_(new MonochromeRectangleDetector(image_));
- std::vector<Ref<CornerPoint> > cornerPoints = rectangleDetector_->detect();
- Ref<CornerPoint> pointA = cornerPoints[0];
- Ref<CornerPoint> pointB = cornerPoints[1];
- Ref<CornerPoint> pointC = cornerPoints[2];
- Ref<CornerPoint> pointD = cornerPoints[3];
-
- // Point A and D are across the diagonal from one another,
- // as are B and C. Figure out which are the solid black lines
- // by counting transitions
- std::vector<Ref<ResultPointsAndTransitions> > transitions(4);
- transitions[0].reset(transitionsBetween(pointA, pointB));
- transitions[1].reset(transitionsBetween(pointA, pointC));
- transitions[2].reset(transitionsBetween(pointB, pointD));
- transitions[3].reset(transitionsBetween(pointC, pointD));
- insertionSort(transitions);
-
- // Sort by number of transitions. First two will be the two solid sides; last two
- // will be the two alternating black/white sides
- Ref<ResultPointsAndTransitions> lSideOne(transitions[0]);
- Ref<ResultPointsAndTransitions> lSideTwo(transitions[1]);
-
- // Figure out which point is their intersection by tallying up the number of times we see the
- // endpoints in the four endpoints. One will show up twice.
- Ref<CornerPoint> maybeTopLeft;
- Ref<CornerPoint> bottomLeft;
- Ref<CornerPoint> maybeBottomRight;
- if (lSideOne->getFrom()->equals(lSideOne->getTo())) {
- bottomLeft = lSideOne->getFrom();
- maybeTopLeft = lSideTwo->getFrom();
- maybeBottomRight = lSideTwo->getTo();
- }
- else if (lSideOne->getFrom()->equals(lSideTwo->getFrom())) {
- bottomLeft = lSideOne->getFrom();
- maybeTopLeft = lSideOne->getTo();
- maybeBottomRight = lSideTwo->getTo();
- }
- else if (lSideOne->getFrom()->equals(lSideTwo->getTo())) {
- bottomLeft = lSideOne->getFrom();
- maybeTopLeft = lSideOne->getTo();
- maybeBottomRight = lSideTwo->getFrom();
- }
- else if (lSideOne->getTo()->equals(lSideTwo->getFrom())) {
- bottomLeft = lSideOne->getTo();
- maybeTopLeft = lSideOne->getFrom();
- maybeBottomRight = lSideTwo->getTo();
- }
- else if (lSideOne->getTo()->equals(lSideTwo->getTo())) {
- bottomLeft = lSideOne->getTo();
- maybeTopLeft = lSideOne->getFrom();
- maybeBottomRight = lSideTwo->getFrom();
- }
- else {
- bottomLeft = lSideTwo->getFrom();
- maybeTopLeft = lSideOne->getTo();
- maybeBottomRight = lSideOne->getFrom();
- }
-
- // Bottom left is correct but top left and bottom right might be switched
- std::vector<Ref<CornerPoint> > corners(3);
- corners[0].reset(maybeTopLeft);
- corners[1].reset(bottomLeft);
- corners[2].reset(maybeBottomRight);
- // Use the dot product trick to sort them out
- orderBestPatterns(corners);
-
- // Now we know which is which:
- Ref<CornerPoint> bottomRight(corners[0]);
- bottomLeft = corners[1];
- Ref<CornerPoint> topLeft(corners[2]);
-
- // Which point didn't we find in relation to the "L" sides? that's the top right corner
- Ref<CornerPoint> topRight;
- if (!(pointA->equals(bottomRight) || pointA->equals(bottomLeft) || pointA->equals(topLeft))) {
- topRight = pointA;
- } else if (!(pointB->equals(bottomRight) || pointB->equals(bottomLeft) || pointB->equals(topLeft))) {
- topRight = pointB;
- } else if (!(pointC->equals(bottomRight) || pointC->equals(bottomLeft) || pointC->equals(topLeft))) {
- topRight = pointC;
- } else {
- topRight = pointD;
- }
-
- float topRightX = (bottomRight->getX() - bottomLeft->getX()) + topLeft->getX();
- float topRightY = (bottomRight->getY() - bottomLeft->getY()) + topLeft->getY();
- Ref<CornerPoint> topR(new CornerPoint(topRightX,topRightY));
-
- // Next determine the dimension by tracing along the top or right side and counting black/white
- // transitions. Since we start inside a black module, we should see a number of transitions
- // equal to 1 less than the code dimension. Well, actually 2 less, because we are going to
- // end on a black module:
- // The top right point is actually the corner of a module, which is one of the two black modules
- // adjacent to the white module at the top right. Tracing to that corner from either the top left
- // or bottom right should work here. The number of transitions could be higher than it should be
- // due to noise. So we try both and take the min.
- int dimension = min(transitionsBetween(topLeft, topRight)->getTransitions(),
- transitionsBetween(bottomRight, topRight)->getTransitions());
- if ((dimension & 0x01) == 1) {
- // it can't be odd, so, round... up?
- dimension++;
- }
- dimension += 2;
-
- Ref<PerspectiveTransform> transform = createTransform(topLeft, topR, bottomLeft, bottomRight, dimension);
- Ref<BitMatrix> bits(sampleGrid(image_, dimension, transform));
- std::vector<Ref<ResultPoint> > points(4);
- points[0].reset(pointA);
- points[1].reset(pointB);
- points[2].reset(pointC);
- points[3].reset(pointD);
- Ref<DetectorResult> detectorResult(new DetectorResult(bits, points, transform));
- return detectorResult;
-}
-
-Ref<ResultPointsAndTransitions> Detector::transitionsBetween(Ref<CornerPoint> from, Ref<CornerPoint> to) {
- // See QR Code Detector, sizeOfBlackWhiteBlackRun()
- int fromX = (int) from->getX();
- int fromY = (int) from->getY();
- int toX = (int) to->getX();
- int toY = (int) to->getY();
- bool steep = abs(toY - fromY) > abs(toX - fromX);
- if (steep) {
- int temp = fromX;
- fromX = fromY;
- fromY = temp;
- temp = toX;
- toX = toY;
- toY = temp;
- }
-
- int dx = abs(toX - fromX);
- int dy = abs(toY - fromY);
- int error = -dx >> 1;
- int ystep = fromY < toY ? 1 : -1;
- int xstep = fromX < toX ? 1 : -1;
- int transitions = 0;
- bool inBlack = image_->get(steep ? fromY : fromX, steep ? fromX : fromY);
- for (int x = fromX, y = fromY; x != toX; x += xstep) {
- bool isBlack = image_->get(steep ? y : x, steep ? x : y);
- if (isBlack != inBlack) {
- transitions++;
- inBlack = isBlack;
- }
- error += dy;
- if (error > 0) {
- if (y == toY) {
- break;
- }
- y += ystep;
- error -= dx;
- }
- }
- Ref<ResultPointsAndTransitions> result(new ResultPointsAndTransitions(from, to, transitions));
- return result;
- }
-
-Ref<PerspectiveTransform> Detector::createTransform(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref <
- ResultPoint > bottomLeft, Ref<ResultPoint> bottomRight, int dimension) {
-
- Ref<PerspectiveTransform> transform(PerspectiveTransform::quadrilateralToQuadrilateral(
- 0.0f,
- 0.0f,
- dimension,
- 0.0f,
- dimension,
- dimension,
- 0.0f,
- dimension,
- topLeft->getX(),
- topLeft->getY(),
- topRight->getX(),
- topRight->getY(),
- bottomRight->getX(),
- bottomRight->getY(),
- bottomLeft->getX(),
- bottomLeft->getY()));
- return transform;
-}
-
-Ref<BitMatrix> Detector::sampleGrid(Ref<BitMatrix> image, int dimension, Ref<PerspectiveTransform> transform) {
- GridSampler &sampler = GridSampler::getInstance();
- return sampler.sampleGrid(image, dimension, transform);
-}
-
-void Detector::insertionSort(std::vector<Ref<ResultPointsAndTransitions> > &vector) {
- int max = vector.size();
- bool swapped = true;
- Ref<ResultPointsAndTransitions> value;
- Ref<ResultPointsAndTransitions> valueB;
- do {
- swapped = false;
- for (int i = 1; i < max; i++) {
- value = vector[i-1];
- if (compare(value, (valueB = vector[i])) > 0) {
- swapped = true;
- vector[i-1].reset(valueB);
- vector[i].reset(value);
- }
- }
- } while (swapped);
-}
-void Detector::orderBestPatterns(std::vector<Ref<CornerPoint> > &patterns) {
- // Find distances between pattern centers
- float zeroOneDistance = distance(patterns[0]->getX(), patterns[1]->getX(),patterns[0]->getY(), patterns[1]->getY());
- float oneTwoDistance = distance(patterns[1]->getX(), patterns[2]->getX(),patterns[1]->getY(), patterns[2]->getY());
- float zeroTwoDistance = distance(patterns[0]->getX(), patterns[2]->getX(),patterns[0]->getY(), patterns[2]->getY());
-
- Ref<CornerPoint> pointA, pointB, pointC;
- // Assume one closest to other two is B; A and C will just be guesses at first
- if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance) {
- pointB = patterns[0];
- pointA = patterns[1];
- pointC = patterns[2];
- } else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance) {
- pointB = patterns[1];
- pointA = patterns[0];
- pointC = patterns[2];
- } else {
- pointB = patterns[2];
- pointA = patterns[0];
- pointC = patterns[1];
- }
-
- // Use cross product to figure out whether A and C are correct or flipped.
- // This asks whether BC x BA has a positive z component, which is the arrangement
- // we want for A, B, C. If it's negative, then we've got it flipped around and
- // should swap A and C.
- if (crossProductZ(pointA, pointB, pointC) < 0.0f) {
- Ref<CornerPoint> temp = pointA;
- pointA = pointC;
- pointC = temp;
- }
-
- patterns[0] = pointA;
- patterns[1] = pointB;
- patterns[2] = pointC;
-}
-
-float Detector::distance(float x1, float x2, float y1, float y2) {
- float xDiff = x1 - x2;
- float yDiff = y1 - y2;
- return (float) sqrt((double) (xDiff * xDiff + yDiff * yDiff));
- }
-
-int Detector::compare(Ref<ResultPointsAndTransitions> a, Ref<ResultPointsAndTransitions> b) {
- return a->getTransitions() - b->getTransitions();
- }
-
-float Detector::crossProductZ(Ref<ResultPoint> pointA, Ref<ResultPoint> pointB, Ref<ResultPoint> pointC) {
- float bX = pointB->getX();
- float bY = pointB->getY();
- return ((pointC->getX() - bX) * (pointA->getY() - bY)) - ((pointC->getY() - bY) * (pointA->getX() - bX));
- }
-}
-}
View
79 symbian/QQrDecoder/zxing/datamatrix/detector/Detector.h
@@ -1,79 +0,0 @@
-#ifndef __DETECTOR_H__
-#define __DETECTOR_H__
-
-/*
- * Detector.h
- * zxing
- *
- * Created by Luiz Silva on 09/02/2010.
- * Copyright 2010 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <zxing/common/Counted.h>
-#include <zxing/common/DetectorResult.h>
-#include <zxing/common/BitMatrix.h>
-#include <zxing/common/PerspectiveTransform.h>
-#include <zxing/datamatrix/detector/MonochromeRectangleDetector.h>
-
-
-namespace zxing {
-namespace datamatrix {
-
-class ResultPointsAndTransitions : public Counted {
-private:
- Ref<CornerPoint> to_;
- Ref<CornerPoint> from_;
- int transitions_;
-
-public:
- ResultPointsAndTransitions();
- ResultPointsAndTransitions(Ref<CornerPoint> from, Ref<CornerPoint> to, int transitions);
- Ref<CornerPoint> getFrom();
- Ref<CornerPoint> getTo();
- int getTransitions();
-};
-
-class Detector : public Counted {
-private:
- Ref<BitMatrix> image_;
-
-protected:
- Ref<BitMatrix> sampleGrid(Ref<BitMatrix> image, int dimension, Ref<PerspectiveTransform> transform);
-
- void insertionSort(std::vector<Ref<ResultPointsAndTransitions> >& vector);
-
- Ref<ResultPointsAndTransitions> transitionsBetween(Ref<CornerPoint> from, Ref<CornerPoint> to);
- int min(int a, int b) { return a > b ? b : a; };
-
-public:
- Ref<BitMatrix> getImage();
- Detector(Ref<BitMatrix> image);
-
- virtual Ref<PerspectiveTransform> createTransform(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref <
- ResultPoint > bottomLeft, Ref<ResultPoint> bottomRight, int dimension);
-
- Ref<DetectorResult> detect();
- void orderBestPatterns(std::vector<Ref<CornerPoint> > &patterns);
- float distance(float x1, float x2, float y1, float y2);
-private:
- int compare(Ref<ResultPointsAndTransitions> a, Ref<ResultPointsAndTransitions> b);
- float crossProductZ(Ref<ResultPoint> pointA, Ref<ResultPoint> pointB, Ref<ResultPoint> pointC);
-};
-
-}
-}
-
-#endif // __DETECTOR_H__
View
363 symbian/QQrDecoder/zxing/qrcode/decoder/DecodedBitStreamParser.cpp
@@ -1,363 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * DecodedBitStreamParser.cpp
- * zxing
- *
- * Created by Christian Brunschen on 20/05/2008.
- * Copyright 2008 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <zxing/qrcode/decoder/DecodedBitStreamParser.h>
-#include <iostream>
-#ifndef NO_ICONV
-#include <iconv.h>
-#endif
-
-// Required for compatibility. TODO: test on Symbian
-#ifdef ZXING_ICONV_CONST
-#undef ICONV_CONST
-#define ICONV_CONST const
-#endif
-
-#ifndef ICONV_CONST
-#define ICONV_CONST /**/
-#endif
-
-using namespace zxing;
-
-namespace zxing {
- namespace qrcode {
-
- using namespace std;
-
- const char DecodedBitStreamParser::ALPHANUMERIC_CHARS[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':'
- };
-
- const char *DecodedBitStreamParser::ASCII = "ASCII";
- const char *DecodedBitStreamParser::ISO88591 = "ISO-8859-1";
- const char *DecodedBitStreamParser::UTF8 = "UTF-8";
- const char *DecodedBitStreamParser::SHIFT_JIS = "SHIFT_JIS";
- const char *DecodedBitStreamParser::EUC_JP = "EUC-JP";
-
- void DecodedBitStreamParser::append(std::string &result, const unsigned char *bufIn, size_t nIn, const char *src) {
-#ifndef NO_ICONV
- if (nIn == 0) {
- return;
- }
-
- iconv_t cd = iconv_open(UTF8, src);
- const int maxOut = 4 * nIn + 1;
- unsigned char* bufOut = new unsigned char[maxOut];
-
- ICONV_CONST char *fromPtr = (ICONV_CONST char *)bufIn;
- size_t nFrom = nIn;
- char *toPtr = (char *)bufOut;
- size_t nTo = maxOut;
-
- while (nFrom > 0) {
- size_t oneway = iconv(cd, &fromPtr, &nFrom, &toPtr, &nTo);
- if (oneway == (size_t)(-1)) {
- iconv_close(cd);
- delete[] bufOut;
- throw ReaderException("error converting characters");
- }
- }
- iconv_close(cd);
-
- int nResult = maxOut - nTo;
- bufOut[nResult] = '\0';
- result.append((const char *)bufOut);
- delete[] bufOut;
-#else
- result.append((const char *)bufIn, nIn);
-#endif
- }
-
- void DecodedBitStreamParser::decodeKanjiSegment(Ref<BitSource> bits, std::string &result, int count) {
- // Each character will require 2 bytes. Read the characters as 2-byte pairs
- // and decode as Shift_JIS afterwards
- size_t nBytes = 2 * count;
- unsigned char* buffer = new unsigned char[nBytes];
- int offset = 0;
- while (count > 0) {
- // Each 13 bits encodes a 2-byte character
-
- int twoBytes = bits->readBits(13);
- int assembledTwoBytes = ((twoBytes / 0x0C0) << 8) | (twoBytes % 0x0C0);
- if (assembledTwoBytes < 0x01F00) {
- // In the 0x8140 to 0x9FFC range
- assembledTwoBytes += 0x08140;
- } else {
- // In the 0xE040 to 0xEBBF range
- assembledTwoBytes += 0x0C140;
- }
- buffer[offset] = (unsigned char)(assembledTwoBytes >> 8);
- buffer[offset + 1] = (unsigned char)assembledTwoBytes;
- offset += 2;
- count--;
- }
-
- append(result, buffer, nBytes, SHIFT_JIS);
- delete[] buffer;
- }
-
- void DecodedBitStreamParser::decodeByteSegment(Ref<BitSource> bits, std::string &result, int count) {
- int nBytes = count;
- unsigned char* readBytes = new unsigned char[nBytes];
- if (count << 3 > bits->available()) {
- ostringstream s;
- s << "Count too large: " << count;
- delete[] readBytes;
- throw ReaderException(s.str().c_str());
- }
- for (int i = 0; i < count; i++) {
- readBytes[i] = (unsigned char)bits->readBits(8);
- }
- // The spec isn't clear on this mode; see
- // section 6.4.5: t does not say which encoding to assuming
- // upon decoding. I have seen ISO-8859-1 used as well as
- // Shift_JIS -- without anything like an ECI designator to
- // give a hint.
- const char *encoding = guessEncoding(readBytes, nBytes);
- append(result, readBytes, nBytes, encoding);
- delete[] readBytes;
- }
-
- void DecodedBitStreamParser::decodeNumericSegment(Ref<BitSource> bits, std::string &result, int count) {
- int nBytes = count;
- unsigned char* bytes = new unsigned char[nBytes];
- int i = 0;
- // Read three digits at a time
- while (count >= 3) {
- // Each 10 bits encodes three digits
- if (bits->available() < 10) {
- throw ReaderException("format exception");
- }
- int threeDigitsBits = bits->readBits(10);
- if (threeDigitsBits >= 1000) {
- ostringstream s;
- s << "Illegal value for 3-digit unit: " << threeDigitsBits;
- delete[] bytes;
- throw ReaderException(s.str().c_str());
- }
- bytes[i++] = ALPHANUMERIC_CHARS[threeDigitsBits / 100];
- bytes[i++] = ALPHANUMERIC_CHARS[(threeDigitsBits / 10) % 10];
- bytes[i++] = ALPHANUMERIC_CHARS[threeDigitsBits % 10];
- count -= 3;
- }
- if (count == 2) {
- if (bits->available() < 7) {
- throw ReaderException("format exception");
- }
- // Two digits left over to read, encoded in 7 bits
- int twoDigitsBits = bits->readBits(7);
- if (twoDigitsBits >= 100) {
- ostringstream s;
- s << "Illegal value for 2-digit unit: " << twoDigitsBits;
- delete[] bytes;
- throw ReaderException(s.str().c_str());
- }
- bytes[i++] = ALPHANUMERIC_CHARS[twoDigitsBits / 10];
- bytes[i++] = ALPHANUMERIC_CHARS[twoDigitsBits % 10];
- } else if (count == 1) {
- if (bits->available() < 4) {
- throw ReaderException("format exception");
- }
- // One digit left over to read
- int digitBits = bits->readBits(4);
- if (digitBits >= 10) {
- ostringstream s;
- s << "Illegal value for digit unit: " << digitBits;
- delete[] bytes;
- throw ReaderException(s.str().c_str());
- }
- bytes[i++] = ALPHANUMERIC_CHARS[digitBits];
- }
- append(result, bytes, nBytes, ASCII);
- delete[] bytes;
- }
-
- void DecodedBitStreamParser::decodeAlphanumericSegment(Ref<BitSource> bits, std::string &result, int count) {
- int nBytes = count;
- unsigned char* bytes = new unsigned char[nBytes];
- int i = 0;
- // Read two characters at a time
- while (count > 1) {
- int nextTwoCharsBits = bits->readBits(11);
- bytes[i++] = ALPHANUMERIC_CHARS[nextTwoCharsBits / 45];
- bytes[i++] = ALPHANUMERIC_CHARS[nextTwoCharsBits % 45];
- count -= 2;
- }
- if (count == 1) {
- bytes[i++] = ALPHANUMERIC_CHARS[bits->readBits(6)];
- }
- append(result, bytes, nBytes, ASCII);
- delete[] bytes;
- }
-
- const char *
- DecodedBitStreamParser::guessEncoding(unsigned char *bytes, int length) {
- const bool ASSUME_SHIFT_JIS = false;
- char const* const PLATFORM_DEFAULT_ENCODING="UTF-8";
-
- // Does it start with the UTF-8 byte order mark? then guess it's UTF-8
- if (length > 3 && bytes[0] == (unsigned char)0xEF && bytes[1] == (unsigned char)0xBB && bytes[2]
- == (unsigned char)0xBF) {
- return UTF8;
- }
- // For now, merely tries to distinguish ISO-8859-1, UTF-8 and Shift_JIS,
- // which should be by far the most common encodings. ISO-8859-1
- // should not have bytes in the 0x80 - 0x9F range, while Shift_JIS
- // uses this as a first byte of a two-byte character. If we see this
- // followed by a valid second byte in Shift_JIS, assume it is Shift_JIS.
- // If we see something else in that second byte, we'll make the risky guess
- // that it's UTF-8.
- bool canBeISO88591 = true;
- bool canBeShiftJIS = true;
- bool canBeUTF8 = true;
- int utf8BytesLeft = 0;
- int maybeDoubleByteCount = 0;
- int maybeSingleByteKatakanaCount = 0;
- bool sawLatin1Supplement = false;
- bool sawUTF8Start = false;
- bool lastWasPossibleDoubleByteStart = false;
- for (int i = 0;
- i < length && (canBeISO88591 || canBeShiftJIS || canBeUTF8);
- i++) {
- int value = bytes[i] & 0xFF;
-
- // UTF-8 stuff
- if (value >= 0x80 && value <= 0xBF) {
- if (utf8BytesLeft > 0) {
- utf8BytesLeft--;
- }
- } else {
- if (utf8BytesLeft > 0) {
- canBeUTF8 = false;
- }
- if (value >= 0xC0 && value <= 0xFD) {
- sawUTF8Start = true;
- int valueCopy = value;
- while ((valueCopy & 0x40) != 0) {
- utf8BytesLeft++;
- valueCopy <<= 1;
- }
- }
- }
-
- // Shift_JIS stuff
-
- if (value >= 0xA1 && value <= 0xDF) {
- // count the number of characters that might be a Shift_JIS single-byte Katakana character
- if (!lastWasPossibleDoubleByteStart) {
- maybeSingleByteKatakanaCount++;
- }
- }
- if (!lastWasPossibleDoubleByteStart &&
- ((value >= 0xF0 && value <= 0xFF) || value == 0x80 || value == 0xA0)) {
- canBeShiftJIS = false;
- }
- if (((value >= 0x81 && value <= 0x9F) || (value >= 0xE0 && value <= 0xEF))) {
- // These start double-byte characters in Shift_JIS. Let's see if it's followed by a valid
- // second byte.
- if (lastWasPossibleDoubleByteStart) {
- // If we just checked this and the last byte for being a valid double-byte
- // char, don't check starting on this byte. If this and the last byte
- // formed a valid pair, then this shouldn't be checked to see if it starts
- // a double byte pair of course.
- lastWasPossibleDoubleByteStart = false;
- } else {
- // ... otherwise do check to see if this plus the next byte form a valid
- // double byte pair encoding a character.
- lastWasPossibleDoubleByteStart = true;
- if (i >= length - 1) {
- canBeShiftJIS = false;
- } else {
- int nextValue = bytes[i + 1] & 0xFF;
- if (nextValue < 0x40 || nextValue > 0xFC) {
- canBeShiftJIS = false;
- } else {
- maybeDoubleByteCount++;
- }
- // There is some conflicting information out there about which bytes can follow which in
- // double-byte Shift_JIS characters. The rule above seems to be the one that matches practice.
- }
- }
- } else {
- lastWasPossibleDoubleByteStart = false;
- }
- }
- if (utf8BytesLeft > 0) {
- canBeUTF8 = false;
- }
-
- // Easy -- if assuming Shift_JIS and no evidence it can't be, done
- if (canBeShiftJIS && ASSUME_SHIFT_JIS) {
- return SHIFT_JIS;
- }
- if (canBeUTF8 && sawUTF8Start) {
- return UTF8;
- }
- // Distinguishing Shift_JIS and ISO-8859-1 can be a little tough. The crude heuristic is:
- // - If we saw
- // - at least 3 bytes that starts a double-byte value (bytes that are rare in ISO-8859-1), or
- // - over 5% of bytes could be single-byte Katakana (also rare in ISO-8859-1),
- // - and, saw no sequences that are invalid in Shift_JIS, then we conclude Shift_JIS
- if (canBeShiftJIS && (maybeDoubleByteCount >= 3 || 20 * maybeSingleByteKatakanaCount > length)) {
- return SHIFT_JIS;
- }
- // Otherwise, we default to ISO-8859-1 unless we know it can't be
- if (!sawLatin1Supplement && canBeISO88591) {
- return ISO88591;
- }
- // Otherwise, we take a wild guess with platform encoding
- return PLATFORM_DEFAULT_ENCODING;
- }
-
- string DecodedBitStreamParser::decode(ArrayRef<unsigned char> bytes, Version *version) {
- string result;
- Ref<BitSource> bits(new BitSource(bytes));
- Mode *mode = &Mode::TERMINATOR;
- do {
- // While still another segment to read...
- if (bits->available() < 4) {
- // OK, assume we're done. Really, a TERMINATOR mode should have been recorded here
- mode = &Mode::TERMINATOR;
- } else {
- mode = &Mode::forBits(bits->readBits(4)); // mode is encoded by 4 bits
- }
- if (mode != &Mode::TERMINATOR) {
- // How many characters will follow, encoded in this mode?
- int count = bits->readBits(mode->getCharacterCountBits(version));
- if (mode == &Mode::NUMERIC) {
- decodeNumericSegment(bits, result, count);
- } else if (mode == &Mode::ALPHANUMERIC) {
- decodeAlphanumericSegment(bits, result, count);
- } else if (mode == &Mode::BYTE) {
- decodeByteSegment(bits, result, count);
- } else if (mode == &Mode::KANJI) {
- decodeKanjiSegment(bits, result, count);
- } else {
- throw ReaderException("Unsupported mode indicator");
- }
- }
- } while (mode != &Mode::TERMINATOR);
- return result;
- }
-
- }
-}
View
73 symbian/QQrDecoder/zxing/qrcode/decoder/Mode.cpp
@@ -1,73 +0,0 @@
-/*
- * Mode.cpp
- * zxing
- *
- * Created by Christian Brunschen on 19/05/2008.
- * Copyright 2008 ZXing authors All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <zxing/qrcode/decoder/Mode.h>
-#include <zxing/common/Counted.h>
-#include <zxing/ReaderException.h>
-#include <zxing/qrcode/Version.h>
-#include <sstream>
-
-namespace zxing {
-namespace qrcode {
-using namespace std;
-
-Mode Mode::TERMINATOR(0, 0, 0);
-Mode Mode::NUMERIC(10, 12, 14);
-Mode Mode::ALPHANUMERIC(9, 11, 13);
-Mode Mode::BYTE(8, 16, 16);
-Mode Mode::KANJI(8, 10, 12);
-
-Mode::Mode(int cbv0_9, int cbv10_26, int cbv27) :
- characterCountBitsForVersions0To9_(cbv0_9), characterCountBitsForVersions10To26_(cbv10_26),
- characterCountBitsForVersions27AndHigher_(cbv27) {
-}
-
-Mode& Mode::forBits(int bits) {
- switch (bits) {
- case 0x0:
- return TERMINATOR;
- case 0x1:
- return NUMERIC;
- case 0x2:
- return ALPHANUMERIC;
- case 0x4:
- return BYTE;
- case 0x8:
- return KANJI;
- default:
- ostringstream s;
- s << "Illegal mode bits: " << bits;
- throw ReaderException(s.str().c_str());
- }
-}
-
-int Mode::getCharacterCountBits(Version *version) {
- int number = version->getVersionNumber();
- if (number <= 9) {
- return characterCountBitsForVersions0To9_;
- } else if (number <= 26) {
- return characterCountBitsForVersions10To26_;
- } else {
- return characterCountBitsForVersions27AndHigher_;
- }
-}
-
-}
-}
View
12 symbian/QZXing/binary/Harmattan-Maemo5/QZXing_global.h
@@ -0,0 +1,12 @@
+#ifndef QZXING_GLOBAL_H
+#define QZXING_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(QZXING_LIBRARY)
+# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
+#else
+# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // QZXING_GLOBAL_H
View
BIN  symbian/QZXing/binary/Harmattan-Maemo5/libQZXing.rar
Binary file not shown
View
74 symbian/QZXing/binary/Harmattan-Maemo5/qzxing.h
@@ -0,0 +1,74 @@
+#ifndef QZXING_H
+#define QZXING_H
+
+#include "QZXing_global.h"
+#include <QObject>
+#include <QImage>
+
+#if QT_VERSION >= 0x040700
+#include <QtDeclarative>
+#endif
+
+/**
+ * A class containing a very very small subset of the ZXing library.
+ * Created for ease of use.
+ *
+ * Anyone interested in using more technical stuff
+ * from the ZXing library is welcomed to add/edit on free will.
+ *
+ * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
+ */
+class QZXINGSHARED_EXPORT QZXing : public QObject{
+ Q_OBJECT
+ Q_ENUMS(DecoderFormat)
+public:
+ enum DecoderFormat {
+ DecoderFormat_None = 0,
+ DecoderFormat_QR_CODE = 1,
+ DecoderFormat_DATA_MATRIX = 2,
+ DecoderFormat_UPC_E = 4,
+ DecoderFormat_UPC_A = 8,
+ DecoderFormat_EAN_8 = 16,
+ DecoderFormat_EAN_13 = 32,
+ DecoderFormat_CODE_128 = 64,
+ DecoderFormat_CODE_39 = 128,
+ DecoderFormat_ITF = 256
+ } ;
+ typedef unsigned int DecoderFormatType;
+
+public:
+ QZXing(QObject *parent = NULL);
+
+ /**
+ * Set the enabled decoders.
+ * As argument it is possible to pass conjuction of decoders by using logic OR.
+ * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
+ */
+ void setDecoder(DecoderFormatType hint);
+
+#if QT_VERSION >= 0x040700
+ static void registerQMLTypes()
+ {
+ qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
+ }
+#endif
+
+public slots:
+ /**
+ * The decoding function. Will try to decode the given image based on the enabled decoders.
+ *
+ */
+ QString decodeImage(QImage image);
+
+signals:
+ void decodingStarted();
+ void decodingFinished(bool succeeded);
+ void tagFound(QString tag);
+
+private:
+ void* decoder;
+ DecoderFormatType supportedFormats;
+};
+
+#endif // QZXING_H
+
View
1  symbian/QZXing/binary/Harmattan-Maemo5/readme.txt
@@ -0,0 +1 @@
+libQZXing.rar is compressed to save space. Decompress to use.
View
BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/QZXing_S60_FP1_selfsigned.sis
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/QZXing_selfsigned.sis
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/InstallToDevice/qzxing.sis
Binary file not shown
View
12 symbian/QZXing/binary/Qt_4.6.3_Symbian^1/include/QZXing_global.h
@@ -0,0 +1,12 @@
+#ifndef QZXING_GLOBAL_H
+#define QZXING_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(QZXING_LIBRARY)
+# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
+#else
+# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // QZXING_GLOBAL_H
View
74 symbian/QZXing/binary/Qt_4.6.3_Symbian^1/include/qzxing.h
@@ -0,0 +1,74 @@
+#ifndef QZXING_H
+#define QZXING_H
+
+#include "QZXing_global.h"
+#include <QObject>
+#include <QImage>
+
+#if QT_VERSION >= 0x040700
+#include <QtDeclarative>
+#endif
+
+/**
+ * A class containing a very very small subset of the ZXing library.
+ * Created for ease of use.
+ *
+ * Anyone interested in using more technical stuff
+ * from the ZXing library is welcomed to add/edit on free will.
+ *
+ * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
+ */
+class QZXINGSHARED_EXPORT QZXing : public QObject{
+ Q_OBJECT
+ Q_ENUMS(DecoderFormat)
+public:
+ enum DecoderFormat {
+ DecoderFormat_None = 0,
+ DecoderFormat_QR_CODE = 1,
+ DecoderFormat_DATA_MATRIX = 2,
+ DecoderFormat_UPC_E = 4,
+ DecoderFormat_UPC_A = 8,
+ DecoderFormat_EAN_8 = 16,
+ DecoderFormat_EAN_13 = 32,
+ DecoderFormat_CODE_128 = 64,
+ DecoderFormat_CODE_39 = 128,
+ DecoderFormat_ITF = 256
+ } ;
+ typedef unsigned int DecoderFormatType;
+
+public:
+ QZXing(QObject *parent = NULL);
+
+ /**
+ * Set the enabled decoders.
+ * As argument it is possible to pass conjuction of decoders by using logic OR.
+ * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
+ */
+ void setDecoder(DecoderFormatType hint);
+
+#if QT_VERSION >= 0x040700
+ static void registerQMLTypes()
+ {
+ qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
+ }
+#endif
+
+public slots:
+ /**
+ * The decoding function. Will try to decode the given image based on the enabled decoders.
+ *
+ */
+ QString decodeImage(QImage image);
+
+signals:
+ void decodingStarted();
+ void decodingFinished(bool succeeded);
+ void tagFound(QString tag);
+
+private:
+ void* decoder;
+ DecoderFormatType supportedFormats;
+};
+
+#endif // QZXING_H
+
View
BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/release/armv5/lib/QZXing.dso
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.6.3_Symbian^1/release/armv5/lib/QZXing{000a0000}.dso
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/InstallToDevice/QZXing.sis
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/InstallToDevice/QZXing_selfsigned.sis
Binary file not shown
View
74 symbian/QZXing/binary/Qt_4.7.3_Symbian/include/QZXing.h
@@ -0,0 +1,74 @@
+#ifndef QZXING_H
+#define QZXING_H
+
+#include "QZXing_global.h"
+#include <QObject>
+#include <QImage>
+
+#if QT_VERSION >= 0x040700
+#include <QtDeclarative>
+#endif
+
+/**
+ * A class containing a very very small subset of the ZXing library.
+ * Created for ease of use.
+ *
+ * Anyone interested in using more technical stuff
+ * from the ZXing library is welcomed to add/edit on free will.
+ *
+ * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
+ */
+class QZXINGSHARED_EXPORT QZXing : public QObject{
+ Q_OBJECT
+ Q_ENUMS(DecoderFormat)
+public:
+ enum DecoderFormat {
+ DecoderFormat_None = 0,
+ DecoderFormat_QR_CODE = 1,
+ DecoderFormat_DATA_MATRIX = 2,
+ DecoderFormat_UPC_E = 4,
+ DecoderFormat_UPC_A = 8,
+ DecoderFormat_EAN_8 = 16,
+ DecoderFormat_EAN_13 = 32,
+ DecoderFormat_CODE_128 = 64,
+ DecoderFormat_CODE_39 = 128,
+ DecoderFormat_ITF = 256
+ } ;
+ typedef unsigned int DecoderFormatType;
+
+public:
+ QZXing(QObject *parent = NULL);
+
+ /**
+ * Set the enabled decoders.
+ * As argument it is possible to pass conjuction of decoders by using logic OR.
+ * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
+ */
+ void setDecoder(DecoderFormatType hint);
+
+#if QT_VERSION >= 0x040700
+ static void registerQMLTypes()
+ {
+ qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
+ }
+#endif
+
+public slots:
+ /**
+ * The decoding function. Will try to decode the given image based on the enabled decoders.
+ *
+ */
+ QString decodeImage(QImage image);
+
+signals:
+ void decodingStarted();
+ void decodingFinished(bool succeeded);
+ void tagFound(QString tag);
+
+private:
+ void* decoder;
+ DecoderFormatType supportedFormats;
+};
+
+#endif // QZXING_H
+
View
12 symbian/QZXing/binary/Qt_4.7.3_Symbian/include/QZXing_global.h
@@ -0,0 +1,12 @@
+#ifndef QZXING_GLOBAL_H
+#define QZXING_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(QZXING_LIBRARY)
+# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
+#else
+# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // QZXING_GLOBAL_H
View
BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/release/armv5/lib/QZXing.dso
Binary file not shown
View
BIN  symbian/QZXing/binary/Qt_4.7.3_Symbian/release/armv5/lib/QZXing{00010100}.dso
Binary file not shown
View
74 symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing.h
@@ -0,0 +1,74 @@
+#ifndef QZXING_H
+#define QZXING_H
+
+#include "QZXing_global.h"
+#include <QObject>
+#include <QImage>
+
+#if QT_VERSION >= 0x040700
+#include <QtDeclarative>
+#endif
+
+/**
+ * A class containing a very very small subset of the ZXing library.
+ * Created for ease of use.
+ *
+ * Anyone interested in using more technical stuff
+ * from the ZXing library is welcomed to add/edit on free will.
+ *
+ * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
+ */
+class QZXINGSHARED_EXPORT QZXing : public QObject{
+ Q_OBJECT
+ Q_ENUMS(DecoderFormat)
+public:
+ enum DecoderFormat {
+ DecoderFormat_None = 0,
+ DecoderFormat_QR_CODE = 1,
+ DecoderFormat_DATA_MATRIX = 2,
+ DecoderFormat_UPC_E = 4,
+ DecoderFormat_UPC_A = 8,
+ DecoderFormat_EAN_8 = 16,
+ DecoderFormat_EAN_13 = 32,
+ DecoderFormat_CODE_128 = 64,
+ DecoderFormat_CODE_39 = 128,
+ DecoderFormat_ITF = 256
+ } ;
+ typedef unsigned int DecoderFormatType;
+
+public:
+ QZXing(QObject *parent = NULL);
+
+ /**
+ * Set the enabled decoders.
+ * As argument it is possible to pass conjuction of decoders by using logic OR.
+ * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
+ */
+ void setDecoder(DecoderFormatType hint);
+
+#if QT_VERSION >= 0x040700
+ static void registerQMLTypes()
+ {
+ qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
+ }
+#endif
+
+public slots:
+ /**
+ * The decoding function. Will try to decode the given image based on the enabled decoders.
+ *
+ */
+ QString decodeImage(QImage image);
+
+signals:
+ void decodingStarted();
+ void decodingFinished(bool succeeded);
+ void tagFound(QString tag);
+
+private:
+ void* decoder;
+ DecoderFormatType supportedFormats;
+};
+
+#endif // QZXING_H
+
View
BIN  symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing1.rar
Binary file not shown
View
12 symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/QZXing_global.h
@@ -0,0 +1,12 @@
+#ifndef QZXING_GLOBAL_H
+#define QZXING_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(QZXING_LIBRARY)
+# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
+#else
+# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // QZXING_GLOBAL_H
View
1  symbian/QZXing/binary/Qt_4.7.4_Desktop_Mingw/readme.txt
@@ -0,0 +1 @@
+QZXing1.rar is compressed to save space. Decompress to use.
View
52 symbian/QZXing/examples/QMLBarcodeScanner/QMLBarcodeScanner.pro
@@ -0,0 +1,52 @@
+# Add more folders to ship with the application, here
+folder_01.source = qml/QMLBarcodeScanner
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE35E8B99
+
+# Smart Installer package's UID
+# This UID is from the protected range and therefore the package will
+# fail to install if self-signed. By default qmake uses the unprotected
+# range value if unprotected UID is defined for the application and
+# 0x2002CCCF value if protected UID is given to the application
+#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
+
+# Allow network access on Symbian
+#symbian:TARGET.CAPABILITY += NetworkServices
+
+# If your application uses the Qt Mobility libraries, uncomment the following