├── README.md
├── actionscript
├── build_swc.bat
└── src
│ └── com
│ └── kcly
│ └── ane
│ └── bitmapdataqrcodescanner
│ ├── Scanner.as
│ └── ScannerEvent.as
├── android
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── bin
│ ├── AndroidManifest.xml
│ ├── R.txt
│ ├── bitmapdataqrcodescanner.jar
│ ├── classes
│ │ ├── META-INF
│ │ │ └── MANIFEST.MF
│ │ ├── com
│ │ │ └── kcly
│ │ │ │ └── ane
│ │ │ │ └── bitmapdataqrcodescanner
│ │ │ │ ├── BuildConfig.class
│ │ │ │ ├── R$attr.class
│ │ │ │ ├── R$drawable.class
│ │ │ │ ├── R$id.class
│ │ │ │ ├── R$layout.class
│ │ │ │ ├── R$raw.class
│ │ │ │ ├── R$string.class
│ │ │ │ ├── R.class
│ │ │ │ ├── ScannerExtension.class
│ │ │ │ ├── ScannerExtensionContext.class
│ │ │ │ └── function
│ │ │ │ ├── ScanFunction.class
│ │ │ │ └── StopFunction.class
│ │ └── net
│ │ │ └── sourceforge
│ │ │ └── zbar
│ │ │ ├── Config.class
│ │ │ ├── Image.class
│ │ │ ├── ImageScanner.class
│ │ │ ├── Modifier.class
│ │ │ ├── Orientation.class
│ │ │ ├── Symbol.class
│ │ │ ├── SymbolIterator.class
│ │ │ └── SymbolSet.class
│ ├── jarlist.cache
│ └── res
│ │ └── crunch
│ │ ├── drawable-hdpi
│ │ └── icon.png
│ │ ├── drawable-ldpi
│ │ └── icon.png
│ │ └── drawable-mdpi
│ │ └── icon.png
├── gen
│ └── com
│ │ └── kcly
│ │ └── ane
│ │ └── bitmapdataqrcodescanner
│ │ ├── BuildConfig.java
│ │ └── R.java
├── libs
│ ├── FlashRuntimeExtensions.jar
│ ├── armeabi-v7a
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
│ ├── armeabi
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
│ └── x86
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-ldpi
│ │ └── icon.png
│ ├── drawable-mdpi
│ │ └── icon.png
│ ├── layout
│ │ └── campreview.xml
│ ├── raw
│ │ ├── armeabi
│ │ │ ├── libiconv.so
│ │ │ └── libzbarjni.so
│ │ └── debugger.info
│ └── values
│ │ └── strings.xml
└── src
│ ├── META-INF
│ └── MANIFEST.MF
│ ├── com
│ └── kcly
│ │ └── ane
│ │ └── bitmapdataqrcodescanner
│ │ ├── ScannerExtension.java
│ │ ├── ScannerExtensionContext.java
│ │ └── function
│ │ ├── ScanFunction.java
│ │ └── StopFunction.java
│ └── net
│ └── sourceforge
│ └── zbar
│ ├── Config.java
│ ├── Image.java
│ ├── ImageScanner.java
│ ├── Modifier.java
│ ├── Orientation.java
│ ├── Symbol.java
│ ├── SymbolIterator.java
│ └── SymbolSet.java
├── ane
├── build_ane.bat
├── com.kcly.ane.bitmapdataqrcodescanner.ane
├── com.kcly.ane.bitmapdataqrcodescanner.swc
├── extension.xml
├── libBitmapDataQRCodeScanner.a
├── libBitmapDataQRCodeScanner.jar
├── library.swf
├── libs
│ ├── FlashRuntimeExtensions.jar
│ ├── armeabi-v7a
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
│ ├── armeabi
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
│ └── x86
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
├── platform.xml
└── res
│ ├── drawable-hdpi
│ └── icon.png
│ ├── drawable-ldpi
│ └── icon.png
│ ├── drawable-mdpi
│ └── icon.png
│ ├── layout
│ └── campreview.xml
│ ├── raw
│ ├── armeabi
│ │ ├── libiconv.so
│ │ └── libzbarjni.so
│ └── debugger.info
│ └── values
│ └── strings.xml
├── example
├── AIR_Android_readme.txt
├── AIR_iOS_readme.txt
├── BitmapDataQRCodeScanner.as3proj
├── PackageApp.bat
├── Run.bat
├── application.xml
├── bat
│ ├── CreateCertificate.bat
│ ├── InstallAirRuntime.bat
│ ├── Packager.bat
│ ├── SetupApplication.bat
│ └── SetupSDK.bat
├── bin
│ └── BitmapDataQRCodeScanner.swf
├── cert
│ └── BitmapDataQRCodeScanner_play.p12
├── dist
│ └── BitmapDataQRCodeScanner.apk
├── extension
│ └── release
│ │ └── com.kcly.ane.bitmapdataqrcodescanner.ane
├── icons
│ ├── android
│ │ └── icons
│ │ │ ├── icon_114.png
│ │ │ ├── icon_120.png
│ │ │ ├── icon_144.png
│ │ │ ├── icon_152.png
│ │ │ ├── icon_48.png
│ │ │ ├── icon_57.png
│ │ │ ├── icon_72.png
│ │ │ ├── icon_76.png
│ │ │ └── icon_96.png
│ └── ios
│ │ ├── Default-568h@2x.png
│ │ ├── Default-Landscape.png
│ │ ├── Default-Portrait.png
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ └── icons
│ │ ├── icon_114.png
│ │ ├── icon_120.png
│ │ ├── icon_144.png
│ │ ├── icon_152.png
│ │ ├── icon_48.png
│ │ ├── icon_512.png
│ │ ├── icon_57.png
│ │ ├── icon_72.png
│ │ ├── icon_76.png
│ │ └── icon_96.png
├── lib
│ └── com.kcly.ane.bitmapdataqrcodescanner.swc
├── obj
│ ├── BitmapDataQRCodeScannerConfig.old
│ └── BitmapDataQRCodeScannerConfig.xml
└── src
│ └── Demo.as
└── ios
├── BitmapDataQRCodeScanner.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── luar.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── WorkspaceSettings.xcsettings
└── xcuserdata
│ └── luar.xcuserdatad
│ └── xcschemes
│ ├── BitmapDataQRCodeScanner.xcscheme
│ └── xcschememanagement.plist
└── BitmapDataQRCodeScanner
├── BitmapDataQRCodeScanner-Prefix.pch
├── BitmapDataQRCodeScanner.m
├── FlashRuntimeExtensions.h
└── ZBarSDK
├── Headers
├── ZBarCameraSimulator.h
├── ZBarCaptureReader.h
├── ZBarHelpController.h
├── ZBarImage.h
├── ZBarImageScanner.h
├── ZBarReaderController.h
├── ZBarReaderView.h
├── ZBarReaderViewController.h
├── ZBarSDK.h
├── ZBarSymbol.h
├── zbar.h
└── zbar
│ ├── Decoder.h
│ ├── Exception.h
│ ├── Image.h
│ ├── ImageScanner.h
│ ├── Processor.h
│ ├── Scanner.h
│ ├── Symbol.h
│ ├── Video.h
│ └── Window.h
└── libzbar.a
/README.md:
--------------------------------------------------------------------------------
1 | BitmapDataQRCodeScanner (ANE)
2 | =============================
3 |
4 | Flash AIR Native Extension: QRCode reader/decoder which accept BitmapData, therefore you can design your own scanner UI, adding overlay image, without launch fullscreen native Camera UI
5 |
6 |
7 | Setup in application.xml
8 | ========================
9 | for Android, include the followings inside <android><manifestAdditions>...</manifestAdditions></android>
10 |
<uses-permission android:name="android.permission.CAMERA"/>
11 | <uses-feature android:name="android.hardware.camera" />
12 | for both iOS and Android, include the followings inside <extensions>...</extensions>
13 | <extensionID>com.kcly.ane.bitmapdataqrcodescanner</extensionID>
14 | for Flash, add this swc
15 | com.kcly.ane.bitmapdataqrcodescanner.swc
16 |
17 | Usage
18 | =====
19 | import com.kcly.ane.bitmapdataqrcodescanner.Scanner;
20 | import com.kcly.ane.bitmapdataqrcodescanner.ScannerEvent;
21 | ...
22 |
23 | scanner = new Scanner();
24 | scanner.addEventListener(ScannerEvent.SCAN, onScanFound);
25 | ...
26 |
27 | scanner.scan(bmpData);
28 |
29 | ...
30 |
31 | private function onScanFound(evt:ScannerEvent):void {
32 | trace ('onScanFound: ', evt.data);
33 | }
34 |
35 |
36 | Note
37 | ====
38 | If you want a continous scanning, you can use Enterframe, setInterval, Timer whatever you like to call scanner.scan(bmpData)
39 |
40 |
41 | Credit
42 | ======
43 | Native Extension template forked from https://github.com/saumitrabhave/qr-zbar-ane
44 | ZBar 64-Bit version from https://markobl.com/2015/03/27/zbar-sdk-64-bit-for-iphone-6-and-ios-8-download/
45 |
--------------------------------------------------------------------------------
/actionscript/build_swc.bat:
--------------------------------------------------------------------------------
1 | ::edit Flex SDK bin folder path
2 | set FLEX_SDK=C:\Program Files (x86)\FlashDevelop\Tools\flexsdk
3 |
4 | ::do not edit below
5 |
6 | @echo off
7 | echo "build com.kcly.ane.bitmapdataqrcodescanner.swc..."
8 | "%FLEX_SDK%\bin\acompc.bat" -source-path src -include-sources src -optimize -swf-version=13 -output ..\ane\com.kcly.ane.bitmapdataqrcodescanner.swc
9 | echo "Done!"
--------------------------------------------------------------------------------
/actionscript/src/com/kcly/ane/bitmapdataqrcodescanner/Scanner.as:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner {
2 | import flash.display.BitmapData;
3 | import flash.events.Event;
4 | import flash.events.EventDispatcher;
5 | import flash.events.StatusEvent;
6 | import flash.external.ExtensionContext;
7 |
8 | public class Scanner extends EventDispatcher {
9 |
10 | private static var extCtx:ExtensionContext = null;
11 | private static var isInstantiated:Boolean = false;
12 |
13 | public function Scanner() {
14 |
15 | if (!isInstantiated) {
16 | extCtx = ExtensionContext.createExtensionContext("com.kcly.ane.bitmapdataqrcodescanner", null);
17 |
18 | if (extCtx != null) {
19 |
20 | extCtx.addEventListener(StatusEvent.STATUS, onStatus);
21 |
22 | } else {
23 | throw new Error("Extension not supported");
24 | }
25 |
26 | isInstantiated = true;
27 | }
28 | }
29 |
30 | public function dispose():void {
31 | extCtx.dispose();
32 | extCtx = null;
33 | isInstantiated = false;
34 | }
35 |
36 | public function scan(bmpData:BitmapData):String {
37 | var ret:Object = extCtx.call("scan", bmpData);
38 |
39 | if (ret == null)
40 | return "";
41 | else
42 | return ret as String;
43 | }
44 |
45 | public function stop():Boolean {
46 | var ret:Object = extCtx.call("stop");
47 |
48 | if (ret == null)
49 | return false;
50 | else
51 | return ret as Boolean;
52 | }
53 |
54 | private function onStatus(evt:StatusEvent):void {
55 | switch (evt.code) {
56 | case "data":
57 | dispatchEvent(new ScannerEvent(ScannerEvent.SCAN, evt.level));
58 | break;
59 | }
60 | }
61 | }
62 | }
--------------------------------------------------------------------------------
/actionscript/src/com/kcly/ane/bitmapdataqrcodescanner/ScannerEvent.as:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner {
2 | import flash.events.Event;
3 |
4 | public class ScannerEvent extends Event {
5 | public static const SCAN:String = "com.kcly.ane.bitmapdataqrcodescanner.ScannerEvent";
6 | private var _data:String;
7 |
8 | public function ScannerEvent(type:String, data:String, bubbles:Boolean=false, cancelable:Boolean=false) {
9 | super(type, bubbles, cancelable);
10 | _data = data;
11 | }
12 |
13 | public function get data():String {
14 | return _data;
15 | }
16 |
17 | public override function clone():Event {
18 | return new ScannerEvent(type, _data, bubbles,cancelable);
19 | };
20 | }
21 | }
--------------------------------------------------------------------------------
/android/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | bitmapdataqrcodescanner
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/android/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/android/bin/R.txt:
--------------------------------------------------------------------------------
1 | int drawable icon 0x7f020000
2 | int id ScanButton 0x7f060002
3 | int id cameraPreview 0x7f060000
4 | int id scanText 0x7f060001
5 | int layout campreview 0x7f030000
6 | int raw debugger 0x7f040000
7 | int string app_name 0x7f050001
8 | int string hello 0x7f050000
9 | int string lbl1 0x7f050002
10 | int string lbl2 0x7f050003
11 |
--------------------------------------------------------------------------------
/android/bin/bitmapdataqrcodescanner.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/bitmapdataqrcodescanner.jar
--------------------------------------------------------------------------------
/android/bin/classes/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path: FlashRuntimeExtensions.jar
3 |
4 |
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/BuildConfig.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$attr.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$drawable.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$id.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$layout.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$raw.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$raw.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R$string.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/R.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtension.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtension.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtensionContext.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtensionContext.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/function/ScanFunction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/function/ScanFunction.class
--------------------------------------------------------------------------------
/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/function/StopFunction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/com/kcly/ane/bitmapdataqrcodescanner/function/StopFunction.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/Config.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/Config.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/Image.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/Image.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/ImageScanner.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/ImageScanner.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/Modifier.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/Modifier.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/Orientation.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/Orientation.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/Symbol.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/Symbol.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/SymbolIterator.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/SymbolIterator.class
--------------------------------------------------------------------------------
/android/bin/classes/net/sourceforge/zbar/SymbolSet.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/classes/net/sourceforge/zbar/SymbolSet.class
--------------------------------------------------------------------------------
/android/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/android/bin/res/crunch/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/res/crunch/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/android/bin/res/crunch/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/res/crunch/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/android/bin/res/crunch/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/bin/res/crunch/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/android/gen/com/kcly/ane/bitmapdataqrcodescanner/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.kcly.ane.bitmapdataqrcodescanner;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/android/gen/com/kcly/ane/bitmapdataqrcodescanner/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.kcly.ane.bitmapdataqrcodescanner;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static int icon=0x7f020000;
15 | }
16 | public static final class id {
17 | public static int ScanButton=0x7f060002;
18 | public static int cameraPreview=0x7f060000;
19 | public static int scanText=0x7f060001;
20 | }
21 | public static final class layout {
22 | public static int campreview=0x7f030000;
23 | }
24 | public static final class raw {
25 | public static int debugger=0x7f040000;
26 | }
27 | public static final class string {
28 | public static int app_name=0x7f050001;
29 | public static int hello=0x7f050000;
30 | public static int lbl1=0x7f050002;
31 | public static int lbl2=0x7f050003;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/android/libs/FlashRuntimeExtensions.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/FlashRuntimeExtensions.jar
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/armeabi-v7a/libiconv.so
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/armeabi-v7a/libzbarjni.so
--------------------------------------------------------------------------------
/android/libs/armeabi/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/armeabi/libiconv.so
--------------------------------------------------------------------------------
/android/libs/armeabi/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/armeabi/libzbarjni.so
--------------------------------------------------------------------------------
/android/libs/x86/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/x86/libiconv.so
--------------------------------------------------------------------------------
/android/libs/x86/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/libs/x86/libzbarjni.so
--------------------------------------------------------------------------------
/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | android.library=true
14 | # Project target.
15 | target=Google Inc.:Google APIs:17
16 |
--------------------------------------------------------------------------------
/android/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/android/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/android/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/android/res/layout/campreview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
21 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/android/res/raw/armeabi/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/raw/armeabi/libiconv.so
--------------------------------------------------------------------------------
/android/res/raw/armeabi/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/raw/armeabi/libzbarjni.so
--------------------------------------------------------------------------------
/android/res/raw/debugger.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/android/res/raw/debugger.info
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World!
4 | GyroscopeExtension
5 | Scanning
6 | Scan
7 |
8 |
--------------------------------------------------------------------------------
/android/src/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path: FlashRuntimeExtensions.jar
3 |
4 |
--------------------------------------------------------------------------------
/android/src/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtension.java:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner;
2 |
3 | import com.adobe.fre.FREContext;
4 | import com.adobe.fre.FREExtension;
5 |
6 | public class ScannerExtension implements FREExtension {
7 |
8 | @Override
9 | public FREContext createContext(String ctxType) {
10 | return ScannerExtensionContext.getInstance();
11 | }
12 |
13 | @Override
14 | public void dispose() {
15 | ScannerExtensionContext.getInstance().dispose();
16 | }
17 |
18 | @Override
19 | public void initialize() {
20 | // TODO Auto-generated method stub
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/android/src/com/kcly/ane/bitmapdataqrcodescanner/ScannerExtensionContext.java:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import net.sourceforge.zbar.Config;
7 | import net.sourceforge.zbar.ImageScanner;
8 | import net.sourceforge.zbar.Symbol;
9 |
10 | import com.adobe.fre.FREContext;
11 | import com.adobe.fre.FREFunction;
12 | import com.kcly.ane.bitmapdataqrcodescanner.function.ScanFunction;
13 | import com.kcly.ane.bitmapdataqrcodescanner.function.StopFunction;
14 |
15 | public class ScannerExtensionContext extends FREContext {
16 |
17 | // ZBar Objects
18 | ImageScanner scanner;
19 | private boolean launched = false;
20 |
21 | public static final String FRE_EXTENSION_CONTEXT = "com.kcly.ane.bitmapdataqrcodescanner.freContext";
22 |
23 | private static final ScannerExtensionContext INSTANCE = new ScannerExtensionContext();
24 |
25 | private ScannerExtensionContext() {
26 | this.resetScanner();
27 | }
28 |
29 | public static ScannerExtensionContext getInstance() {
30 | return INSTANCE;
31 | }
32 |
33 | @Override
34 | public void dispose() {
35 | scanner.destroy();
36 | scanner = null;
37 | }
38 |
39 | @Override
40 | public Map getFunctions() {
41 | Map functionMap = new HashMap();
42 |
43 | functionMap.put("scan", new ScanFunction() );
44 | functionMap.put("stop", new StopFunction() );
45 |
46 | return functionMap;
47 | }
48 |
49 | private void resetScanner() {
50 | ImageScanner is = new ImageScanner();
51 |
52 | is.setConfig(0, Config.X_DENSITY, 1);
53 | is.setConfig(0, Config.Y_DENSITY, 1);
54 | is.setConfig(0, Config.ENABLE, 0);
55 | is.setConfig(Symbol.QRCODE, Config.ENABLE, 1);
56 |
57 | launched = true;
58 | scanner = is;
59 | }
60 |
61 | public boolean isLaunched() {
62 | return launched;
63 | }
64 |
65 | public ImageScanner getScanner() {
66 | return scanner;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/android/src/com/kcly/ane/bitmapdataqrcodescanner/function/ScanFunction.java:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner.function;
2 |
3 | import android.graphics.*;
4 | import android.graphics.Bitmap.Config;
5 |
6 | import com.adobe.fre.FREContext;
7 | import com.adobe.fre.FREFunction;
8 | import com.adobe.fre.FREObject;
9 | import com.adobe.fre.FREBitmapData;
10 | import com.kcly.ane.bitmapdataqrcodescanner.ScannerExtensionContext;
11 |
12 | import net.sourceforge.zbar.Image;
13 | import net.sourceforge.zbar.ImageScanner;
14 | import net.sourceforge.zbar.Symbol;
15 | import net.sourceforge.zbar.SymbolSet;
16 |
17 | public class ScanFunction implements FREFunction {
18 |
19 | @Override
20 | public FREObject call(FREContext ctx, FREObject[] args) {
21 |
22 | FREObject retVal;
23 | retVal = null;
24 |
25 | try {
26 | FREBitmapData inputValue = (FREBitmapData)args[0];
27 | inputValue.acquire();
28 | int width = inputValue.getWidth();
29 | int height = inputValue.getHeight();
30 | int[] pixels = new int[width * height];
31 | Bitmap bmp = Bitmap.createBitmap(width, height, Config.ARGB_8888);
32 | bmp.copyPixelsFromBuffer(inputValue.getBits());
33 |
34 | bmp.getPixels(pixels, 0, width, 0, 0, width, height);
35 |
36 |
37 | ImageScanner reader = ScannerExtensionContext.getInstance().getScanner();
38 | Image myImage = new Image(width, height, "RGB4");
39 | myImage.setData(pixels);
40 | int result = reader.scanImage(myImage.convert("Y800"));
41 |
42 | inputValue.release();
43 |
44 | if (result != 0) {
45 | SymbolSet syms = reader.getResults();
46 | for (Symbol sym : syms) {
47 | ScannerExtensionContext freContext = ScannerExtensionContext.getInstance();
48 | freContext.dispatchStatusEventAsync("data", sym.getData());
49 | return null;
50 | }
51 | }
52 | } catch (Exception e) {
53 | return null;
54 | }
55 |
56 | return retVal;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/android/src/com/kcly/ane/bitmapdataqrcodescanner/function/StopFunction.java:
--------------------------------------------------------------------------------
1 | package com.kcly.ane.bitmapdataqrcodescanner.function;
2 |
3 | import com.adobe.fre.FREContext;
4 | import com.adobe.fre.FREFunction;
5 | import com.adobe.fre.FREObject;
6 | import com.kcly.ane.bitmapdataqrcodescanner.ScannerExtensionContext;
7 |
8 | public class StopFunction implements FREFunction {
9 |
10 | @Override
11 | public FREObject call(FREContext ctx, FREObject[] args) {
12 |
13 | FREObject retVal = null;
14 | ScannerExtensionContext extCtx = (ScannerExtensionContext)ctx;
15 |
16 | try {
17 |
18 | if(extCtx.isLaunched()){
19 | extCtx.getActivity().finishActivity(100);
20 | retVal = FREObject.newObject(true);
21 | }else{
22 | retVal = FREObject.newObject(true);
23 | }
24 | } catch (Exception e) {
25 | return null;
26 | }
27 | return retVal;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/Config.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Config
3 | *
4 | * Copyright 2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Decoder configuration options.
29 | */
30 | public class Config
31 | {
32 | /** Enable symbology/feature. */
33 | public static final int ENABLE = 0;
34 | /** Enable check digit when optional. */
35 | public static final int ADD_CHECK = 1;
36 | /** Return check digit when present. */
37 | public static final int EMIT_CHECK = 2;
38 | /** Enable full ASCII character set. */
39 | public static final int ASCII = 3;
40 |
41 | /** Minimum data length for valid decode. */
42 | public static final int MIN_LEN = 0x20;
43 | /** Maximum data length for valid decode. */
44 | public static final int MAX_LEN = 0x21;
45 |
46 | /** Required video consistency frames. */
47 | public static final int UNCERTAINTY = 0x40;
48 |
49 | /** Enable scanner to collect position data. */
50 | public static final int POSITION = 0x80;
51 |
52 | /** Image scanner vertical scan density. */
53 | public static final int X_DENSITY = 0x100;
54 | /** Image scanner horizontal scan density. */
55 | public static final int Y_DENSITY = 0x101;
56 | }
57 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/Image.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Image
3 | *
4 | * Copyright 2007-2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** stores image data samples along with associated format and size
29 | * metadata.
30 | */
31 | public class Image
32 | {
33 | /** C pointer to a zbar_symbol_t. */
34 | private long peer;
35 | private Object data;
36 |
37 | static
38 | {
39 | System.loadLibrary("iconv");
40 | System.loadLibrary("zbarjni");
41 | init();
42 | }
43 | private static native void init();
44 |
45 | public Image ()
46 | {
47 | peer = create();
48 | }
49 |
50 | public Image (int width, int height)
51 | {
52 | this();
53 | setSize(width, height);
54 | }
55 |
56 | public Image (int width, int height, String format)
57 | {
58 | this();
59 | setSize(width, height);
60 | setFormat(format);
61 | }
62 |
63 | public Image (String format)
64 | {
65 | this();
66 | setFormat(format);
67 | }
68 |
69 | Image (long peer)
70 | {
71 | this.peer = peer;
72 | }
73 |
74 | /** Create an associated peer instance. */
75 | private native long create();
76 |
77 | protected void finalize ()
78 | {
79 | destroy();
80 | }
81 |
82 | /** Clean up native data associated with an instance. */
83 | public synchronized void destroy ()
84 | {
85 | if(peer != 0) {
86 | destroy(peer);
87 | peer = 0;
88 | }
89 | }
90 |
91 | /** Destroy the associated peer instance. */
92 | private native void destroy(long peer);
93 |
94 | /** Image format conversion.
95 | * @returns a @em new image with the sample data from the original
96 | * image converted to the requested format fourcc. the original
97 | * image is unaffected.
98 | */
99 | public Image convert (String format)
100 | {
101 | long newpeer = convert(peer, format);
102 | if(newpeer == 0)
103 | return(null);
104 | return(new Image(newpeer));
105 | }
106 |
107 | private native long convert(long peer, String format);
108 |
109 | /** Retrieve the image format fourcc. */
110 | public native String getFormat();
111 |
112 | /** Specify the fourcc image format code for image sample data. */
113 | public native void setFormat(String format);
114 |
115 | /** Retrieve a "sequence" (page/frame) number associated with this
116 | * image.
117 | */
118 | public native int getSequence();
119 |
120 | /** Associate a "sequence" (page/frame) number with this image. */
121 | public native void setSequence(int seq);
122 |
123 | /** Retrieve the width of the image. */
124 | public native int getWidth();
125 |
126 | /** Retrieve the height of the image. */
127 | public native int getHeight();
128 |
129 | /** Retrieve the size of the image. */
130 | public native int[] getSize();
131 |
132 | /** Specify the pixel size of the image. */
133 | public native void setSize(int width, int height);
134 |
135 | /** Specify the pixel size of the image. */
136 | public native void setSize(int[] size);
137 |
138 | /** Retrieve the crop region of the image. */
139 | public native int[] getCrop();
140 |
141 | /** Specify the crop region of the image. */
142 | public native void setCrop(int x, int y, int width, int height);
143 |
144 | /** Specify the crop region of the image. */
145 | public native void setCrop(int[] crop);
146 |
147 | /** Retrieve the image sample data. */
148 | public native byte[] getData();
149 |
150 | /** Specify image sample data. */
151 | public native void setData(byte[] data);
152 |
153 | /** Specify image sample data. */
154 | public native void setData(int[] data);
155 |
156 | /** Retrieve the decoded results associated with this image. */
157 | public SymbolSet getSymbols ()
158 | {
159 | return(new SymbolSet(getSymbols(peer)));
160 | }
161 |
162 | private native long getSymbols(long peer);
163 |
164 | }
165 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/ImageScanner.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * ImageScanner
3 | *
4 | * Copyright 2007-2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Read barcodes from 2-D images.
29 | */
30 | public class ImageScanner
31 | {
32 | /** C pointer to a zbar_image_scanner_t. */
33 | private long peer;
34 |
35 | static
36 | {
37 | System.loadLibrary("iconv");
38 | System.loadLibrary("zbarjni");
39 | init();
40 | }
41 | private static native void init();
42 |
43 | public ImageScanner ()
44 | {
45 | peer = create();
46 | }
47 |
48 | /** Create an associated peer instance. */
49 | private native long create();
50 |
51 | protected void finalize ()
52 | {
53 | destroy();
54 | }
55 |
56 | /** Clean up native data associated with an instance. */
57 | public synchronized void destroy ()
58 | {
59 | if(peer != 0) {
60 | destroy(peer);
61 | peer = 0;
62 | }
63 | }
64 |
65 | /** Destroy the associated peer instance. */
66 | private native void destroy(long peer);
67 |
68 | /** Set config for indicated symbology (0 for all) to specified value.
69 | */
70 | public native void setConfig(int symbology, int config, int value)
71 | throws IllegalArgumentException;
72 |
73 | /** Parse configuration string and apply to image scanner. */
74 | public native void parseConfig(String config);
75 |
76 | /** Enable or disable the inter-image result cache (default disabled).
77 | * Mostly useful for scanning video frames, the cache filters duplicate
78 | * results from consecutive images, while adding some consistency
79 | * checking and hysteresis to the results. Invoking this method also
80 | * clears the cache.
81 | */
82 | public native void enableCache(boolean enable);
83 |
84 | /** Retrieve decode results for last scanned image.
85 | * @returns the SymbolSet result container
86 | */
87 | public SymbolSet getResults ()
88 | {
89 | return(new SymbolSet(getResults(peer)));
90 | }
91 |
92 | private native long getResults(long peer);
93 |
94 | /** Scan for symbols in provided Image.
95 | * The image format must currently be "Y800" or "GRAY".
96 | * @returns the number of symbols successfully decoded from the image.
97 | */
98 | public native int scanImage(Image image);
99 | }
100 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/Modifier.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Modifier
3 | *
4 | * Copyright 2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Decoder symbology modifiers.
29 | */
30 | public class Modifier
31 | {
32 | /** barcode tagged as GS1 (EAN.UCC) reserved
33 | * (eg, FNC1 before first data character).
34 | * data may be parsed as a sequence of GS1 AIs
35 | */
36 | public static final int GS1 = 0;
37 |
38 | /** barcode tagged as AIM reserved
39 | * (eg, FNC1 after first character or digit pair)
40 | */
41 | public static final int AIM = 1;
42 | }
43 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/Orientation.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Orientation
3 | *
4 | * Copyright 2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Decoded symbol coarse orientation.
29 | */
30 | public class Orientation
31 | {
32 | /** Unable to determine orientation. */
33 | public static final int UNKNOWN = -1;
34 | /** Upright, read left to right. */
35 | public static final int UP = 0;
36 | /** sideways, read top to bottom */
37 | public static final int RIGHT = 1;
38 | /** upside-down, read right to left */
39 | public static final int DOWN = 2;
40 | /** sideways, read bottom to top */
41 | public static final int LEFT = 3;
42 | }
43 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/Symbol.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Symbol
3 | *
4 | * Copyright 2007-2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Immutable container for decoded result symbols associated with an image
29 | * or a composite symbol.
30 | */
31 | public class Symbol
32 | {
33 | /** No symbol decoded. */
34 | public static final int NONE = 0;
35 | /** Symbol detected but not decoded. */
36 | public static final int PARTIAL = 1;
37 |
38 | /** EAN-8. */
39 | public static final int EAN8 = 8;
40 | /** UPC-E. */
41 | public static final int UPCE = 9;
42 | /** ISBN-10 (from EAN-13). */
43 | public static final int ISBN10 = 10;
44 | /** UPC-A. */
45 | public static final int UPCA = 12;
46 | /** EAN-13. */
47 | public static final int EAN13 = 13;
48 | /** ISBN-13 (from EAN-13). */
49 | public static final int ISBN13 = 14;
50 | /** Interleaved 2 of 5. */
51 | public static final int I25 = 25;
52 | /** DataBar (RSS-14). */
53 | public static final int DATABAR = 34;
54 | /** DataBar Expanded. */
55 | public static final int DATABAR_EXP = 35;
56 | /** Codabar. */
57 | public static final int CODABAR = 38;
58 | /** Code 39. */
59 | public static final int CODE39 = 39;
60 | /** PDF417. */
61 | public static final int PDF417 = 57;
62 | /** QR Code. */
63 | public static final int QRCODE = 64;
64 | /** Code 93. */
65 | public static final int CODE93 = 93;
66 | /** Code 128. */
67 | public static final int CODE128 = 128;
68 |
69 | /** C pointer to a zbar_symbol_t. */
70 | private long peer;
71 |
72 | /** Cached attributes. */
73 | private int type;
74 |
75 | static
76 | {
77 | System.loadLibrary("zbarjni");
78 | init();
79 | }
80 | private static native void init();
81 |
82 | /** Symbols are only created by other package methods. */
83 | Symbol (long peer)
84 | {
85 | this.peer = peer;
86 | }
87 |
88 | protected void finalize ()
89 | {
90 | destroy();
91 | }
92 |
93 | /** Clean up native data associated with an instance. */
94 | public synchronized void destroy ()
95 | {
96 | if(peer != 0) {
97 | destroy(peer);
98 | peer = 0;
99 | }
100 | }
101 |
102 | /** Release the associated peer instance. */
103 | private native void destroy(long peer);
104 |
105 | /** Retrieve type of decoded symbol. */
106 | public int getType ()
107 | {
108 | if(type == 0)
109 | type = getType(peer);
110 | return(type);
111 | }
112 |
113 | private native int getType(long peer);
114 |
115 | /** Retrieve symbology boolean configs settings used during decode. */
116 | public native int getConfigMask();
117 |
118 | /** Retrieve symbology characteristics detected during decode. */
119 | public native int getModifierMask();
120 |
121 | /** Retrieve data decoded from symbol as a String. */
122 | public native String getData();
123 |
124 | /** Retrieve raw data bytes decoded from symbol. */
125 | public native byte[] getDataBytes();
126 |
127 | /** Retrieve a symbol confidence metric. Quality is an unscaled,
128 | * relative quantity: larger values are better than smaller
129 | * values, where "large" and "small" are application dependent.
130 | */
131 | public native int getQuality();
132 |
133 | /** Retrieve current cache count. When the cache is enabled for
134 | * the image_scanner this provides inter-frame reliability and
135 | * redundancy information for video streams.
136 | * @returns < 0 if symbol is still uncertain
137 | * @returns 0 if symbol is newly verified
138 | * @returns > 0 for duplicate symbols
139 | */
140 | public native int getCount();
141 |
142 | /** Retrieve an approximate, axis-aligned bounding box for the
143 | * symbol.
144 | */
145 | public int[] getBounds ()
146 | {
147 | int n = getLocationSize(peer);
148 | if(n <= 0)
149 | return(null);
150 |
151 | int[] bounds = new int[4];
152 | int xmin = Integer.MAX_VALUE;
153 | int xmax = Integer.MIN_VALUE;
154 | int ymin = Integer.MAX_VALUE;
155 | int ymax = Integer.MIN_VALUE;
156 |
157 | for(int i = 0; i < n; i++) {
158 | int x = getLocationX(peer, i);
159 | if(xmin > x) xmin = x;
160 | if(xmax < x) xmax = x;
161 |
162 | int y = getLocationY(peer, i);
163 | if(ymin > y) ymin = y;
164 | if(ymax < y) ymax = y;
165 | }
166 | bounds[0] = xmin;
167 | bounds[1] = ymin;
168 | bounds[2] = xmax - xmin;
169 | bounds[3] = ymax - ymin;
170 | return(bounds);
171 | }
172 |
173 | private native int getLocationSize(long peer);
174 | private native int getLocationX(long peer, int idx);
175 | private native int getLocationY(long peer, int idx);
176 |
177 | public int[] getLocationPoint (int idx)
178 | {
179 | int[] p = new int[2];
180 | p[0] = getLocationX(peer, idx);
181 | p[1] = getLocationY(peer, idx);
182 | return(p);
183 | }
184 |
185 | /** Retrieve general axis-aligned, orientation of decoded
186 | * symbol.
187 | */
188 | public native int getOrientation();
189 |
190 | /** Retrieve components of a composite result. */
191 | public SymbolSet getComponents ()
192 | {
193 | return(new SymbolSet(getComponents(peer)));
194 | }
195 |
196 | private native long getComponents(long peer);
197 |
198 | native long next();
199 | }
200 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/SymbolIterator.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * SymbolIterator
3 | *
4 | * Copyright 2007-2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Iterator over a SymbolSet.
29 | */
30 | public class SymbolIterator
31 | implements java.util.Iterator
32 | {
33 | /** Next symbol to be returned by the iterator. */
34 | private Symbol current;
35 |
36 | /** SymbolIterators are only created by internal interface methods. */
37 | SymbolIterator (Symbol first)
38 | {
39 | current = first;
40 | }
41 |
42 | /** Returns true if the iteration has more elements. */
43 | public boolean hasNext ()
44 | {
45 | return(current != null);
46 | }
47 |
48 | /** Retrieves the next element in the iteration. */
49 | public Symbol next ()
50 | {
51 | if(current == null)
52 | throw(new java.util.NoSuchElementException
53 | ("access past end of SymbolIterator"));
54 |
55 | Symbol result = current;
56 | long sym = current.next();
57 | if(sym != 0)
58 | current = new Symbol(sym);
59 | else
60 | current = null;
61 | return(result);
62 | }
63 |
64 | /** Raises UnsupportedOperationException. */
65 | public void remove ()
66 | {
67 | throw(new UnsupportedOperationException
68 | ("SymbolIterator is immutable"));
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/android/src/net/sourceforge/zbar/SymbolSet.java:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * SymbolSet
3 | *
4 | * Copyright 2007-2010 (c) Jeff Brown
5 | *
6 | * This file is part of the ZBar Bar Code Reader.
7 | *
8 | * The ZBar Bar Code Reader is free software; you can redistribute it
9 | * and/or modify it under the terms of the GNU Lesser Public License as
10 | * published by the Free Software Foundation; either version 2.1 of
11 | * the License, or (at your option) any later version.
12 | *
13 | * The ZBar Bar Code Reader is distributed in the hope that it will be
14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU Lesser Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser Public License
19 | * along with the ZBar Bar Code Reader; if not, write to the Free
20 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21 | * Boston, MA 02110-1301 USA
22 | *
23 | * http://sourceforge.net/projects/zbar
24 | *------------------------------------------------------------------------*/
25 |
26 | package net.sourceforge.zbar;
27 |
28 | /** Immutable container for decoded result symbols associated with an image
29 | * or a composite symbol.
30 | */
31 | public class SymbolSet
32 | extends java.util.AbstractCollection
33 | {
34 | /** C pointer to a zbar_symbol_set_t. */
35 | private long peer;
36 |
37 | static
38 | {
39 | System.loadLibrary("iconv");
40 | System.loadLibrary("zbarjni");
41 | init();
42 | }
43 | private static native void init();
44 |
45 | /** SymbolSets are only created by other package methods. */
46 | SymbolSet (long peer)
47 | {
48 | this.peer = peer;
49 | }
50 |
51 | protected void finalize ()
52 | {
53 | destroy();
54 | }
55 |
56 | /** Clean up native data associated with an instance. */
57 | public synchronized void destroy ()
58 | {
59 | if(peer != 0) {
60 | destroy(peer);
61 | peer = 0;
62 | }
63 | }
64 |
65 | /** Release the associated peer instance. */
66 | private native void destroy(long peer);
67 |
68 | /** Retrieve an iterator over the Symbol elements in this collection. */
69 | public java.util.Iterator iterator ()
70 | {
71 | long sym = firstSymbol(peer);
72 | if(sym == 0)
73 | return(new SymbolIterator(null));
74 |
75 | return(new SymbolIterator(new Symbol(sym)));
76 | }
77 |
78 | /** Retrieve the number of elements in the collection. */
79 | public native int size();
80 |
81 | /** Retrieve C pointer to first symbol in the set. */
82 | private native long firstSymbol(long peer);
83 | }
84 |
--------------------------------------------------------------------------------
/ane/build_ane.bat:
--------------------------------------------------------------------------------
1 | ::edit Flex SDK bin folder path
2 | set FLEX_SDK=C:\Users\luar\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+18.0.0
3 |
4 | ::do not edit below
5 |
6 | @echo off
7 | echo "build com.kcly.ane.bitmapdataqrcodescanner.ane..."
8 | "%FLEX_SDK%\bin\adt.bat" -package -target ane com.kcly.ane.bitmapdataqrcodescanner.ane extension.xml -swc com.kcly.ane.bitmapdataqrcodescanner.swc -platform Android-ARM library.swf libBitmapDataQRCodeScanner.jar libs res -platform iPhone-ARM library.swf libBitmapDataQRCodeScanner.a platform.xml
9 | echo "Done!"
--------------------------------------------------------------------------------
/ane/com.kcly.ane.bitmapdataqrcodescanner.ane:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/com.kcly.ane.bitmapdataqrcodescanner.ane
--------------------------------------------------------------------------------
/ane/com.kcly.ane.bitmapdataqrcodescanner.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/com.kcly.ane.bitmapdataqrcodescanner.swc
--------------------------------------------------------------------------------
/ane/extension.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 | com.kcly.ane.bitmapdataqrcodescanner
14 | 1
15 |
16 |
17 |
18 | libBitmapDataQRCodeScanner.a
19 | ScannerExtInitializer
20 | ScannerExtFinalizer
21 |
22 |
23 |
24 |
25 | libBitmapDataQRCodeScanner.jar
26 | com.kcly.ane.bitmapdataqrcodescanner.ScannerExtension
27 | com.kcly.ane.bitmapdataqrcodescanner.ScannerExtension
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ane/libBitmapDataQRCodeScanner.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libBitmapDataQRCodeScanner.a
--------------------------------------------------------------------------------
/ane/libBitmapDataQRCodeScanner.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libBitmapDataQRCodeScanner.jar
--------------------------------------------------------------------------------
/ane/library.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/library.swf
--------------------------------------------------------------------------------
/ane/libs/FlashRuntimeExtensions.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/FlashRuntimeExtensions.jar
--------------------------------------------------------------------------------
/ane/libs/armeabi-v7a/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/armeabi-v7a/libiconv.so
--------------------------------------------------------------------------------
/ane/libs/armeabi-v7a/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/armeabi-v7a/libzbarjni.so
--------------------------------------------------------------------------------
/ane/libs/armeabi/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/armeabi/libiconv.so
--------------------------------------------------------------------------------
/ane/libs/armeabi/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/armeabi/libzbarjni.so
--------------------------------------------------------------------------------
/ane/libs/x86/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/x86/libiconv.so
--------------------------------------------------------------------------------
/ane/libs/x86/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/libs/x86/libzbarjni.so
--------------------------------------------------------------------------------
/ane/platform.xml:
--------------------------------------------------------------------------------
1 |
2 | 5.0
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/ane/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/ane/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/ane/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/ane/res/layout/campreview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
21 |
22 |
23 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ane/res/raw/armeabi/libiconv.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/raw/armeabi/libiconv.so
--------------------------------------------------------------------------------
/ane/res/raw/armeabi/libzbarjni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/raw/armeabi/libzbarjni.so
--------------------------------------------------------------------------------
/ane/res/raw/debugger.info:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ane/res/raw/debugger.info
--------------------------------------------------------------------------------
/ane/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World!
4 | GyroscopeExtension
5 | Scanning
6 | Scan
7 |
8 |
--------------------------------------------------------------------------------
/example/AIR_Android_readme.txt:
--------------------------------------------------------------------------------
1 | AIR for Android instructions
2 |
3 | 1. Configuration:
4 |
5 | - edit 'bat\SetupSDK.bat' for paths to Flex SDK and Android SDK (default should be ok)
6 |
7 | - install your device's USB drivers:
8 | http://developer.android.com/sdk/oem-usb.html
9 | - enable "USB debugging" on your Android device:
10 | Parameters > Applications > Development > USB Debugging
11 |
12 |
13 | 2. Creating a self-signed certificate:
14 |
15 | - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
16 |
17 | (!) wait a minute before packaging.
18 |
19 |
20 | 3. Build from FlashDevelop as usual (F8)
21 |
22 |
23 | 4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
24 |
25 |
26 | 5. Install AIR runtime on your device:
27 |
28 | - run 'bat\InstallAirRuntime.bat'
29 |
30 |
31 | 6. Running/debugging the application on the device:
32 |
33 | 6.a. Build/Debug directly on device
34 | - edit 'Run.bat' and change the run target 'goto desktop' by 'goto android-debug'
35 | - build & run as usual (Ctrl+Enter or F5) to package, install & run the application on your device
36 |
37 | 6.b. Debug occasionally on device
38 | - Debug-build from FlashDevelop (F8)
39 | - run 'PackageApp.bat' to package and install a debug version of the application
40 | - start FlashDevelop debugger: Debug > Start Remote Session
41 | - start the application on device
42 | - the application should connect to FlashDevelop interactive debugger as usual
43 |
44 |
45 | 7. Packaging for release:
46 |
47 | - Release-build from FlashDevelop (F8)
48 | - run 'PackageApp.bat' and select Android/normal target
49 |
--------------------------------------------------------------------------------
/example/AIR_iOS_readme.txt:
--------------------------------------------------------------------------------
1 | AIR for iOS instructions
2 |
3 | 1. Configuration:
4 |
5 | - edit 'bat\SetupSDK.bat' for path to Flex SDK (defaults should be ok)
6 |
7 |
8 | 3. Build from FlashDevelop as usual (F8)
9 |
10 |
11 | 4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
12 |
13 |
14 | 5. Configure for iOS packaging in 'bat\SetupApplication.bat':
15 |
16 | Take a deep breath, pay the Apple tax and read extra carefully this tutorial:
17 | - http://www.codeandvisual.com/2011/exporting-for-iphone-using-air-27-and-flashdevelop-part-three-generating-developer-certificates-provisioning-profiles-and-p12-files/
18 |
19 | Now this is how to create the p12 key entirely on Windows:
20 | - http://blog.nngafook.com/2012/06/ios-certificate-process/
21 |
22 | And later to sign the application for the App Store publication:
23 | - http://blog.nngafook.com/2013/03/packaging-and-submitting-your-app-to-apple-on-windows-kind-of/
24 |
25 | Then for each project you'll have to go to on Apple's iOS Provisioning Portal:
26 | - create a new App ID with: name of the project and ID indicated in 'application.xml',
27 | - create a new Provisioning Profile: select App ID & registered devices that will be allowed to install the app.
28 |
29 | Once you have obtained a .p12 and .mobileprovision file from Apple's Provisioning Portal:
30 | - save a copy of your .p12 and .mobileprovision certificates in the 'cert\' folder in your FlashDevelop project.
31 | (make sure to keep an extra copy of these 2 files in a safe place)
32 |
33 | Finally edit 'bat\SetupApplication.bat' and complete the following lines:
34 |
35 | - IOS_DEV_CERT_FILE: path to your iOS developer 'p12' key ('cert\' folder, if you have followed the instructions above)
36 | - IOS_DEV_CERT_PASS: developer certificate's password
37 | if you don't set it, remove "-storepass %IOS_DEV_CERT_PASS%" from the IOS_SIGNING_OPTIONS,
38 | you'll be prompted to type it when packaging.
39 | - IOS_PROVISION: path to the project's Provisioning Profile file
40 |
41 | For example:
42 |
43 | set IOS_DIST_CERT_FILE=cert\iphone_dev.p12
44 | set IOS_DEV_CERT_FILE=cert\iphone_dev.p12
45 | set IOS_DEV_CERT_PASS=YourPassword
46 | set IOS_PROVISION=cert\YourFileName.mobileprovision
47 |
48 |
49 | 6. Running/debugging the application on the device:
50 |
51 | Note: if are testing your application for performance, always package for release (see step 7.)
52 |
53 | 6.a. Build/Debug on device
54 | - edit 'Run.bat' and change the run target 'goto desktop' by 'goto ios-debug'
55 | - build as usual (Ctrl+Enter or F5) to package
56 | - you'll still have to manually upload & run the app on the device
57 | - the application should connect to FlashDevelop interactive debugger as usual
58 |
59 | 6.b. Debug occasionally on device
60 | - Debug-build from FlashDevelop (F8)
61 | - run 'PackageApp.bat' to package and install a debug version of the application
62 | - start FlashDevelop debugger: Debug > Start Remote Session
63 | - start the application on device
64 | - the application should connect to FlashDevelop interactive debugger as usual
65 |
66 |
67 | 7. Packaging for release:
68 |
69 | - edit in 'bat\SetupApplication.bat' to add your "distribution" certificate (IOS_DIST_CERT_FILE)
70 | Note: you can package ad-hoc IPAs using your developer certificate.
71 |
72 | - Release-build from FlashDevelop (F8)
73 | - run 'PackageApp.bat' and select
74 | either iOS/"ad-hoc" for installation on test devices
75 | or iOS/App Store for upload in the iOS App Store.
76 |
77 | Tips:
78 | - iFunBox: iTunes replacement; installs app faster even if app version doesn't change,
79 | - TestFlightApp: ad-hoc distribution service http://testflightapp.com
80 | - HockeyKit: self hosted ad-hoc distribution https://github.com/TheRealKerni/HockeyKit
81 | - Manual ad-hoc distribution: http://samvermette.com/71
82 |
83 |
--------------------------------------------------------------------------------
/example/BitmapDataQRCodeScanner.as3proj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/example/PackageApp.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set PAUSE_ERRORS=1
3 | call bat\SetupSDK.bat
4 | call bat\SetupApplication.bat
5 |
6 | :menu
7 | echo.
8 | echo Package for target
9 | echo.
10 | echo Android:
11 | echo.
12 | echo [1] normal (apk)
13 | echo [2] debug (apk-debug)
14 | echo [3] captive (apk-captive-runtime)
15 | echo.
16 | echo iOS:
17 | echo.
18 | echo [4] fast test (ipa-test-interpreter)
19 | echo [5] fast debug (ipa-debug-interpreter)
20 | echo [6] slow test (ipa-test)
21 | echo [7] slow debug (ipa-debug)
22 | echo [8] "ad-hoc" (ipa-ad-hoc)
23 | echo [9] App Store (ipa-app-store)
24 | echo.
25 |
26 | :choice
27 | set /P C=[Choice]:
28 | echo.
29 |
30 | set PLATFORM=android
31 | set OPTIONS=
32 | if %C% GTR 3 set PLATFORM=ios
33 | if %C% GTR 7 set PLATFORM=ios-dist
34 |
35 | if "%C%"=="1" set TARGET=
36 | if "%C%"=="2" set TARGET=-debug
37 | if "%C%"=="2" set OPTIONS=-connect %DEBUG_IP%
38 | if "%C%"=="3" set TARGET=-captive-runtime
39 |
40 | if "%C%"=="4" set TARGET=-test-interpreter
41 | if "%C%"=="5" set TARGET=-debug-interpreter
42 | if "%C%"=="5" set OPTIONS=-connect %DEBUG_IP%
43 | if "%C%"=="6" set TARGET=-test
44 | if "%C%"=="7" set TARGET=-debug
45 | if "%C%"=="7" set OPTIONS=-connect %DEBUG_IP%
46 | if "%C%"=="8" set TARGET=-ad-hoc
47 | if "%C%"=="9" set TARGET=-app-store
48 |
49 | call bat\Packager.bat
50 |
51 | if "%PLATFORM%"=="android" goto android-package
52 |
53 | :ios-package
54 | if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
55 | echo Now manually install and start application on device
56 | echo.
57 | goto end
58 |
59 | :ios-install
60 | echo Installing application for testing on iOS (%DEBUG_IP%)
61 | echo.
62 | call adt -installApp -platform ios -package "%OUTPUT%"
63 | if errorlevel 1 goto installfail
64 |
65 | echo Now manually start application on device
66 | echo.
67 | goto end
68 |
69 | :android-package
70 | adb devices
71 | echo.
72 | echo Installing %OUTPUT% on the device...
73 | echo.
74 | adb -d install -r "%OUTPUT%"
75 | if errorlevel 1 goto installfail
76 | goto end
77 |
78 | :installfail
79 | echo.
80 | echo Installing the app on the device failed
81 |
82 | :end
83 | pause
84 |
--------------------------------------------------------------------------------
/example/Run.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set PAUSE_ERRORS=1
3 | call bat\SetupSDK.bat
4 | call bat\SetupApplication.bat
5 |
6 | :target
7 | ::goto desktop
8 | ::goto android-debug
9 | goto android-test
10 | set INTERPRETER=-interpreter
11 | ::goto ios-debug
12 | ::goto ios-test
13 |
14 | :desktop
15 | :: http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-6fa6d7e0128cca93d31-8000.html
16 |
17 | set SCREEN_SIZE=NexusOne
18 | ::set SCREEN_SIZE=iPhoneRetina
19 |
20 | :desktop-run
21 | echo.
22 | echo Starting AIR Debug Launcher with screen size '%SCREEN_SIZE%'
23 | echo.
24 | echo (hint: edit 'Run.bat' to test on device or change screen size)
25 | echo.
26 | adl -screensize %SCREEN_SIZE% "%APP_XML%" "%APP_DIR%"
27 | if errorlevel 1 goto end
28 | goto end
29 |
30 |
31 | :ios-debug
32 | echo.
33 | echo Packaging application for debugging on iOS %INTERPRETER%
34 | if "%INTERPRETER%" == "" echo (this will take a while)
35 | echo.
36 | set TARGET=-debug%INTERPRETER%
37 | set OPTIONS=-connect %DEBUG_IP%
38 | goto ios-package
39 |
40 | :ios-test
41 | echo.
42 | echo Packaging application for testing on iOS %INTERPRETER%
43 | if "%INTERPRETER%" == "" echo (this will take a while)
44 | echo.
45 | set TARGET=-test%INTERPRETER%
46 | set OPTIONS=
47 | goto ios-package
48 |
49 | :ios-package
50 | set PLATFORM=ios
51 | call bat\Packager.bat
52 |
53 | if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
54 | echo Now manually install and start application on device
55 | echo.
56 | goto end
57 |
58 | :ios-install
59 | echo Installing application for testing on iOS (%DEBUG_IP%)
60 | echo.
61 | call adt -installApp -platform ios -package "%OUTPUT%"
62 | if errorlevel 1 goto installfail
63 |
64 | echo Now manually start application on device
65 | echo.
66 | goto end
67 |
68 | :android-debug
69 | echo.
70 | echo Packaging and installing application for debugging on Android (%DEBUG_IP%)
71 | echo.
72 | set TARGET=-debug
73 | set OPTIONS=-connect %DEBUG_IP%
74 | goto android-package
75 |
76 | :android-test
77 | echo.
78 | echo Packaging and Installing application for testing on Android (%DEBUG_IP%)
79 | echo.
80 | set TARGET=
81 | set OPTIONS=
82 | goto android-package
83 |
84 | :android-package
85 | set PLATFORM=android
86 | call bat\Packager.bat
87 |
88 | adb devices
89 | echo.
90 | echo Installing %OUTPUT% on the device...
91 | echo.
92 | adb -d install -r "%OUTPUT%"
93 | if errorlevel 1 goto installfail
94 |
95 | echo.
96 | echo Starting application on the device for debugging...
97 | echo.
98 | adb shell am start -n air.%APP_ID%/.AppEntry
99 | exit
100 |
101 | :installfail
102 | echo.
103 | echo Installing the app on the device failed
104 |
105 | :end
106 | pause
107 |
--------------------------------------------------------------------------------
/example/application.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net.luar.air.BitmapDataQRCodeScanner
5 | 0.1
6 | mobileDevice
7 | BitmapDataQRCodeScanner
8 |
9 | BitmapData QRCode Scanner
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | ]]>
26 |
27 |
28 | UIStatusBarStyle
31 | UIStatusBarStyleBlackOpaque
32 | UIRequiresPersistentWiFi
33 | NO
34 | UIPrerenderedIcon
35 |
36 | UIApplicationExitsOnSuspend
37 |
38 |
39 | UIDeviceFamily
40 |
41 |
42 | 1
43 |
44 |
45 |
46 |
47 | ]]>
48 | high
49 |
50 |
51 |
52 | BitmapDataQRCodeScanner
53 | BitmapDataQRCodeScanner.swf
54 | true
55 | true
56 |
57 |
58 | direct
59 |
60 |
61 |
62 |
63 | icons/icon_48.png
64 | icons/icon_57.png
65 | icons/icon_72.png
66 | icons/icon_76.png
67 | icons/icon_96.png
68 | icons/icon_114.png
69 | icons/icon_120.png
70 | icons/icon_144.png
71 | icons/icon_152.png
72 |
73 |
74 |
75 |
76 | com.kcly.ane.bitmapdataqrcodescanner
77 |
78 |
79 |
92 |
--------------------------------------------------------------------------------
/example/bat/CreateCertificate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | cd..
3 | set PAUSE_ERRORS=1
4 | call bat\SetupSDK.bat
5 | call bat\SetupApplication.bat
6 |
7 | :: Generate
8 | echo.
9 | echo Generating a self-signed certificate for Android packaging
10 | call adt -certificate -validityPeriod 25 -cn %AND_CERT_NAME% 1024-RSA "%AND_CERT_FILE%" %AND_CERT_PASS%
11 | if errorlevel 1 goto failed
12 |
13 | :succeed
14 | echo.
15 | echo Certificate created: %AND_CERT_FILE% with password "%AND_CERT_PASS%"
16 | echo.
17 | if "%AND_CERT_PASS%" == "fd" echo (note: you did not change the default password)
18 | echo.
19 | echo HINTS:
20 | echo - you only need to generate this certificate once,
21 | echo - wait a minute before using this certificate to package your AIR application.
22 | echo.
23 | goto end
24 |
25 | :failed
26 | echo.
27 | echo Certificate creation FAILED.
28 | echo.
29 |
30 | :end
31 | pause
--------------------------------------------------------------------------------
/example/bat/InstallAirRuntime.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set PAUSE_ERRORS=1
3 | call SetupSDK.bat
4 |
5 | :: AIR runtime installer
6 | set AIR_INSTALLER=%FLEX_SDK%\runtimes\air\android\device\runtime.apk
7 |
8 |
9 | :: Install
10 | adb devices
11 | echo.
12 | echo Installing AIR runtime on current device:
13 | echo %AIR_INSTALLER%
14 | echo.
15 | adb install "%AIR_INSTALLER%"
16 | echo.
17 | if errorlevel 1 goto failed
18 | goto end
19 |
20 | :failed
21 | echo Troubleshooting:
22 | echo - one, and only one, Android device should be connected
23 | echo - verify 'SetupSDK.bat'
24 | echo.
25 | goto end
26 |
27 | :end
28 | pause
--------------------------------------------------------------------------------
/example/bat/Packager.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if "%PLATFORM%"=="android" goto android-config
4 | if "%PLATFORM%"=="ios" goto ios-config
5 | if "%PLATFORM%"=="ios-dist" goto ios-dist-config
6 | goto start
7 |
8 |
9 | :android-config
10 | set CERT_FILE=%AND_CERT_FILE%
11 | set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS%
12 | set ICONS=%AND_ICONS%
13 | set DIST_EXT=apk
14 | set TYPE=apk
15 | goto start
16 |
17 | :ios-config
18 | set CERT_FILE=%IOS_DEV_CERT_FILE%
19 | set SIGNING_OPTIONS=%IOS_DEV_SIGNING_OPTIONS%
20 | set ICONS=%IOS_ICONS%
21 | set DIST_EXT=ipa
22 | set TYPE=ipa
23 | goto start
24 |
25 | :ios-dist-config
26 | set CERT_FILE=%IOS_DIST_CERT_FILE%
27 | set SIGNING_OPTIONS=%IOS_DIST_SIGNING_OPTIONS%
28 | set ICONS=%IOS_ICONS%
29 | set DIST_EXT=ipa
30 | set TYPE=ipa
31 | goto start
32 |
33 |
34 | :start
35 | if not exist "%CERT_FILE%" goto certificate
36 | :: Output file
37 | set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" .
38 | if not exist "%DIST_PATH%" md "%DIST_PATH%"
39 | set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT%
40 | :: Package
41 | echo Packaging: %OUTPUT%
42 | echo using certificate: %CERT_FILE%...
43 | echo.
44 | call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR% -extdir extension/release/
45 | echo.
46 | if errorlevel 1 goto failed
47 | goto end
48 |
49 | :certificate
50 | echo Certificate not found: %CERT_FILE%
51 | echo.
52 | echo Android:
53 | echo - generate a default certificate using 'bat\CreateCertificate.bat'
54 | echo or configure a specific certificate in 'bat\SetupApplication.bat'.
55 | echo.
56 | echo iOS:
57 | echo - configure your developer key and project's Provisioning Profile
58 | echo in 'bat\SetupApplication.bat'.
59 | echo.
60 | if %PAUSE_ERRORS%==1 pause
61 | exit
62 |
63 | :failed
64 | echo APK setup creation FAILED.
65 | echo.
66 | echo Troubleshooting:
67 | echo - did you build your project in FlashDevelop?
68 | echo - verify AIR SDK target version in %APP_XML%
69 | echo.
70 | if %PAUSE_ERRORS%==1 pause
71 | exit
72 |
73 | :end
74 |
--------------------------------------------------------------------------------
/example/bat/SetupApplication.bat:
--------------------------------------------------------------------------------
1 | :user_configuration
2 |
3 | :: About AIR application packaging
4 | :: http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_5.html#1035959
5 | :: http://livedocs.adobe.com/flex/3/html/distributing_apps_4.html#1037515
6 |
7 | :: NOTICE: all paths are relative to project root
8 |
9 | :: Android packaging
10 | set AND_CERT_NAME="BitmapDataQRCodeScanner"
11 | set AND_CERT_PASS=luar
12 | set AND_CERT_FILE=cert\BitmapDataQRCodeScanner_play.p12
13 | set AND_ICONS=icons/android
14 |
15 | set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass %AND_CERT_PASS%
16 |
17 | :: iOS packaging
18 | set IOS_DIST_CERT_FILE=
19 | set IOS_DEV_CERT_FILE=
20 | set IOS_DEV_CERT_PASS=
21 | set IOS_PROVISION=
22 | set IOS_ICONS=icons/ios
23 |
24 | set IOS_DEV_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DEV_CERT_FILE%" -storepass %IOS_DEV_CERT_PASS% -provisioning-profile %IOS_PROVISION%
25 | set IOS_DIST_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DIST_CERT_FILE%" -provisioning-profile %IOS_PROVISION%
26 |
27 | :: Application descriptor
28 | set APP_XML=application.xml
29 |
30 | :: Files to package
31 | set APP_DIR=bin
32 | set FILE_OR_DIR=-C %APP_DIR% .
33 |
34 | :: Your application ID (must match of Application descriptor)
35 | set APP_ID=air.BitmapDataQRCodeScanner
36 |
37 | :: Output packages
38 | set DIST_PATH=dist
39 | set DIST_NAME=BitmapDataQRCodeScanner
40 |
41 | :: Debugging using a custom IP
42 | set DEBUG_IP=
43 |
44 |
45 |
46 | :validation
47 | %SystemRoot%\System32\find /C "%APP_ID%" "%APP_XML%" > NUL
48 | if errorlevel 1 goto badid
49 | goto end
50 |
51 | :badid
52 | echo.
53 | echo ERROR:
54 | echo Application ID in 'bat\SetupApplication.bat' (APP_ID)
55 | echo does NOT match Application descriptor '%APP_XML%' (id)
56 | echo.
57 |
58 | :end
--------------------------------------------------------------------------------
/example/bat/SetupSDK.bat:
--------------------------------------------------------------------------------
1 | :user_configuration
2 |
3 | :: Path to Flex SDK
4 | set FLEX_SDK=C:\Users\luar\AppData\Local\FlashDevelop\Apps\flexairsdk\4.6.0+18.0.0
5 | set AUTO_INSTALL_IOS=yes
6 |
7 | :: Path to Android SDK
8 | set ANDROID_SDK=C:\Program Files (x86)\FlashDevelop\Tools\android
9 |
10 |
11 | :validation
12 | if not exist "%FLEX_SDK%\bin" goto flexsdk
13 | if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk
14 | goto succeed
15 |
16 | :flexsdk
17 | echo.
18 | echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
19 | echo.
20 | echo Looking for: %FLEX_SDK%\bin
21 | echo.
22 | if %PAUSE_ERRORS%==1 pause
23 | exit
24 |
25 | :androidsdk
26 | echo.
27 | echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat'
28 | echo.
29 | echo Looking for: %ANDROID_SDK%\platform-tools
30 | echo.
31 | if %PAUSE_ERRORS%==1 pause
32 | exit
33 |
34 | :succeed
35 | set PATH=%PATH%;%FLEX_SDK%\bin
36 | set PATH=%PATH%;%ANDROID_SDK%\platform-tools
37 |
38 |
--------------------------------------------------------------------------------
/example/bin/BitmapDataQRCodeScanner.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/bin/BitmapDataQRCodeScanner.swf
--------------------------------------------------------------------------------
/example/cert/BitmapDataQRCodeScanner_play.p12:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/cert/BitmapDataQRCodeScanner_play.p12
--------------------------------------------------------------------------------
/example/dist/BitmapDataQRCodeScanner.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/dist/BitmapDataQRCodeScanner.apk
--------------------------------------------------------------------------------
/example/extension/release/com.kcly.ane.bitmapdataqrcodescanner.ane:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/extension/release/com.kcly.ane.bitmapdataqrcodescanner.ane
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_114.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_120.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_144.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_152.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_48.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_57.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_72.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_76.png
--------------------------------------------------------------------------------
/example/icons/android/icons/icon_96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/android/icons/icon_96.png
--------------------------------------------------------------------------------
/example/icons/ios/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/Default-568h@2x.png
--------------------------------------------------------------------------------
/example/icons/ios/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/Default-Landscape.png
--------------------------------------------------------------------------------
/example/icons/ios/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/Default-Portrait.png
--------------------------------------------------------------------------------
/example/icons/ios/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/Default.png
--------------------------------------------------------------------------------
/example/icons/ios/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/Default@2x.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_114.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_120.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_144.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_152.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_48.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_512.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_57.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_72.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_76.png
--------------------------------------------------------------------------------
/example/icons/ios/icons/icon_96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/icons/ios/icons/icon_96.png
--------------------------------------------------------------------------------
/example/lib/com.kcly.ane.bitmapdataqrcodescanner.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/example/lib/com.kcly.ane.bitmapdataqrcodescanner.swc
--------------------------------------------------------------------------------
/example/obj/BitmapDataQRCodeScannerConfig.old:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 12.0
6 | false
7 | true
8 |
9 |
10 | CONFIG::debug
11 | false
12 |
13 |
14 | CONFIG::release
15 | true
16 |
17 |
18 | CONFIG::timeStamp
19 | '23/6/2014'
20 |
21 |
22 | CONFIG::air
23 | true
24 |
25 |
26 | CONFIG::mobile
27 | true
28 |
29 |
30 | CONFIG::desktop
31 | false
32 |
33 | true
34 | true
35 | false
36 |
37 | E:\Projects\BitmapDataQRCodeScanner\example\src
38 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes
39 |
40 |
41 | E:\Projects\BitmapDataQRCodeScanner\example\lib\com.kcly.ane.bitmapdataqrcodescanner.swc
42 |
43 |
44 |
45 | E:\Projects\BitmapDataQRCodeScanner\example\src\Demo.as
46 |
47 | #FFFFFF
48 | 30
49 |
50 | 480
51 | 762
52 |
53 |
--------------------------------------------------------------------------------
/example/obj/BitmapDataQRCodeScannerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 12.0
6 | false
7 | true
8 |
9 |
10 | CONFIG::debug
11 | false
12 |
13 |
14 | CONFIG::release
15 | true
16 |
17 |
18 | CONFIG::timeStamp
19 | '23/6/2014'
20 |
21 |
22 | CONFIG::air
23 | true
24 |
25 |
26 | CONFIG::mobile
27 | true
28 |
29 |
30 | CONFIG::desktop
31 | false
32 |
33 | true
34 | true
35 | false
36 |
37 | E:\Projects\BitmapDataQRCodeScanner\example\src
38 | C:\Program Files (x86)\FlashDevelop\Library\AS3\classes
39 |
40 |
41 | E:\Projects\BitmapDataQRCodeScanner\example\lib\com.kcly.ane.bitmapdataqrcodescanner.swc
42 |
43 |
44 |
45 | E:\Projects\BitmapDataQRCodeScanner\example\src\Demo.as
46 |
47 | #FFFFFF
48 | 30
49 |
50 | 480
51 | 762
52 |
53 |
--------------------------------------------------------------------------------
/example/src/Demo.as:
--------------------------------------------------------------------------------
1 | package {
2 | import com.kcly.ane.bitmapdataqrcodescanner.Scanner;
3 | import com.kcly.ane.bitmapdataqrcodescanner.ScannerEvent;
4 | import flash.display.BitmapData;
5 | import flash.display.Sprite;
6 | import flash.display.StageAlign;
7 | import flash.display.StageScaleMode;
8 | import flash.events.Event;
9 | import flash.media.Camera;
10 | import flash.media.Video;
11 | import flash.text.TextField;
12 | import flash.text.TextFieldAutoSize;
13 | import flash.text.TextFormat;
14 | import flash.ui.Multitouch;
15 | import flash.ui.MultitouchInputMode;
16 | import flash.utils.setInterval;
17 |
18 | public class Demo extends Sprite {
19 | private var scanner:Scanner;
20 | private var tf:TextField;
21 | private var bmpData:BitmapData;
22 | private var video:Video;
23 | private var sp:Sprite;
24 |
25 | public function Demo():void {
26 | stage.scaleMode = StageScaleMode.NO_SCALE;
27 | stage.align = StageAlign.TOP_LEFT;
28 | stage.addEventListener(Event.DEACTIVATE, deactivate);
29 |
30 | Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
31 |
32 | init();
33 | }
34 |
35 | private function init():void {
36 | scanner = new Scanner
37 | scanner.addEventListener(ScannerEvent.SCAN, onScanFound)
38 |
39 | var cam:Camera = Camera.getCamera();
40 | cam.setMode(480,480,15);
41 |
42 | sp = new Sprite
43 | addChild(sp)
44 |
45 | var stageW:int = stage.fullScreenWidth
46 | var vidH:int = stageW/(cam.width/cam.height)
47 | video = new Video(vidH, stageW);
48 | video.y = -stageW / 2;
49 | video.x = -vidH / 2;
50 | video.attachCamera(cam);
51 | sp.x = stageW / 2;
52 | sp.y = vidH / 2;
53 | sp.rotation = 90;
54 | sp.addChild(video);
55 |
56 | bmpData = new BitmapData(sp.width, sp.height, false, 0);
57 |
58 | tf = new TextField;
59 | tf.multiline = tf.wordWrap = true;
60 | tf.y = sp.height;
61 | addChild(tf)
62 |
63 | var tfmt:TextFormat = new TextFormat
64 | tfmt.font = "Arial"
65 | tfmt.size = 48;
66 | tf.defaultTextFormat = tfmt;
67 |
68 | tf.text = "Scanning...";
69 | tf.width = stageW;
70 | tf.autoSize = TextFieldAutoSize.LEFT;
71 |
72 | setInterval(doScan, 1000)
73 |
74 | trace ('inited')
75 | }
76 |
77 | private function doScan():void {
78 | bmpData.draw(video);
79 | trace ('doScan', bmpData.width, bmpData.height)
80 | scanner.scan(bmpData);
81 | }
82 |
83 | private function onScanFound(evt:ScannerEvent):void {
84 | trace ('onScanFound', evt.data)
85 | tf.text = evt.data;
86 | tf.autoSize = TextFieldAutoSize.LEFT;
87 | }
88 |
89 | private function deactivate(e:Event):void {
90 | //NativeApplication.nativeApplication.exit();
91 | }
92 | }
93 | }
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner.xcodeproj/project.xcworkspace/xcuserdata/luar.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ios/BitmapDataQRCodeScanner.xcodeproj/project.xcworkspace/xcuserdata/luar.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner.xcodeproj/project.xcworkspace/xcuserdata/luar.xcuserdatad/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges
6 |
7 | SnapshotAutomaticallyBeforeSignificantChanges
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner.xcodeproj/xcuserdata/luar.xcuserdatad/xcschemes/BitmapDataQRCodeScanner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
60 |
61 |
63 |
64 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner.xcodeproj/xcuserdata/luar.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | BitmapDataQRCodeScanner.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | BFD1268014EBB7D700042533
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/BitmapDataQRCodeScanner-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header for all source files of the 'QRZBar' target in the 'QRZBar' project
3 | //
4 |
5 | #ifdef __OBJC__
6 | #import
7 | #endif
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/BitmapDataQRCodeScanner.m:
--------------------------------------------------------------------------------
1 | #import "FlashRuntimeExtensions.h"
2 | #import
3 | #import
4 | #import "zbar.h"
5 | #import "ZBarReaderController.h"
6 |
7 | FREObject scan(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {
8 | ZBarReaderController *reader = nil;
9 | FREGetContextNativeData(ctx, (void**)&reader);
10 | FREObject retVal = NULL;
11 |
12 | FREObject objectBitmapData = argv[0];
13 | FREBitmapData2 bitmapData;
14 |
15 | FREAcquireBitmapData2(objectBitmapData, &bitmapData);
16 |
17 | int width = bitmapData.width;
18 | int height = bitmapData.height;
19 |
20 | CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, bitmapData.bits32, (width * height * 4), NULL);
21 |
22 | int bitsPerComponent = 8;
23 | int bitsPerPixel = 32;
24 | int bytesPerRow = 4 * width;
25 | CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
26 | CGBitmapInfo bitmapInfo;
27 |
28 | if( bitmapData.hasAlpha) {
29 | if(bitmapData.isPremultiplied)
30 | bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst;
31 | else
32 | bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaFirst;
33 | } else {
34 | bitmapInfo = kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst;
35 | }
36 |
37 | CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
38 | CGImageRef imageRef = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
39 |
40 | id results = [reader scanImage:imageRef];
41 |
42 | ZBarSymbol *sym = nil;
43 | for(sym in results) {
44 | if (sym) {
45 | NSLog(@"Found barcode! quality: %d string: %@", sym.quality, sym.data);
46 | FREDispatchStatusEventAsync(ctx, (uint8_t*)[@"data" UTF8String], (uint8_t*)[sym.data UTF8String]);
47 | break;
48 | }
49 | }
50 |
51 | CGColorSpaceRelease(colorSpaceRef);
52 | CGImageRelease(imageRef);
53 | CGDataProviderRelease(provider);
54 | FREReleaseBitmapData(objectBitmapData);
55 |
56 | FRENewObjectFromBool((uint32_t)YES, &retVal);
57 | return retVal;
58 | }
59 |
60 | FREObject stop(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {
61 | ZBarReaderController *reader = nil;
62 | FREGetContextNativeData(ctx, (void**)&reader);
63 | FREObject retVal = NULL;
64 |
65 | [reader release];
66 | reader = nil;
67 | FRENewObjectFromBool((uint32_t)YES, &retVal);
68 |
69 | return retVal;
70 | }
71 |
72 | void ScannerContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx,
73 | uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet) {
74 |
75 | ZBarReaderController *reader = [ZBarReaderController new];
76 | reader.sourceType = UIImagePickerControllerSourceTypeCamera;
77 | [reader.scanner setSymbology: 0
78 | config: ZBAR_CFG_ENABLE
79 | to: 0];
80 | [reader.scanner setSymbology: ZBAR_QRCODE
81 | config: ZBAR_CFG_ENABLE
82 | to: 1];
83 |
84 | FRESetContextNativeData(ctx, reader);
85 |
86 | *numFunctionsToTest = 2;
87 |
88 | FRENamedFunction* func = (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * 2);
89 |
90 | func[0].name = (const uint8_t*) "scan";
91 | func[0].functionData = NULL;
92 | func[0].function = &scan;
93 |
94 | func[1].name = (const uint8_t*) "stop";
95 | func[1].functionData = NULL;
96 | func[1].function = &stop;
97 |
98 | *functionsToSet = func;
99 | }
100 |
101 | void ScannerContextFinalizer(FREContext ctx) {
102 | return;
103 | }
104 |
105 | void ScannerExtInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet,
106 | FREContextFinalizer* ctxFinalizerToSet) {
107 | *extDataToSet = NULL;
108 | *ctxInitializerToSet = &ScannerContextInitializer;
109 | *ctxFinalizerToSet = &ScannerContextFinalizer;
110 | }
111 |
112 | void ScannerExtFinalizer(void* extData) {
113 | return;
114 | }
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarCameraSimulator.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2010-2011 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | @class ZBarReaderView;
25 |
26 | // hack around missing simulator support for AVCapture interfaces
27 |
28 | @interface ZBarCameraSimulator
29 | : NSObject
30 | < UINavigationControllerDelegate,
31 | UIImagePickerControllerDelegate,
32 | UIPopoverControllerDelegate >
33 | {
34 | UIViewController *viewController;
35 | ZBarReaderView *readerView;
36 | UIImagePickerController *picker;
37 | UIPopoverController *pickerPopover;
38 | }
39 |
40 | - (id) initWithViewController: (UIViewController*) viewController;
41 | - (void) takePicture;
42 |
43 | @property (nonatomic, assign) ZBarReaderView *readerView;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarCaptureReader.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "ZBarImageScanner.h"
26 |
27 | @class AVCaptureVideoDataOutput, AVCaptureOutput;
28 | @class ZBarCaptureReader, ZBarCVImage;
29 |
30 | @protocol ZBarCaptureDelegate
31 |
32 | // called when a new barcode is detected. the image refers to the
33 | // video buffer and must not be retained for long
34 | - (void) captureReader: (ZBarCaptureReader*) captureReader
35 | didReadNewSymbolsFromImage: (ZBarImage*) image;
36 |
37 | @optional
38 | // called when a potential/uncertain barcode is detected. will also
39 | // be called *after* captureReader:didReadNewSymbolsFromImage:
40 | // when good barcodes are detected
41 | - (void) captureReader: (ZBarCaptureReader*) captureReader
42 | didTrackSymbols: (ZBarSymbolSet*) symbols;
43 |
44 | @end
45 |
46 | @interface ZBarCaptureReader
47 | : NSObject
48 | {
49 | #if !TARGET_IPHONE_SIMULATOR
50 | AVCaptureVideoDataOutput *captureOutput;
51 | id captureDelegate;
52 | ZBarImageScanner *scanner;
53 | CGRect scanCrop;
54 | CGSize size;
55 | CGFloat framesPerSecond;
56 | BOOL enableCache;
57 |
58 | dispatch_queue_t queue;
59 | ZBarImage *image;
60 | ZBarCVImage *result;
61 | volatile uint32_t state;
62 | int framecnt;
63 | unsigned width, height;
64 | uint64_t t_frame, t_fps, t_scan;
65 | CGFloat dt_frame;
66 | #endif
67 | }
68 |
69 | // supply a pre-configured image scanner
70 | - (id) initWithImageScanner: (ZBarImageScanner*) imageScanner;
71 |
72 | // this must be called before the session is started
73 | - (void) willStartRunning;
74 |
75 | // this must be called *before* the session is stopped
76 | - (void) willStopRunning;
77 |
78 | // clear the internal result cache
79 | - (void) flushCache;
80 |
81 | // capture the next frame after processing. the captured image will
82 | // follow the same delegate path as an image with decoded symbols.
83 | - (void) captureFrame;
84 |
85 | // the capture output. add this to an instance of AVCaptureSession
86 | @property (nonatomic, readonly) AVCaptureOutput *captureOutput;
87 |
88 | // delegate is notified of decode results and symbol tracking.
89 | @property (nonatomic, assign) id captureDelegate;
90 |
91 | // access to image scanner for configuration.
92 | @property (nonatomic, readonly) ZBarImageScanner *scanner;
93 |
94 | // region of image to scan in normalized coordinates.
95 | // NB horizontal crop currently ignored...
96 | @property (nonatomic, assign) CGRect scanCrop;
97 |
98 | // size of video frames.
99 | @property (nonatomic, readonly) CGSize size;
100 |
101 | // (quickly) gate the reader function without interrupting the video
102 | // stream. also flushes the cache when enabled. defaults to *NO*
103 | @property (nonatomic) BOOL enableReader;
104 |
105 | // current frame rate (for debug/optimization).
106 | // only valid when running
107 | @property (nonatomic, readonly) CGFloat framesPerSecond;
108 |
109 | @property (nonatomic) BOOL enableCache;
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarHelpController.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2009-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 |
26 | @class ZBarHelpController;
27 |
28 | @protocol ZBarHelpDelegate
29 | @optional
30 |
31 | - (void) helpControllerDidFinish: (ZBarHelpController*) help;
32 |
33 | @end
34 |
35 |
36 | // failure dialog w/a few useful tips
37 |
38 | @interface ZBarHelpController : UIViewController
39 | < UIWebViewDelegate,
40 | UIAlertViewDelegate >
41 | {
42 | NSString *reason;
43 | id delegate;
44 | UIWebView *webView;
45 | UIToolbar *toolbar;
46 | UIBarButtonItem *doneBtn, *backBtn, *space;
47 | NSURL *linkURL;
48 | NSUInteger orientations;
49 | }
50 |
51 | @property (nonatomic, assign) id delegate;
52 |
53 | // designated initializer
54 | - (id) initWithReason: (NSString*) reason;
55 |
56 | - (BOOL) isInterfaceOrientationSupported: (UIInterfaceOrientation) orientation;
57 | - (void) setInterfaceOrientation: (UIInterfaceOrientation) orientation
58 | supported: (BOOL) supported;
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarImage.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "zbar.h"
26 | #import "ZBarSymbol.h"
27 |
28 | #ifdef __cplusplus
29 | using namespace zbar;
30 | #endif
31 |
32 | // Obj-C wrapper for ZBar image
33 |
34 | @interface ZBarImage : NSObject
35 | {
36 | zbar_image_t *zimg;
37 | double t_convert;
38 | }
39 |
40 | @property (nonatomic) unsigned long format;
41 | @property (nonatomic) unsigned sequence;
42 | @property (nonatomic) CGSize size;
43 | @property (nonatomic) CGRect crop;
44 | @property (readonly, nonatomic) const void *data;
45 | @property (readonly, nonatomic) unsigned long dataLength;
46 | @property (copy, nonatomic) ZBarSymbolSet *symbols;
47 | @property (readonly, nonatomic) zbar_image_t *zbarImage;
48 | @property (readonly, nonatomic) UIImage *UIImage;
49 |
50 | - (id) initWithImage: (zbar_image_t*) image;
51 | - (id) initWithCGImage: (CGImageRef) image;
52 | - (id) initWithCGImage: (CGImageRef) image
53 | size: (CGSize) size;
54 | - (id) initWithCGImage: (CGImageRef) image
55 | crop: (CGRect) crop
56 | size: (CGSize) size;
57 |
58 | - (void) setData: (const void*) data
59 | withLength: (unsigned long) length;
60 | - (UIImage*) UIImageWithOrientation: (UIImageOrientation) imageOrientation;
61 | - (void) cleanup;
62 |
63 | + (unsigned long) fourcc: (NSString*) format;
64 |
65 | #if 0
66 | - convertToFormat: (unsigned long) format;
67 | #endif
68 |
69 | @end
70 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarImageScanner.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "zbar.h"
26 | #import "ZBarImage.h"
27 |
28 | #ifdef __cplusplus
29 | using namespace zbar;
30 | #endif
31 |
32 | // Obj-C wrapper for ZBar image scanner
33 |
34 | @interface ZBarImageScanner : NSObject
35 | {
36 | zbar_image_scanner_t *scanner;
37 | }
38 |
39 | @property (nonatomic) BOOL enableCache;
40 | @property (readonly, nonatomic) ZBarSymbolSet *results;
41 |
42 | // decoder configuration
43 | - (void) parseConfig: (NSString*) configStr;
44 | - (void) setSymbology: (zbar_symbol_type_t) symbology
45 | config: (zbar_config_t) config
46 | to: (int) value;
47 |
48 | // image scanning interface
49 | - (NSInteger) scanImage: (ZBarImage*) image;
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarReaderController.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2009-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "ZBarImageScanner.h"
26 |
27 | #ifdef __cplusplus
28 | using namespace zbar;
29 | #endif
30 |
31 | typedef enum {
32 | // default interface provided by UIImagePickerController - user manually
33 | // captures an image by pressing a button
34 | ZBarReaderControllerCameraModeDefault = 0,
35 |
36 | // automatically scan by taking screenshots with UIGetScreenImage().
37 | // resolution is limited by the screen, so this is inappropriate for
38 | // longer codes
39 | ZBarReaderControllerCameraModeSampling,
40 |
41 | // automatically scan by rapidly taking pictures with takePicture.
42 | // tradeoff resolution with frame rate by adjusting the crop, and size
43 | // properties of the reader along with the density configs of the image
44 | // scanner
45 | ZBarReaderControllerCameraModeSequence,
46 |
47 | } ZBarReaderControllerCameraMode;
48 |
49 |
50 | @class ZBarReaderController, ZBarHelpController;
51 |
52 | @protocol ZBarReaderDelegate
53 | @optional
54 |
55 | // called when no barcode is found in an image selected by the user.
56 | // if retry is NO, the delegate *must* dismiss the controller
57 | - (void) readerControllerDidFailToRead: (ZBarReaderController*) reader
58 | withRetry: (BOOL) retry;
59 |
60 | @end
61 |
62 |
63 | @interface ZBarReaderController
64 | : UIImagePickerController
65 | < UINavigationControllerDelegate,
66 | UIImagePickerControllerDelegate >
67 | {
68 | ZBarImageScanner *scanner;
69 | ZBarHelpController *help;
70 | UIView *overlay, *boxView;
71 | CALayer *boxLayer;
72 |
73 | UIToolbar *toolbar;
74 | UIBarButtonItem *cancelBtn, *scanBtn, *space[3];
75 | UIButton *infoBtn;
76 |
77 | id readerDelegate;
78 | BOOL showsZBarControls, showsHelpOnFail, takesPicture, enableCache;
79 | ZBarReaderControllerCameraMode cameraMode;
80 | CGRect scanCrop;
81 | NSInteger maxScanDimension;
82 |
83 | BOOL hasOverlay, sampling;
84 | uint64_t t_frame;
85 | double dt_frame;
86 |
87 | ZBarSymbol *symbol;
88 | }
89 |
90 | // access to configure image scanner
91 | @property (readonly, nonatomic) ZBarImageScanner *scanner;
92 |
93 | // barcode result recipient (NB don't use delegate)
94 | @property (nonatomic, assign) id readerDelegate;
95 |
96 | // whether to use alternate control set
97 | @property (nonatomic) BOOL showsZBarControls;
98 |
99 | // whether to display helpful information when decoding fails
100 | @property (nonatomic) BOOL showsHelpOnFail;
101 |
102 | // how to use the camera (when sourceType == Camera)
103 | @property (nonatomic) ZBarReaderControllerCameraMode cameraMode;
104 |
105 | // whether to outline symbols with the green tracking box.
106 | @property (nonatomic) BOOL tracksSymbols;
107 |
108 | // whether to automatically take a full picture when a barcode is detected
109 | // (when cameraMode == Sampling)
110 | @property (nonatomic) BOOL takesPicture;
111 |
112 | // whether to use the "cache" for realtime modes (default YES). this can be
113 | // used to safely disable the inter-frame consistency and duplicate checks,
114 | // speeding up recognition, iff:
115 | // 1. the controller is dismissed when a barcode is read and
116 | // 2. unreliable symbologies are disabled (all EAN/UPC variants and I2/5)
117 | @property (nonatomic) BOOL enableCache;
118 |
119 | // crop images for scanning. the original image will be cropped to this
120 | // rectangle before scanning. the rectangle is normalized to the image size
121 | // and aspect ratio; useful values will place the rectangle between 0 and 1
122 | // on each axis, where the x-axis corresponds to the image major axis.
123 | // defaults to the full image (0, 0, 1, 1).
124 | @property (nonatomic) CGRect scanCrop;
125 |
126 | // scale image to scan. after cropping, the image will be scaled if
127 | // necessary, such that neither of its dimensions exceed this value.
128 | // defaults to 640.
129 | @property (nonatomic) NSInteger maxScanDimension;
130 |
131 | // display the built-in help browser. for use with custom overlays if
132 | // you don't also want to create your own help view. only send this
133 | // message when the reader is displayed. the argument will be passed
134 | // to the onZBarHelp() javascript function.
135 | - (void) showHelpWithReason: (NSString*) reason;
136 |
137 | // direct scanner interface - scan UIImage and return something enumerable
138 | - (id ) scanImage: (CGImageRef) image;
139 |
140 | @end
141 |
142 | extern NSString* const ZBarReaderControllerResults;
143 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarReaderView.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "ZBarImageScanner.h"
26 |
27 | @class AVCaptureSession, AVCaptureDevice;
28 | @class CALayer;
29 | @class ZBarImageScanner, ZBarCaptureReader, ZBarReaderView;
30 |
31 | // delegate is notified of decode results.
32 |
33 | @protocol ZBarReaderViewDelegate < NSObject >
34 |
35 | - (void) readerView: (ZBarReaderView*) readerView
36 | didReadSymbols: (ZBarSymbolSet*) symbols
37 | fromImage: (UIImage*) image;
38 |
39 | @optional
40 | - (void) readerViewDidStart: (ZBarReaderView*) readerView;
41 | - (void) readerView: (ZBarReaderView*) readerView
42 | didStopWithError: (NSError*) error;
43 |
44 | @end
45 |
46 | // read barcodes from the displayed video preview. the view maintains
47 | // a complete video capture session feeding a ZBarCaptureReader and
48 | // presents the associated preview with symbol tracking annotations.
49 |
50 | @interface ZBarReaderView
51 | : UIView
52 | {
53 | id readerDelegate;
54 | ZBarCaptureReader *captureReader;
55 | CGRect scanCrop, effectiveCrop;
56 | CGAffineTransform previewTransform;
57 | CGFloat zoom, zoom0, maxZoom;
58 | UIColor *trackingColor;
59 | BOOL tracksSymbols, showsFPS;
60 | NSInteger torchMode;
61 | UIInterfaceOrientation interfaceOrientation;
62 | NSTimeInterval animationDuration;
63 |
64 | CALayer *preview, *overlay, *tracking, *cropLayer;
65 | UIView *fpsView;
66 | UILabel *fpsLabel;
67 | UIPinchGestureRecognizer *pinch;
68 | CGFloat imageScale;
69 | CGSize imageSize;
70 | BOOL started, running, locked;
71 | }
72 |
73 | // supply a pre-configured image scanner.
74 | - (id) initWithImageScanner: (ZBarImageScanner*) imageScanner;
75 |
76 | // start the video stream and barcode reader.
77 | - (void) start;
78 |
79 | // stop the video stream and barcode reader.
80 | - (void) stop;
81 |
82 | // clear the internal result cache
83 | - (void) flushCache;
84 |
85 | // compensate for device/camera/interface orientation
86 | - (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) orient
87 | duration: (NSTimeInterval) duration;
88 |
89 | // delegate is notified of decode results.
90 | @property (nonatomic, assign) id readerDelegate;
91 |
92 | // access to image scanner for configuration.
93 | @property (nonatomic, readonly) ZBarImageScanner *scanner;
94 |
95 | // whether to display the tracking annotation for uncertain barcodes
96 | // (default YES).
97 | @property (nonatomic) BOOL tracksSymbols;
98 |
99 | // color of the tracking box (default green)
100 | @property (nonatomic, retain) UIColor *trackingColor;
101 |
102 | // enable pinch gesture recognition for zooming the preview/decode
103 | // (default YES).
104 | @property (nonatomic) BOOL allowsPinchZoom;
105 |
106 | // torch mode to set automatically (default Auto).
107 | @property (nonatomic) NSInteger torchMode;
108 |
109 | // whether to display the frame rate for debug/configuration
110 | // (default NO).
111 | @property (nonatomic) BOOL showsFPS;
112 |
113 | // zoom scale factor applied to video preview *and* scanCrop.
114 | // also updated by pinch-zoom gesture. clipped to range [1,maxZoom],
115 | // defaults to 1.25
116 | @property (nonatomic) CGFloat zoom;
117 | - (void) setZoom: (CGFloat) zoom
118 | animated: (BOOL) animated;
119 |
120 | // maximum settable zoom factor.
121 | @property (nonatomic) CGFloat maxZoom;
122 |
123 | // the region of the image that will be scanned. normalized coordinates.
124 | @property (nonatomic) CGRect scanCrop;
125 |
126 | // additional transform applied to video preview.
127 | // (NB *not* applied to scan crop)
128 | @property (nonatomic) CGAffineTransform previewTransform;
129 |
130 | // specify an alternate capture device.
131 | @property (nonatomic, retain) AVCaptureDevice *device;
132 |
133 | // direct access to the capture session. warranty void if opened...
134 | @property (nonatomic, readonly) AVCaptureSession *session;
135 | @property (nonatomic, readonly) ZBarCaptureReader *captureReader;
136 |
137 | // this flag still works, but its use is deprecated
138 | @property (nonatomic) BOOL enableCache;
139 |
140 | @end
141 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarReaderViewController.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import "ZBarReaderController.h"
26 |
27 | // orientation set support
28 | #define ZBarOrientationMask(orient) (1 << orient)
29 | #define ZBarOrientationMaskAll \
30 | (ZBarOrientationMask(UIInterfaceOrientationPortrait) | \
31 | ZBarOrientationMask(UIInterfaceOrientationPortraitUpsideDown) | \
32 | ZBarOrientationMask(UIInterfaceOrientationLandscapeLeft) | \
33 | ZBarOrientationMask(UIInterfaceOrientationLandscapeRight))
34 |
35 | @class ZBarReaderView, ZBarCameraSimulator;
36 |
37 | // drop in video scanning replacement for ZBarReaderController.
38 | // this is a thin controller around a ZBarReaderView that adds the UI
39 | // controls and select functionality offered by ZBarReaderController.
40 | // Automatically falls back to a ZBarReaderController if video APIs
41 | // are unavailable (eg for OS < 4.0)
42 |
43 | @interface ZBarReaderViewController
44 | : UIViewController
45 | {
46 | ZBarImageScanner *scanner;
47 | id readerDelegate;
48 | ZBarReaderView *readerView;
49 | UIView *cameraOverlayView;
50 | CGAffineTransform cameraViewTransform;
51 | CGRect scanCrop;
52 | NSUInteger supportedOrientationsMask;
53 | UIImagePickerControllerCameraDevice cameraDevice;
54 | UIImagePickerControllerCameraFlashMode cameraFlashMode;
55 | UIImagePickerControllerQualityType videoQuality;
56 | BOOL showsZBarControls, tracksSymbols, enableCache;
57 |
58 | ZBarHelpController *helpController;
59 | UIView *controls, *shutter;
60 | BOOL didHideStatusBar, rotating;
61 | ZBarCameraSimulator *cameraSim;
62 | }
63 |
64 | // access to configure image scanner
65 | @property (nonatomic, readonly) ZBarImageScanner *scanner;
66 |
67 | // barcode result recipient
68 | @property (nonatomic, assign) id readerDelegate;
69 |
70 | // whether to use alternate control set
71 | @property (nonatomic) BOOL showsZBarControls;
72 |
73 | // whether to show the green tracking box. note that, even when
74 | // enabled, the box will only be visible when scanning EAN and I2/5.
75 | @property (nonatomic) BOOL tracksSymbols;
76 |
77 | // interface orientation support. bit-mask of accepted orientations.
78 | // see eg ZBarOrientationMask() and ZBarOrientationMaskAll
79 | @property (nonatomic) NSUInteger supportedOrientationsMask;
80 |
81 | // crop images for scanning. the image will be cropped to this
82 | // rectangle before scanning. the rectangle is normalized to the
83 | // image size and aspect ratio; useful values will place the rectangle
84 | // between 0 and 1 on each axis, where the x-axis corresponds to the
85 | // image major axis. defaults to the full image (0, 0, 1, 1).
86 | @property (nonatomic) CGRect scanCrop;
87 |
88 | // provide a custom overlay. note that this can be used with
89 | // showsZBarControls enabled (but not if you want backward compatibility)
90 | @property (nonatomic, retain) UIView *cameraOverlayView;
91 |
92 | // transform applied to the preview image.
93 | @property (nonatomic) CGAffineTransform cameraViewTransform;
94 |
95 | // display the built-in help browser. the argument will be passed to
96 | // the onZBarHelp() javascript function.
97 | - (void) showHelpWithReason: (NSString*) reason;
98 |
99 | // capture the next frame and send it over the usual delegate path.
100 | - (void) takePicture;
101 |
102 | // these attempt to emulate UIImagePickerController
103 | + (BOOL) isCameraDeviceAvailable: (UIImagePickerControllerCameraDevice) cameraDevice;
104 | + (BOOL) isFlashAvailableForCameraDevice: (UIImagePickerControllerCameraDevice) cameraDevice;
105 | + (NSArray*) availableCaptureModesForCameraDevice: (UIImagePickerControllerCameraDevice) cameraDevice;
106 | @property(nonatomic) UIImagePickerControllerCameraDevice cameraDevice;
107 | @property(nonatomic) UIImagePickerControllerCameraFlashMode cameraFlashMode;
108 | @property(nonatomic) UIImagePickerControllerCameraCaptureMode cameraCaptureMode;
109 | @property(nonatomic) UIImagePickerControllerQualityType videoQuality;
110 |
111 | // direct access to the ZBarReaderView
112 | @property (nonatomic, readonly) ZBarReaderView *readerView;
113 |
114 | // this flag still works, but its use is deprecated
115 | @property (nonatomic) BOOL enableCache;
116 |
117 | // these are present only for backward compatibility.
118 | // they will error if inappropriate/unsupported values are set
119 | @property (nonatomic) UIImagePickerControllerSourceType sourceType; // Camera
120 | @property (nonatomic) BOOL allowsEditing; // NO
121 | @property (nonatomic) BOOL allowsImageEditing; // NO
122 | @property (nonatomic) BOOL showsCameraControls; // NO
123 | @property (nonatomic) BOOL showsHelpOnFail; // ignored
124 | @property (nonatomic) ZBarReaderControllerCameraMode cameraMode; // Sampling
125 | @property (nonatomic) BOOL takesPicture; // NO
126 | @property (nonatomic) NSInteger maxScanDimension; // ignored
127 |
128 | + (BOOL) isSourceTypeAvailable: (UIImagePickerControllerSourceType) sourceType;
129 |
130 | @end
131 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarSDK.h:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------
2 | * Copyright 2010 (c) Jeff Brown
3 | *
4 | * This file is part of the ZBar Bar Code Reader.
5 | *
6 | * The ZBar Bar Code Reader is free software; you can redistribute it
7 | * and/or modify it under the terms of the GNU Lesser Public License as
8 | * published by the Free Software Foundation; either version 2.1 of
9 | * the License, or (at your option) any later version.
10 | *
11 | * The ZBar Bar Code Reader is distributed in the hope that it will be
12 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU Lesser Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser Public License
17 | * along with the ZBar Bar Code Reader; if not, write to the Free
18 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | * Boston, MA 02110-1301 USA
20 | *
21 | * http://sourceforge.net/projects/zbar
22 | *------------------------------------------------------------------------*/
23 |
24 | #import "zbar.h"
25 |
26 | #import "ZBarSymbol.h"
27 | #import "ZBarImage.h"
28 | #import "ZBarImageScanner.h"
29 | #import "ZBarReaderView.h"
30 | #import "ZBarReaderViewController.h"
31 | #import "ZBarReaderController.h"
32 | #import "ZBarCaptureReader.h"
33 | #import "ZBarHelpController.h"
34 | #import "ZBarCameraSimulator.h"
35 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/ZBarSymbol.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2009-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 |
24 | #import
25 | #import
26 | #import "zbar.h"
27 |
28 | #ifdef __cplusplus
29 | using namespace zbar;
30 | #endif
31 |
32 | // Obj-C wrapper for ZBar result types
33 |
34 | @interface ZBarSymbolSet
35 | : NSObject
36 | {
37 | const zbar_symbol_set_t *set;
38 | BOOL filterSymbols;
39 | }
40 |
41 | @property (readonly, nonatomic) int count;
42 | @property (readonly, nonatomic) const zbar_symbol_set_t *zbarSymbolSet;
43 | @property (nonatomic) BOOL filterSymbols;
44 |
45 | - (id) initWithSymbolSet: (const zbar_symbol_set_t*) set;
46 |
47 | @end
48 |
49 |
50 | @interface ZBarSymbol : NSObject
51 | {
52 | const zbar_symbol_t *symbol;
53 | }
54 |
55 | @property (readonly, nonatomic) zbar_symbol_type_t type;
56 | @property (readonly, nonatomic) NSString *typeName;
57 | @property (readonly, nonatomic) NSUInteger configMask;
58 | @property (readonly, nonatomic) NSUInteger modifierMask;
59 | @property (readonly, nonatomic) NSString *data;
60 | @property (readonly, nonatomic) int quality;
61 | @property (readonly, nonatomic) int count;
62 | @property (readonly, nonatomic) zbar_orientation_t orientation;
63 | @property (readonly, nonatomic) ZBarSymbolSet *components;
64 | @property (readonly, nonatomic) const zbar_symbol_t *zbarSymbol;
65 | @property (readonly, nonatomic) CGRect bounds;
66 |
67 | - (id) initWithSymbol: (const zbar_symbol_t*) symbol;
68 |
69 | + (NSString*) nameForType: (zbar_symbol_type_t) type;
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Decoder.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_DECODER_H_
24 | #define _ZBAR_DECODER_H_
25 |
26 | /// @file
27 | /// Decoder C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Decoder.h"
31 | #endif
32 |
33 | #include
34 |
35 | namespace zbar {
36 |
37 | /// low-level bar width stream decoder interface.
38 | /// identifies symbols and extracts encoded data
39 |
40 | class Decoder {
41 | public:
42 |
43 | /// Decoder result handler.
44 | /// applications should subtype this and pass an instance to
45 | /// set_handler() to implement result processing
46 | class Handler {
47 | public:
48 | virtual ~Handler() { }
49 |
50 | /// invoked by the Decoder as decode results become available.
51 | virtual void decode_callback(Decoder &decoder) = 0;
52 | };
53 |
54 | /// constructor.
55 | Decoder ()
56 | : _handler(NULL)
57 | {
58 | _decoder = zbar_decoder_create();
59 | }
60 |
61 | ~Decoder ()
62 | {
63 | zbar_decoder_destroy(_decoder);
64 | }
65 |
66 | /// clear all decoder state.
67 | /// see zbar_decoder_reset()
68 | void reset ()
69 | {
70 | zbar_decoder_reset(_decoder);
71 | }
72 |
73 | /// mark start of a new scan pass.
74 | /// see zbar_decoder_new_scan()
75 | void new_scan ()
76 | {
77 | zbar_decoder_new_scan(_decoder);
78 | }
79 |
80 | /// process next bar/space width from input stream.
81 | /// see zbar_decode_width()
82 | zbar_symbol_type_t decode_width (unsigned width)
83 | {
84 | return(zbar_decode_width(_decoder, width));
85 | }
86 |
87 | /// process next bar/space width from input stream.
88 | /// see zbar_decode_width()
89 | Decoder& operator<< (unsigned width)
90 | {
91 | zbar_decode_width(_decoder, width);
92 | return(*this);
93 | }
94 |
95 | /// retrieve color of @em next element passed to Decoder.
96 | /// see zbar_decoder_get_color()
97 | zbar_color_t get_color () const
98 | {
99 | return(zbar_decoder_get_color(_decoder));
100 | }
101 |
102 | /// retrieve last decoded symbol type.
103 | /// see zbar_decoder_get_type()
104 | zbar_symbol_type_t get_type () const
105 | {
106 | return(zbar_decoder_get_type(_decoder));
107 | }
108 |
109 | /// retrieve string name of last decoded symbol type.
110 | /// see zbar_get_symbol_name()
111 | const char *get_symbol_name () const
112 | {
113 | return(zbar_get_symbol_name(zbar_decoder_get_type(_decoder)));
114 | }
115 |
116 | /// retrieve string name for last decode addon.
117 | /// see zbar_get_addon_name()
118 | /// @deprecated in 0.11
119 | const char *get_addon_name () const
120 | {
121 | return(zbar_get_addon_name(zbar_decoder_get_type(_decoder)));
122 | }
123 |
124 | /// retrieve last decoded data in ASCII format as a char array.
125 | /// see zbar_decoder_get_data()
126 | const char *get_data_chars() const
127 | {
128 | return(zbar_decoder_get_data(_decoder));
129 | }
130 |
131 | /// retrieve last decoded data as a std::string.
132 | /// see zbar_decoder_get_data()
133 | const std::string get_data_string() const
134 | {
135 | return(std::string(zbar_decoder_get_data(_decoder),
136 | zbar_decoder_get_data_length(_decoder)));
137 | }
138 |
139 | /// retrieve last decoded data as a std::string.
140 | /// see zbar_decoder_get_data()
141 | const std::string get_data() const
142 | {
143 | return(get_data_string());
144 | }
145 |
146 | /// retrieve length of decoded binary data.
147 | /// see zbar_decoder_get_data_length()
148 | int get_data_length() const
149 | {
150 | return(zbar_decoder_get_data_length(_decoder));
151 | }
152 |
153 | /// retrieve last decode direction.
154 | /// see zbar_decoder_get_direction()
155 | /// @since 0.11
156 | int get_direction() const
157 | {
158 | return(zbar_decoder_get_direction(_decoder));
159 | }
160 |
161 | /// setup callback to handle result data.
162 | void set_handler (Handler &handler)
163 | {
164 | _handler = &handler;
165 | zbar_decoder_set_handler(_decoder, _cb);
166 | zbar_decoder_set_userdata(_decoder, this);
167 | }
168 |
169 | /// set config for indicated symbology (0 for all) to specified value.
170 | /// @see zbar_decoder_set_config()
171 | /// @since 0.4
172 | int set_config (zbar_symbol_type_t symbology,
173 | zbar_config_t config,
174 | int value)
175 | {
176 | return(zbar_decoder_set_config(_decoder, symbology, config, value));
177 | }
178 |
179 | /// set config parsed from configuration string.
180 | /// @see zbar_decoder_parse_config()
181 | /// @since 0.4
182 | int set_config (std::string cfgstr)
183 | {
184 | return(zbar_decoder_parse_config(_decoder, cfgstr.c_str()));
185 | }
186 |
187 | private:
188 | friend class Scanner;
189 | zbar_decoder_t *_decoder;
190 | Handler *_handler;
191 |
192 | static void _cb (zbar_decoder_t *cdcode)
193 | {
194 | Decoder *dcode = (Decoder*)zbar_decoder_get_userdata(cdcode);
195 | if(dcode && dcode->_handler)
196 | dcode->_handler->decode_callback(*dcode);
197 | }
198 | };
199 |
200 | }
201 |
202 | #endif
203 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Exception.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_EXCEPTION_H_
24 | #define _ZBAR_EXCEPTION_H_
25 |
26 | /// @file
27 | /// C++ Exception definitions
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Exception.h"
31 | #endif
32 |
33 | #include
34 | #include
35 |
36 | namespace zbar {
37 |
38 | /// base class for exceptions defined by this API.
39 | class Exception : public std::exception {
40 |
41 | public:
42 | /// create exception from C library error
43 | Exception (const void *obj = NULL)
44 | : std::exception(),
45 | _obj(obj)
46 | { }
47 |
48 | ~Exception () throw() { }
49 |
50 | /// retrieve error message
51 | virtual const char* what () const throw()
52 | {
53 | if(!_obj)
54 | return("zbar library unspecified generic error");
55 | return(_zbar_error_string(_obj, 0));
56 | }
57 |
58 | private:
59 | const void *_obj;
60 | };
61 |
62 | /// internal library error.
63 | class InternalError : public Exception {
64 | public:
65 | /// create exception from C library error
66 | InternalError (const void *obj)
67 | : Exception(obj)
68 | { }
69 | };
70 |
71 | /// unsupported request.
72 | class UnsupportedError : public Exception {
73 | public:
74 | /// create exception from C library error
75 | UnsupportedError (const void *obj)
76 | : Exception(obj)
77 | { }
78 | };
79 |
80 | /// invalid request.
81 | class InvalidError : public Exception {
82 | public:
83 | /// create exception from C library error
84 | InvalidError (const void *obj)
85 | : Exception(obj)
86 | { }
87 | };
88 |
89 | /// failed system call.
90 | class SystemError : public Exception {
91 | public:
92 | /// create exception from C library error
93 | SystemError (const void *obj)
94 | : Exception(obj)
95 | { }
96 | };
97 |
98 | /// locking error.
99 | class LockingError : public Exception {
100 | public:
101 | /// create exception from C library error
102 | LockingError (const void *obj)
103 | : Exception(obj)
104 | { }
105 | };
106 |
107 | /// all resources busy.
108 | class BusyError : public Exception {
109 | public:
110 | /// create exception from C library error
111 | BusyError (const void *obj)
112 | : Exception(obj)
113 | { }
114 | };
115 |
116 | /// X11 display error.
117 | class XDisplayError : public Exception {
118 | public:
119 | /// create exception from C library error
120 | XDisplayError (const void *obj)
121 | : Exception(obj)
122 | { }
123 | };
124 |
125 | /// X11 protocol error.
126 | class XProtoError : public Exception {
127 | public:
128 | /// create exception from C library error
129 | XProtoError (const void *obj)
130 | : Exception(obj)
131 | { }
132 | };
133 |
134 | /// output window is closed.
135 | class ClosedError : public Exception {
136 | public:
137 | /// create exception from C library error
138 | ClosedError (const void *obj)
139 | : Exception(obj)
140 | { }
141 | };
142 |
143 | /// image format error
144 | class FormatError : public Exception {
145 | // FIXME needs c equivalent
146 |
147 | virtual const char* what () const throw()
148 | {
149 | // FIXME what format?
150 | return("unsupported format");
151 | }
152 | };
153 |
154 | /// @internal
155 |
156 | /// extract error information and create exception.
157 | static inline std::exception throw_exception (const void *obj)
158 | {
159 | switch(_zbar_get_error_code(obj)) {
160 | case ZBAR_ERR_NOMEM:
161 | throw std::bad_alloc();
162 | case ZBAR_ERR_INTERNAL:
163 | throw InternalError(obj);
164 | case ZBAR_ERR_UNSUPPORTED:
165 | throw UnsupportedError(obj);
166 | case ZBAR_ERR_INVALID:
167 | throw InvalidError(obj);
168 | case ZBAR_ERR_SYSTEM:
169 | throw SystemError(obj);
170 | case ZBAR_ERR_LOCKING:
171 | throw LockingError(obj);
172 | case ZBAR_ERR_BUSY:
173 | throw BusyError(obj);
174 | case ZBAR_ERR_XDISPLAY:
175 | throw XDisplayError(obj);
176 | case ZBAR_ERR_XPROTO:
177 | throw XProtoError(obj);
178 | case ZBAR_ERR_CLOSED:
179 | throw ClosedError(obj);
180 | default:
181 | throw Exception(obj);
182 | }
183 | }
184 |
185 | }
186 |
187 | #endif
188 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Image.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_IMAGE_H_
24 | #define _ZBAR_IMAGE_H_
25 |
26 | /// @file
27 | /// Image C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Image.h"
31 | #endif
32 |
33 | #include
34 | #include
35 | #include "Symbol.h"
36 | #include "Exception.h"
37 |
38 | namespace zbar {
39 |
40 | class Video;
41 |
42 | /// stores image data samples along with associated format and size
43 | /// metadata
44 |
45 | class Image {
46 | public:
47 |
48 | /// general Image result handler.
49 | /// applications should subtype this and pass an instance to
50 | /// eg. ImageScanner::set_handler() to implement result processing
51 | class Handler {
52 | public:
53 | virtual ~Handler() { }
54 |
55 | /// invoked by library when Image should be processed
56 | virtual void image_callback(Image &image) = 0;
57 |
58 | /// cast this handler to the C handler
59 | operator zbar_image_data_handler_t* () const
60 | {
61 | return(_cb);
62 | }
63 |
64 | private:
65 | static void _cb (zbar_image_t *zimg,
66 | const void *userdata)
67 | {
68 | if(userdata) {
69 | Image *image = (Image*)zbar_image_get_userdata(zimg);
70 | if(image)
71 | ((Handler*)userdata)->image_callback(*image);
72 | else {
73 | Image tmp(zimg, 1);
74 | ((Handler*)userdata)->image_callback(tmp);
75 | }
76 | }
77 | }
78 | };
79 |
80 | class SymbolIterator : public zbar::SymbolIterator {
81 | public:
82 | /// default constructor.
83 | SymbolIterator ()
84 | : zbar::SymbolIterator()
85 | { }
86 |
87 | /// constructor.
88 | SymbolIterator (const SymbolSet &syms)
89 | : zbar::SymbolIterator(syms)
90 | { }
91 |
92 | /// copy constructor.
93 | SymbolIterator (const SymbolIterator& iter)
94 | : zbar::SymbolIterator(iter)
95 | { }
96 | };
97 |
98 | /// constructor.
99 | /// create a new Image with the specified parameters
100 | Image (unsigned width = 0,
101 | unsigned height = 0,
102 | const std::string& format = "",
103 | const void *data = NULL,
104 | unsigned long length = 0)
105 | : _img(zbar_image_create())
106 | {
107 | zbar_image_set_userdata(_img, this);
108 | if(width && height)
109 | set_size(width, height);
110 | if(format.length())
111 | set_format(format);
112 | if(data && length)
113 | set_data(data, length);
114 | }
115 |
116 | ~Image ()
117 | {
118 | if(zbar_image_get_userdata(_img) == this)
119 | zbar_image_set_userdata(_img, NULL);
120 | zbar_image_ref(_img, -1);
121 | }
122 |
123 | /// cast to C image object
124 | operator const zbar_image_t* () const
125 | {
126 | return(_img);
127 | }
128 |
129 | /// cast to C image object
130 | operator zbar_image_t* ()
131 | {
132 | return(_img);
133 | }
134 |
135 | /// retrieve the image format.
136 | /// see zbar_image_get_format()
137 | unsigned long get_format () const
138 | {
139 | return(zbar_image_get_format(_img));
140 | }
141 |
142 | /// specify the fourcc image format code for image sample data.
143 | /// see zbar_image_set_format()
144 | void set_format (unsigned long format)
145 | {
146 | zbar_image_set_format(_img, format);
147 | }
148 |
149 | /// specify the fourcc image format code for image sample data.
150 | /// see zbar_image_set_format()
151 | void set_format (const std::string& format)
152 | {
153 | unsigned long fourcc = zbar_fourcc_parse(format.c_str());
154 | zbar_image_set_format(_img, fourcc);
155 | }
156 |
157 | /// retrieve a "sequence" (page/frame) number associated with this
158 | /// image.
159 | /// see zbar_image_get_sequence()
160 | /// @since 0.6
161 | unsigned get_sequence () const
162 | {
163 | return(zbar_image_get_sequence(_img));
164 | }
165 |
166 | /// associate a "sequence" (page/frame) number with this image.
167 | /// see zbar_image_set_sequence()
168 | /// @since 0.6
169 | void set_sequence (unsigned sequence_num)
170 | {
171 | zbar_image_set_sequence(_img, sequence_num);
172 | }
173 |
174 | /// retrieve the width of the image.
175 | /// see zbar_image_get_width()
176 | unsigned get_width () const
177 | {
178 | return(zbar_image_get_width(_img));
179 | }
180 |
181 | /// retrieve the height of the image.
182 | /// see zbar_image_get_height()
183 | unsigned get_height () const
184 | {
185 | return(zbar_image_get_height(_img));
186 | }
187 |
188 | /// retrieve both dimensions of the image.
189 | /// see zbar_image_get_size()
190 | /// @since 0.11
191 | void get_size (unsigned &width,
192 | unsigned &height) const
193 | {
194 | zbar_image_get_size(_img, &width, &height);
195 | }
196 |
197 | /// specify the pixel size of the image.
198 | /// see zbar_image_set_size()
199 | void set_size (unsigned width,
200 | unsigned height)
201 | {
202 | zbar_image_set_size(_img, width, height);
203 | }
204 |
205 | /// retrieve the scan crop rectangle.
206 | /// see zbar_image_get_crop()
207 | void get_crop (unsigned &x,
208 | unsigned &y,
209 | unsigned &width,
210 | unsigned &height) const
211 | {
212 | zbar_image_get_crop(_img, &x, &y, &width, &height);
213 | }
214 |
215 | /// set the scan crop rectangle.
216 | /// see zbar_image_set_crop()
217 | void set_crop (unsigned x,
218 | unsigned y,
219 | unsigned width,
220 | unsigned height)
221 | {
222 | zbar_image_set_crop(_img, x, y, width, height);
223 | }
224 |
225 | /// return the image sample data.
226 | /// see zbar_image_get_data()
227 | const void *get_data () const
228 | {
229 | return(zbar_image_get_data(_img));
230 | }
231 |
232 | /// return the size of the image sample data.
233 | /// see zbar_image_get_data_length()
234 | /// @since 0.6
235 | unsigned long get_data_length () const
236 | {
237 | return(zbar_image_get_data_length(_img));
238 | }
239 |
240 | /// specify image sample data.
241 | /// see zbar_image_set_data()
242 | void set_data (const void *data,
243 | unsigned long length)
244 | {
245 | zbar_image_set_data(_img, data, length, _cleanup);
246 | }
247 |
248 | /// image format conversion.
249 | /// see zbar_image_convert()
250 | Image convert (unsigned long format) const
251 | {
252 | zbar_image_t *img = zbar_image_convert(_img, format);
253 | if(img)
254 | return(Image(img));
255 | throw FormatError();
256 | }
257 |
258 | /// image format conversion.
259 | /// see zbar_image_convert()
260 | /// @since 0.11
261 | Image convert (std::string format) const
262 | {
263 | unsigned long fourcc = zbar_fourcc_parse(format.c_str());
264 | return(convert(fourcc));
265 | }
266 |
267 | /// image format conversion with crop/pad.
268 | /// see zbar_image_convert_resize()
269 | /// @since 0.4
270 | Image convert (unsigned long format,
271 | unsigned width,
272 | unsigned height) const
273 | {
274 | zbar_image_t *img =
275 | zbar_image_convert_resize(_img, format, width, height);
276 | if(img)
277 | return(Image(img));
278 | throw FormatError();
279 | }
280 |
281 | const SymbolSet get_symbols () const {
282 | return(SymbolSet(zbar_image_get_symbols(_img)));
283 | }
284 |
285 | void set_symbols (const SymbolSet &syms) {
286 | zbar_image_set_symbols(_img, syms);
287 | }
288 |
289 | /// create a new SymbolIterator over decoded results.
290 | SymbolIterator symbol_begin () const {
291 | return(SymbolIterator(get_symbols()));
292 | }
293 |
294 | /// return a SymbolIterator suitable for ending iteration.
295 | SymbolIterator symbol_end () const {
296 | return(SymbolIterator());
297 | }
298 |
299 | protected:
300 |
301 | friend class Video;
302 |
303 | /// constructor.
304 | /// @internal
305 | /// create a new Image from a zbar_image_t C object
306 | Image (zbar_image_t *src,
307 | int refs = 0)
308 | : _img(src)
309 | {
310 | if(refs)
311 | zbar_image_ref(_img, refs);
312 | zbar_image_set_userdata(_img, this);
313 | }
314 |
315 | /// default data cleanup (noop)
316 | /// @internal
317 | static void _cleanup (zbar_image_t *img)
318 | {
319 | // by default nothing is cleaned
320 | assert(img);
321 | }
322 |
323 | private:
324 | zbar_image_t *_img;
325 | };
326 |
327 | }
328 |
329 | #endif
330 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/ImageScanner.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_IMAGE_SCANNER_H_
24 | #define _ZBAR_IMAGE_SCANNER_H_
25 |
26 | /// @file
27 | /// Image Scanner C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/ImageScanner.h"
31 | #endif
32 |
33 | #include "Image.h"
34 |
35 | namespace zbar {
36 |
37 | /// mid-level image scanner interface.
38 | /// reads barcodes from a 2-D Image
39 |
40 | class ImageScanner {
41 | public:
42 | /// constructor.
43 | ImageScanner (zbar_image_scanner_t *scanner = NULL)
44 | {
45 | if(scanner)
46 | _scanner = scanner;
47 | else
48 | _scanner = zbar_image_scanner_create();
49 | }
50 |
51 | ~ImageScanner ()
52 | {
53 | zbar_image_scanner_destroy(_scanner);
54 | }
55 |
56 | /// cast to C image_scanner object
57 | operator zbar_image_scanner_t* () const
58 | {
59 | return(_scanner);
60 | }
61 |
62 | /// setup result handler callback.
63 | void set_handler (Image::Handler &handler)
64 | {
65 | zbar_image_scanner_set_data_handler(_scanner, handler, &handler);
66 | }
67 |
68 | /// set config for indicated symbology (0 for all) to specified value.
69 | /// @see zbar_image_scanner_set_config()
70 | /// @since 0.4
71 | int set_config (zbar_symbol_type_t symbology,
72 | zbar_config_t config,
73 | int value)
74 | {
75 | return(zbar_image_scanner_set_config(_scanner, symbology,
76 | config, value));
77 | }
78 |
79 | /// set config parsed from configuration string.
80 | /// @see zbar_image_scanner_parse_config()
81 | /// @since 0.4
82 | int set_config (std::string cfgstr)
83 | {
84 | return(zbar_image_scanner_parse_config(_scanner, cfgstr.c_str()));
85 | }
86 |
87 | /// enable or disable the inter-image result cache.
88 | /// see zbar_image_scanner_enable_cache()
89 | void enable_cache (bool enable = true)
90 | {
91 | zbar_image_scanner_enable_cache(_scanner, enable);
92 | }
93 |
94 | /// remove previous results from scanner and image.
95 | /// @see zbar_image_scanner_recycle_image()
96 | /// @since 0.10
97 | void recycle_image (Image &image)
98 | {
99 | zbar_image_scanner_recycle_image(_scanner, image);
100 | }
101 |
102 | /// retrieve decode results for last scanned image.
103 | /// @see zbar_image_scanner_get_results()
104 | /// @since 0.10
105 | const SymbolSet get_results () const {
106 | return(SymbolSet(zbar_image_scanner_get_results(_scanner)));
107 | }
108 |
109 | /// scan for symbols in provided image.
110 | /// see zbar_scan_image()
111 | int scan (Image& image)
112 | {
113 | return(zbar_scan_image(_scanner, image));
114 | }
115 |
116 | /// scan for symbols in provided image.
117 | /// see zbar_scan_image()
118 | ImageScanner& operator<< (Image& image)
119 | {
120 | scan(image);
121 | return(*this);
122 | }
123 |
124 | private:
125 | zbar_image_scanner_t *_scanner;
126 | };
127 |
128 | }
129 |
130 | #endif
131 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Processor.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_PROCESSOR_H_
24 | #define _ZBAR_PROCESSOR_H_
25 |
26 | /// @file
27 | /// Processor C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Processor.h"
31 | #endif
32 |
33 | #include "Exception.h"
34 | #include "Image.h"
35 |
36 | namespace zbar {
37 |
38 | /// high-level self-contained image processor.
39 | /// processes video and images for barcodes, optionally displaying
40 | /// images to a library owned output window
41 |
42 | class Processor {
43 | public:
44 | /// value to pass for no timeout.
45 | static const int FOREVER = -1;
46 |
47 | /// constructor.
48 | Processor (bool threaded = true,
49 | const char *video_device = "",
50 | bool enable_display = true)
51 | {
52 | _processor = zbar_processor_create(threaded);
53 | if(!_processor)
54 | throw std::bad_alloc();
55 | init(video_device, enable_display);
56 | }
57 |
58 | ~Processor ()
59 | {
60 | zbar_processor_destroy(_processor);
61 | }
62 |
63 | /// cast to C processor object.
64 | operator zbar_processor_t* ()
65 | {
66 | return(_processor);
67 | }
68 |
69 | /// opens a video input device and/or prepares to display output.
70 | /// see zbar_processor_init()
71 | void init (const char *video_device = "",
72 | bool enable_display = true)
73 | {
74 | if(zbar_processor_init(_processor, video_device, enable_display))
75 | throw_exception(_processor);
76 | }
77 |
78 | /// setup result handler callback.
79 | /// see zbar_processor_set_data_handler()
80 | void set_handler (Image::Handler& handler)
81 | {
82 | zbar_processor_set_data_handler(_processor, handler, &handler);
83 | }
84 |
85 | /// set config for indicated symbology (0 for all) to specified value.
86 | /// @see zbar_processor_set_config()
87 | /// @since 0.4
88 | int set_config (zbar_symbol_type_t symbology,
89 | zbar_config_t config,
90 | int value)
91 | {
92 | return(zbar_processor_set_config(_processor, symbology,
93 | config, value));
94 | }
95 |
96 | /// set config parsed from configuration string.
97 | /// @see zbar_processor_parse_config()
98 | /// @since 0.4
99 | int set_config (std::string cfgstr)
100 | {
101 | return(zbar_processor_parse_config(_processor, cfgstr.c_str()));
102 | }
103 |
104 | /// retrieve the current state of the ouput window.
105 | /// see zbar_processor_is_visible()
106 | bool is_visible ()
107 | {
108 | int rc = zbar_processor_is_visible(_processor);
109 | if(rc < 0)
110 | throw_exception(_processor);
111 | return(rc != 0);
112 | }
113 |
114 | /// show or hide the display window owned by the library.
115 | /// see zbar_processor_set_visible()
116 | void set_visible (bool visible = true)
117 | {
118 | if(zbar_processor_set_visible(_processor, visible) < 0)
119 | throw_exception(_processor);
120 | }
121 |
122 | /// control the processor in free running video mode.
123 | /// see zbar_processor_set_active()
124 | void set_active (bool active = true)
125 | {
126 | if(zbar_processor_set_active(_processor, active) < 0)
127 | throw_exception(_processor);
128 | }
129 |
130 | /// retrieve decode results for last scanned image.
131 | /// @see zbar_processor_get_results()
132 | /// @since 0.10
133 | const SymbolSet get_results () const {
134 | return(SymbolSet(zbar_processor_get_results(_processor)));
135 | }
136 |
137 | /// wait for input to the display window from the user.
138 | /// see zbar_processor_user_wait()
139 | int user_wait (int timeout = FOREVER)
140 | {
141 | int rc = zbar_processor_user_wait(_processor, timeout);
142 | if(rc < 0)
143 | throw_exception(_processor);
144 | return(rc);
145 | }
146 |
147 | /// process from the video stream until a result is available.
148 | /// see zbar_process_one()
149 | void process_one (int timeout = FOREVER)
150 | {
151 | if(zbar_process_one(_processor, timeout) < 0)
152 | throw_exception(_processor);
153 | }
154 |
155 | /// process the provided image for barcodes.
156 | /// see zbar_process_image()
157 | void process_image (Image& image)
158 | {
159 | if(zbar_process_image(_processor, image) < 0)
160 | throw_exception(_processor);
161 | }
162 |
163 | /// process the provided image for barcodes.
164 | /// see zbar_process_image()
165 | Processor& operator<< (Image& image)
166 | {
167 | process_image(image);
168 | return(*this);
169 | }
170 |
171 | /// force specific input and output formats for debug/testing.
172 | /// see zbar_processor_force_format()
173 | void force_format (unsigned long input_format,
174 | unsigned long output_format)
175 | {
176 | if(zbar_processor_force_format(_processor, input_format,
177 | output_format))
178 | throw_exception(_processor);
179 | }
180 |
181 | /// force specific input and output formats for debug/testing.
182 | /// see zbar_processor_force_format()
183 | void force_format (std::string& input_format,
184 | std::string& output_format)
185 | {
186 | unsigned long ifourcc = zbar_fourcc_parse(input_format.c_str());
187 | unsigned long ofourcc = zbar_fourcc_parse(output_format.c_str());
188 | if(zbar_processor_force_format(_processor, ifourcc, ofourcc))
189 | throw_exception(_processor);
190 | }
191 |
192 | /// request a preferred size for the video image from the device.
193 | /// see zbar_processor_request_size()
194 | /// @since 0.6
195 | void request_size (int width, int height)
196 | {
197 | zbar_processor_request_size(_processor, width, height);
198 | }
199 |
200 | /// request a preferred driver interface version for debug/testing.
201 | /// see zbar_processor_request_interface()
202 | /// @since 0.6
203 | void request_interface (int version)
204 | {
205 | zbar_processor_request_interface(_processor, version);
206 | }
207 |
208 | /// request a preferred I/O mode for debug/testing.
209 | /// see zbar_processor_request_iomode()
210 | /// @since 0.7
211 | void request_iomode (int iomode)
212 | {
213 | if(zbar_processor_request_iomode(_processor, iomode))
214 | throw_exception(_processor);
215 | }
216 |
217 | private:
218 | zbar_processor_t *_processor;
219 | };
220 |
221 | }
222 |
223 | #endif
224 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Scanner.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_SCANNER_H_
24 | #define _ZBAR_SCANNER_H_
25 |
26 | /// @file
27 | /// Scanner C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Scanner.h"
31 | #endif
32 |
33 | #include
34 |
35 | namespace zbar {
36 |
37 | /// low-level linear intensity sample stream scanner interface.
38 | /// identifies "bar" edges and measures width between them.
39 | /// optionally passes to bar width Decoder
40 |
41 | class Scanner {
42 | public:
43 |
44 | /// constructor.
45 | /// @param decoder reference to a Decoder instance which will
46 | /// be passed scan results automatically
47 | Scanner (Decoder& decoder)
48 | {
49 | _scanner = zbar_scanner_create(decoder._decoder);
50 | }
51 |
52 | /// constructor.
53 | /// @param decoder pointer to a Decoder instance which will
54 | /// be passed scan results automatically
55 | Scanner (Decoder* decoder = NULL)
56 | {
57 | zbar_decoder_t *zdcode = NULL;
58 | if(decoder)
59 | zdcode = decoder->_decoder;
60 | _scanner = zbar_scanner_create(zdcode);
61 | }
62 |
63 | ~Scanner ()
64 | {
65 | zbar_scanner_destroy(_scanner);
66 | }
67 |
68 | /// clear all scanner state.
69 | /// see zbar_scanner_reset()
70 | void reset ()
71 | {
72 | zbar_scanner_reset(_scanner);
73 | }
74 |
75 | /// mark start of a new scan pass.
76 | /// see zbar_scanner_new_scan()
77 | zbar_symbol_type_t new_scan ()
78 | {
79 | _type = zbar_scanner_new_scan(_scanner);
80 | return(_type);
81 | }
82 |
83 | /// flush scanner pipeline.
84 | /// see zbar_scanner_flush()
85 | zbar_symbol_type_t flush ()
86 | {
87 | _type = zbar_scanner_flush(_scanner);
88 | return(_type);
89 | }
90 |
91 | /// process next sample intensity value.
92 | /// see zbar_scan_y()
93 | zbar_symbol_type_t scan_y (int y)
94 | {
95 | _type = zbar_scan_y(_scanner, y);
96 | return(_type);
97 | }
98 |
99 | /// process next sample intensity value.
100 | /// see zbar_scan_y()
101 | Scanner& operator<< (int y)
102 | {
103 | _type = zbar_scan_y(_scanner, y);
104 | return(*this);
105 | }
106 |
107 | /// process next sample from RGB (or BGR) triple.
108 | /// see zbar_scan_rgb24()
109 | zbar_symbol_type_t scan_rgb24 (unsigned char *rgb)
110 | {
111 | _type = zbar_scan_rgb24(_scanner, rgb);
112 | return(_type);
113 | }
114 |
115 | /// process next sample from RGB (or BGR) triple.
116 | /// see zbar_scan_rgb24()
117 | Scanner& operator<< (unsigned char *rgb)
118 | {
119 | _type = zbar_scan_rgb24(_scanner, rgb);
120 | return(*this);
121 | }
122 |
123 | /// retrieve last scanned width.
124 | /// see zbar_scanner_get_width()
125 | unsigned get_width () const
126 | {
127 | return(zbar_scanner_get_width(_scanner));
128 | }
129 |
130 | /// retrieve last scanned color.
131 | /// see zbar_scanner_get_color()
132 | zbar_color_t get_color () const
133 | {
134 | return(zbar_scanner_get_color(_scanner));
135 | }
136 |
137 | /// retrieve last scan result.
138 | zbar_symbol_type_t get_type () const
139 | {
140 | return(_type);
141 | }
142 |
143 | /// cast to C scanner
144 | operator zbar_scanner_t* () const
145 | {
146 | return(_scanner);
147 | }
148 |
149 | /// retrieve C scanner
150 | const zbar_scanner_t *get_c_scanner () const
151 | {
152 | return(_scanner);
153 | }
154 |
155 | private:
156 | zbar_scanner_t *_scanner;
157 | zbar_symbol_type_t _type;
158 | };
159 |
160 | }
161 |
162 | #endif
163 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Symbol.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_SYMBOL_H_
24 | #define _ZBAR_SYMBOL_H_
25 |
26 | /// @file
27 | /// Symbol C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Symbol.h"
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 | #include
37 |
38 | namespace zbar {
39 |
40 | class SymbolIterator;
41 |
42 | /// container for decoded result symbols associated with an image
43 | /// or a composite symbol.
44 |
45 | class SymbolSet {
46 | public:
47 | /// constructor.
48 | SymbolSet (const zbar_symbol_set_t *syms = NULL)
49 | : _syms(syms)
50 | {
51 | ref();
52 | }
53 |
54 | /// copy constructor.
55 | SymbolSet (const SymbolSet& syms)
56 | : _syms(syms._syms)
57 | {
58 | ref();
59 | }
60 |
61 | /// destructor.
62 | ~SymbolSet ()
63 | {
64 | ref(-1);
65 | }
66 |
67 | /// assignment.
68 | SymbolSet& operator= (const SymbolSet& syms)
69 | {
70 | syms.ref();
71 | ref(-1);
72 | _syms = syms._syms;
73 | return(*this);
74 | }
75 |
76 | /// truth testing.
77 | bool operator! () const
78 | {
79 | return(!_syms || !get_size());
80 | }
81 |
82 | /// manipulate reference count.
83 | void ref (int delta = 1) const
84 | {
85 | if(_syms)
86 | zbar_symbol_set_ref((zbar_symbol_set_t*)_syms, delta);
87 | }
88 |
89 | /// cast to C symbol set.
90 | operator const zbar_symbol_set_t* () const
91 | {
92 | return(_syms);
93 | }
94 |
95 | int get_size () const
96 | {
97 | return((_syms) ? zbar_symbol_set_get_size(_syms) : 0);
98 | }
99 |
100 | /// create a new SymbolIterator over decoded results.
101 | SymbolIterator symbol_begin() const;
102 |
103 | /// return a SymbolIterator suitable for ending iteration.
104 | const SymbolIterator symbol_end() const;
105 |
106 | private:
107 | const zbar_symbol_set_t *_syms;
108 | };
109 |
110 | /// decoded barcode symbol result object. stores type, data, and
111 | /// image location of decoded symbol
112 |
113 | class Symbol {
114 | public:
115 |
116 | /// image pixel location (x, y) coordinate tuple.
117 | class Point {
118 | public:
119 | int x; ///< x-coordinate.
120 | int y; ///< y-coordinate.
121 |
122 | Point () { }
123 |
124 | Point(int x, int y)
125 | : x(x), y(y)
126 | { }
127 |
128 | /// copy constructor.
129 | Point (const Point& pt)
130 | : x(pt.x),
131 | y(pt.y)
132 | { }
133 |
134 | /// assignment.
135 | Point& operator= (const Point& pt)
136 | {
137 | x = pt.x;
138 | y = pt.y;
139 | return(*this);
140 | }
141 | };
142 |
143 | /// iteration over Point objects in a symbol location polygon.
144 | class PointIterator
145 | : public std::iterator {
146 |
147 | public:
148 | /// constructor.
149 | PointIterator (const Symbol *sym = NULL,
150 | int index = 0)
151 | : _sym(sym),
152 | _index(index)
153 | {
154 | if(sym)
155 | sym->ref(1);
156 | if(!sym ||
157 | (unsigned)_index >= zbar_symbol_get_loc_size(*_sym))
158 | _index = -1;
159 | }
160 |
161 | /// copy constructor.
162 | PointIterator (const PointIterator& iter)
163 | : _sym(iter._sym),
164 | _index(iter._index)
165 | {
166 | if(_sym)
167 | _sym->ref();
168 | }
169 |
170 | /// destructor.
171 | ~PointIterator ()
172 | {
173 | if(_sym)
174 | _sym->ref(-1);
175 | }
176 |
177 | /// assignment.
178 | PointIterator& operator= (const PointIterator& iter)
179 | {
180 | if(iter._sym)
181 | iter._sym->ref();
182 | if(_sym)
183 | _sym->ref(-1);
184 | _sym = iter._sym;
185 | _index = iter._index;
186 | return(*this);
187 | }
188 |
189 | /// truth testing.
190 | bool operator! () const
191 | {
192 | return(!_sym || _index < 0);
193 | }
194 |
195 | /// advance iterator to next Point.
196 | PointIterator& operator++ ()
197 | {
198 | unsigned int i = ++_index;
199 | if(!_sym || i >= zbar_symbol_get_loc_size(*_sym))
200 | _index = -1;
201 | return(*this);
202 | }
203 |
204 | /// retrieve currently referenced Point.
205 | const Point operator* () const
206 | {
207 | assert(!!*this);
208 | if(!*this)
209 | return(Point());
210 | return(Point(zbar_symbol_get_loc_x(*_sym, _index),
211 | zbar_symbol_get_loc_y(*_sym, _index)));
212 | }
213 |
214 | /// test if two iterators refer to the same Point in the same
215 | /// Symbol.
216 | bool operator== (const PointIterator& iter) const
217 | {
218 | return(_index == iter._index &&
219 | ((_index < 0) || _sym == iter._sym));
220 | }
221 |
222 | /// test if two iterators refer to the same Point in the same
223 | /// Symbol.
224 | bool operator!= (const PointIterator& iter) const
225 | {
226 | return(!(*this == iter));
227 | }
228 |
229 | private:
230 | const Symbol *_sym;
231 | int _index;
232 | };
233 |
234 | /// constructor.
235 | Symbol (const zbar_symbol_t *sym = NULL)
236 | : _xmlbuf(NULL),
237 | _xmllen(0)
238 | {
239 | init(sym);
240 | ref();
241 | }
242 |
243 | /// copy constructor.
244 | Symbol (const Symbol& sym)
245 | : _sym(sym._sym),
246 | _type(sym._type),
247 | _data(sym._data),
248 | _xmlbuf(NULL),
249 | _xmllen(0)
250 | {
251 | ref();
252 | }
253 |
254 | /// destructor.
255 | ~Symbol () {
256 | if(_xmlbuf)
257 | free(_xmlbuf);
258 | ref(-1);
259 | }
260 |
261 | /// assignment.
262 | Symbol& operator= (const Symbol& sym)
263 | {
264 | sym.ref(1);
265 | ref(-1);
266 | _sym = sym._sym;
267 | _type = sym._type;
268 | _data = sym._data;
269 | return(*this);
270 | }
271 |
272 | Symbol& operator= (const zbar_symbol_t *sym)
273 | {
274 | if(sym)
275 | zbar_symbol_ref(sym, 1);
276 | ref(-1);
277 | init(sym);
278 | return(*this);
279 | }
280 |
281 | /// truth testing.
282 | bool operator! () const
283 | {
284 | return(!_sym);
285 | }
286 |
287 | void ref (int delta = 1) const
288 | {
289 | if(_sym)
290 | zbar_symbol_ref((zbar_symbol_t*)_sym, delta);
291 | }
292 |
293 | /// cast to C symbol.
294 | operator const zbar_symbol_t* () const
295 | {
296 | return(_sym);
297 | }
298 |
299 | /// test if two Symbol objects refer to the same C symbol.
300 | bool operator== (const Symbol& sym) const
301 | {
302 | return(_sym == sym._sym);
303 | }
304 |
305 | /// test if two Symbol objects refer to the same C symbol.
306 | bool operator!= (const Symbol& sym) const
307 | {
308 | return(!(*this == sym));
309 | }
310 |
311 | /// retrieve type of decoded symbol.
312 | zbar_symbol_type_t get_type () const
313 | {
314 | return(_type);
315 | }
316 |
317 | /// retrieve the string name of the symbol type.
318 | const std::string get_type_name () const
319 | {
320 | return(zbar_get_symbol_name(_type));
321 | }
322 |
323 | /// retrieve the string name for any addon.
324 | /// @deprecated in 0.11
325 | const std::string get_addon_name () const
326 | {
327 | return(zbar_get_addon_name(_type));
328 | }
329 |
330 | /// retrieve data decoded from symbol.
331 | const std::string get_data () const
332 | {
333 | return(_data);
334 | }
335 |
336 | /// retrieve length of binary data
337 | unsigned get_data_length () const
338 | {
339 | return((_sym) ? zbar_symbol_get_data_length(_sym) : 0);
340 | }
341 |
342 | /// retrieve inter-frame coherency count.
343 | /// see zbar_symbol_get_count()
344 | /// @since 0.5
345 | int get_count () const
346 | {
347 | return((_sym) ? zbar_symbol_get_count(_sym) : -1);
348 | }
349 |
350 | /// retrieve loosely defined relative quality metric.
351 | /// see zbar_symbol_get_quality()
352 | /// @since 0.11
353 | int get_quality () const
354 | {
355 | return((_sym) ? zbar_symbol_get_quality(_sym) : 0);
356 | }
357 |
358 | SymbolSet get_components () const
359 | {
360 | return(SymbolSet((_sym) ? zbar_symbol_get_components(_sym) : NULL));
361 | }
362 |
363 | /// create a new PointIterator at the start of the location
364 | /// polygon.
365 | PointIterator point_begin() const
366 | {
367 | return(PointIterator(this));
368 | }
369 |
370 | /// return a PointIterator suitable for ending iteration.
371 | const PointIterator point_end() const
372 | {
373 | return(PointIterator());
374 | }
375 |
376 | /// see zbar_symbol_get_loc_size().
377 | int get_location_size () const
378 | {
379 | return((_sym) ? zbar_symbol_get_loc_size(_sym) : 0);
380 | }
381 |
382 | /// see zbar_symbol_get_loc_x().
383 | int get_location_x (unsigned index) const
384 | {
385 | return((_sym) ? zbar_symbol_get_loc_x(_sym, index) : -1);
386 | }
387 |
388 | /// see zbar_symbol_get_loc_y().
389 | int get_location_y (unsigned index) const
390 | {
391 | return((_sym) ? zbar_symbol_get_loc_y(_sym, index) : -1);
392 | }
393 |
394 | /// see zbar_symbol_get_orientation().
395 | /// @since 0.11
396 | int get_orientation () const
397 | {
398 | return(zbar_symbol_get_orientation(_sym));
399 | }
400 |
401 | /// see zbar_symbol_xml().
402 | const std::string xml () const
403 | {
404 | if(!_sym)
405 | return("");
406 | return(zbar_symbol_xml(_sym, (char**)&_xmlbuf, (unsigned*)&_xmllen));
407 | }
408 |
409 | protected:
410 | /// (re)initialize Symbol from C symbol object.
411 | void init (const zbar_symbol_t *sym = NULL)
412 | {
413 | _sym = sym;
414 | if(sym) {
415 | _type = zbar_symbol_get_type(sym);
416 | _data = std::string(zbar_symbol_get_data(sym),
417 | zbar_symbol_get_data_length(sym));
418 | }
419 | else {
420 | _type = ZBAR_NONE;
421 | _data = "";
422 | }
423 | }
424 |
425 | private:
426 | const zbar_symbol_t *_sym;
427 | zbar_symbol_type_t _type;
428 | std::string _data;
429 | char *_xmlbuf;
430 | unsigned _xmllen;
431 | };
432 |
433 | /// iteration over Symbol result objects in a scanned Image or SymbolSet.
434 | class SymbolIterator
435 | : public std::iterator {
436 |
437 | public:
438 | /// default constructor.
439 | SymbolIterator ()
440 | { }
441 |
442 | /// constructor.
443 | SymbolIterator (const SymbolSet &syms)
444 | : _syms(syms)
445 | {
446 | const zbar_symbol_set_t *zsyms = _syms;
447 | if(zsyms)
448 | _sym = zbar_symbol_set_first_symbol(zsyms);
449 | }
450 |
451 | /// copy constructor.
452 | SymbolIterator (const SymbolIterator& iter)
453 | : _syms(iter._syms)
454 | {
455 | const zbar_symbol_set_t *zsyms = _syms;
456 | if(zsyms)
457 | _sym = zbar_symbol_set_first_symbol(zsyms);
458 | }
459 |
460 | ~SymbolIterator ()
461 | {
462 | }
463 |
464 | /// assignment.
465 | SymbolIterator& operator= (const SymbolIterator& iter)
466 | {
467 | _syms = iter._syms;
468 | _sym = iter._sym;
469 | return(*this);
470 | }
471 |
472 | bool operator! () const
473 | {
474 | return(!_syms || !_sym);
475 | }
476 |
477 | /// advance iterator to next Symbol.
478 | SymbolIterator& operator++ ()
479 | {
480 | if(!!_sym)
481 | _sym = zbar_symbol_next(_sym);
482 | else if(!!_syms)
483 | _sym = zbar_symbol_set_first_symbol(_syms);
484 | return(*this);
485 | }
486 |
487 | /// retrieve currently referenced Symbol.
488 | const Symbol operator* () const
489 | {
490 | return(_sym);
491 | }
492 |
493 | /// access currently referenced Symbol.
494 | const Symbol* operator-> () const
495 | {
496 | return(&_sym);
497 | }
498 |
499 | /// test if two iterators refer to the same Symbol
500 | bool operator== (const SymbolIterator& iter) const
501 | {
502 | // it is enough to test the symbols, as they belong
503 | // to only one set (also simplifies invalid case)
504 | return(_sym == iter._sym);
505 | }
506 |
507 | /// test if two iterators refer to the same Symbol
508 | bool operator!= (const SymbolIterator& iter) const
509 | {
510 | return(!(*this == iter));
511 | }
512 |
513 | const SymbolIterator end () const {
514 | return(SymbolIterator());
515 | }
516 |
517 | private:
518 | SymbolSet _syms;
519 | Symbol _sym;
520 | };
521 |
522 | inline SymbolIterator SymbolSet::symbol_begin () const {
523 | return(SymbolIterator(*this));
524 | }
525 |
526 | inline const SymbolIterator SymbolSet::symbol_end () const {
527 | return(SymbolIterator());
528 | }
529 |
530 | /// @relates Symbol
531 | /// stream the string representation of a Symbol.
532 | static inline std::ostream& operator<< (std::ostream& out,
533 | const Symbol& sym)
534 | {
535 | out << sym.get_type_name() << ":" << sym.get_data();
536 | return(out);
537 | }
538 |
539 | }
540 |
541 | #endif
542 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Video.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2010 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_VIDEO_H_
24 | #define _ZBAR_VIDEO_H_
25 |
26 | /// @file
27 | /// Video Input C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Video.h"
31 | #endif
32 |
33 | #include "Image.h"
34 |
35 | namespace zbar {
36 |
37 | /// mid-level video source abstraction.
38 | /// captures images from a video device
39 |
40 | class Video {
41 | public:
42 | /// constructor.
43 | Video (zbar_video_t *video = NULL)
44 | {
45 | if(video)
46 | _video = video;
47 | else
48 | _video = zbar_video_create();
49 | }
50 |
51 | /// constructor.
52 | Video (std::string& device)
53 | {
54 | _video = zbar_video_create();
55 | open(device);
56 | }
57 |
58 | ~Video ()
59 | {
60 | zbar_video_destroy(_video);
61 | }
62 |
63 | /// cast to C video object.
64 | operator zbar_video_t* () const
65 | {
66 | return(_video);
67 | }
68 |
69 | /// open and probe a video device.
70 | void open (std::string& device)
71 | {
72 | if(zbar_video_open(_video, device.c_str()))
73 | throw_exception(_video);
74 | }
75 |
76 | /// close video device if open.
77 | void close ()
78 | {
79 | if(zbar_video_open(_video, NULL))
80 | throw_exception(_video);
81 | }
82 |
83 | /// initialize video using a specific format for debug.
84 | /// see zbar_video_init()
85 | void init (unsigned long fourcc)
86 | {
87 | if(zbar_video_init(_video, fourcc))
88 | throw_exception(_video);
89 | }
90 |
91 | /// initialize video using a specific format for debug.
92 | /// see zbar_video_init()
93 | void init (std::string& format)
94 | {
95 | unsigned int fourcc = zbar_fourcc_parse(format.c_str());
96 | if(zbar_video_init(_video, fourcc))
97 | throw_exception(_video);
98 | }
99 |
100 | /// retrieve file descriptor associated with open *nix video device.
101 | /// see zbar_video_get_fd()
102 | int get_fd ()
103 | {
104 | return(zbar_video_get_fd(_video));
105 | }
106 |
107 | /// retrieve current output image width.
108 | /// see zbar_video_get_width()
109 | int get_width ()
110 | {
111 | return(zbar_video_get_width(_video));
112 | }
113 |
114 | /// retrieve current output image height.
115 | /// see zbar_video_get_height()
116 | int get_height ()
117 | {
118 | return(zbar_video_get_height(_video));
119 | }
120 |
121 | /// start/stop video capture.
122 | /// see zbar_video_enable()
123 | void enable (bool enable = true)
124 | {
125 | if(zbar_video_enable(_video, enable))
126 | throw_exception(_video);
127 | }
128 |
129 | /// retrieve next captured image.
130 | /// see zbar_video_next_image()
131 | Image next_image ()
132 | {
133 | zbar_image_t *img = zbar_video_next_image(_video);
134 | if(!img)
135 | throw_exception(_video);
136 | return(Image(img));
137 | }
138 |
139 | /// request a preferred size for the video image from the device.
140 | /// see zbar_video_request_size()
141 | /// @since 0.6
142 | void request_size (int width, int height)
143 | {
144 | zbar_video_request_size(_video, width, height);
145 | }
146 |
147 | /// request a preferred driver interface version for debug/testing.
148 | /// see zbar_video_request_interface()
149 | /// @since 0.6
150 | void request_interface (int version)
151 | {
152 | zbar_video_request_interface(_video, version);
153 | }
154 |
155 | /// request a preferred I/O mode for debug/testing.
156 | /// see zbar_video_request_iomode()
157 | /// @since 0.7
158 | void request_iomode (int iomode)
159 | {
160 | if(zbar_video_request_iomode(_video, iomode))
161 | throw_exception(_video);
162 | }
163 |
164 | private:
165 | zbar_video_t *_video;
166 | };
167 |
168 | }
169 |
170 | #endif
171 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/Headers/zbar/Window.h:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------
2 | // Copyright 2007-2009 (c) Jeff Brown
3 | //
4 | // This file is part of the ZBar Bar Code Reader.
5 | //
6 | // The ZBar Bar Code Reader is free software; you can redistribute it
7 | // and/or modify it under the terms of the GNU Lesser Public License as
8 | // published by the Free Software Foundation; either version 2.1 of
9 | // the License, or (at your option) any later version.
10 | //
11 | // The ZBar Bar Code Reader is distributed in the hope that it will be
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser Public License for more details.
15 | //
16 | // You should have received a copy of the GNU Lesser Public License
17 | // along with the ZBar Bar Code Reader; if not, write to the Free
18 | // Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 | // Boston, MA 02110-1301 USA
20 | //
21 | // http://sourceforge.net/projects/zbar
22 | //------------------------------------------------------------------------
23 | #ifndef _ZBAR_WINDOW_H_
24 | #define _ZBAR_WINDOW_H_
25 |
26 | /// @file
27 | /// Output Window C++ wrapper
28 |
29 | #ifndef _ZBAR_H_
30 | # error "include zbar.h in your application, **not** zbar/Window.h"
31 | #endif
32 |
33 | #include "Image.h"
34 |
35 | namespace zbar {
36 |
37 | /// mid-level output window abstraction.
38 | /// displays images to user-specified platform specific output window
39 |
40 | class Window {
41 | public:
42 | /// constructor.
43 | Window (zbar_window_t *window = NULL)
44 | {
45 | if(window)
46 | _window = window;
47 | else
48 | _window = zbar_window_create();
49 | }
50 |
51 | /// constructor.
52 | Window (void *x11_display_w32_hwnd,
53 | unsigned long x11_drawable)
54 | {
55 | _window = zbar_window_create();
56 | attach(x11_display_w32_hwnd, x11_drawable);
57 | }
58 |
59 | ~Window ()
60 | {
61 | zbar_window_destroy(_window);
62 | }
63 |
64 | /// cast to C window object.
65 | operator zbar_window_t* () const
66 | {
67 | return(_window);
68 | }
69 |
70 | /// associate reader with an existing platform window.
71 | /// see zbar_window_attach()
72 | void attach (void *x11_display_w32_hwnd,
73 | unsigned long x11_drawable = 0)
74 | {
75 | if(zbar_window_attach(_window,
76 | x11_display_w32_hwnd, x11_drawable) < 0)
77 | throw_exception(_window);
78 | }
79 |
80 | /// control content level of the reader overlay.
81 | /// see zbar_window_set_overlay()
82 | void set_overlay (int level)
83 | {
84 | zbar_window_set_overlay(_window, level);
85 | }
86 |
87 | /// retrieve current content level of reader overlay.
88 | /// see zbar_window_get_overlay()
89 |
90 | /// draw a new image into the output window.
91 | /// see zbar_window_draw()
92 | void draw (Image& image)
93 | {
94 | if(zbar_window_draw(_window, image) < 0)
95 | throw_exception(_window);
96 | }
97 |
98 | /// clear the image from the output window.
99 | /// see zbar_window_draw()
100 | void clear ()
101 | {
102 | if(zbar_window_draw(_window, NULL) < 0)
103 | throw_exception(_window);
104 | }
105 |
106 | /// redraw the last image.
107 | /// zbar_window_redraw()
108 | void redraw ()
109 | {
110 | if(zbar_window_redraw(_window) < 0)
111 | throw_exception(_window);
112 | }
113 |
114 | /// resize the image window.
115 | /// zbar_window_resize()
116 | void resize (unsigned width, unsigned height)
117 | {
118 | if(zbar_window_resize(_window, width, height) < 0)
119 | throw_exception(_window);
120 | }
121 |
122 | private:
123 | zbar_window_t *_window;
124 | };
125 |
126 | /// select a compatible format between video input and output window.
127 | /// see zbar_negotiate_format()
128 | static inline void negotiate_format (Video& video, Window& window)
129 | {
130 | if(zbar_negotiate_format(video, window) < 0)
131 | throw_exception(video);
132 | }
133 |
134 | }
135 |
136 | #endif
137 |
--------------------------------------------------------------------------------
/ios/BitmapDataQRCodeScanner/ZBarSDK/libzbar.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luarpro/BitmapDataQRCodeScanner/60f9759a6493a2655f167a217f3a04c8e42667a3/ios/BitmapDataQRCodeScanner/ZBarSDK/libzbar.a
--------------------------------------------------------------------------------