8 |
9 | This document explains how to run a licensed version of the SDK inside a container. You can ignore it if you're using the trial version.
10 |
11 | As explained at [https://www.doubango.org/pricing.html](https://www.doubango.org/pricing.html) our licensing model is per device/machine.
12 | Each machine is uniquely identified using the hardware information (CPU model, motherboard, architecture, hard drive serial number...). The hardware information doesn't change even if the OS is (up/down)-graded or reinstalled. We don't use network information like the MAC address to make sure the SDK can work without [NIC](https://en.wikipedia.org/wiki/Network_interface_controller).
13 |
14 | [The machine's unique identifier](https://www.doubango.org/SDKs/LicenseManager/docs/Jargon.html#runtime-key) is built from the hardware information and generated as base64 encrypted key using the [runtimeKey](samples/c++/runtimeKey/) application. You don't need to build the application by yourself, use the pre-built [binaries](binaries).
15 | Once you have the [runtime key](https://www.doubango.org/SDKs/LicenseManager/docs/Jargon.html#runtime-key) you can generate the [token (license)](https://www.doubango.org/SDKs/LicenseManager/docs/Jargon.html#token) using the [activation](https://www.doubango.org/SDKs/LicenseManager/docs/Activation_use_cases.html) function. More information about the process at [https://www.doubango.org/SDKs/LicenseManager/docs/](https://www.doubango.org/SDKs/LicenseManager/docs/).
16 |
17 | This document is about using [docker](https://www.docker.com/) containers on Ubuntu 18. Please [contact us](https://www.doubango.org/#contact) for any other scenario.
18 |
19 |
20 | # The issue #
21 | The problem with a container or any virtual machine is that you don't have access to the devices (hard drive, usb...) attached to the host machine.
22 | It's possible to run a container as super user using `--privileged` option in order to have complet access to the host but we are avoiding it for obvious reasons.
23 |
24 |
25 | # The solution #
26 | A container can have access to the CPU information used by our license manager but not to the information related to the hard drive or motherboard. The solution is to give a container the rights to have access to the missing information.
27 | **We only provide read only access for security reasons and we highly recommend running the container as non root user.**
28 |
29 | We consider you already have [docker](https://www.docker.com/) correctly installed. If not, we recommend the guide at https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04.
30 |
31 |
32 | ## Pull your image (optional) ##
33 | Only required if you don't already have your own image. In our case we are using `ubuntu` image.
34 |
35 | ```
36 | docker pull ubuntu
37 | ```
38 | To check that the image is correctly downloaded: `docker images`.
39 |
40 |
41 | ## Run a container ##
42 | To run a container using the previously downloaded image (`ubuntu`) you'll need some additional parameters.
43 | The command:
44 | ```
45 | docker run -v /run/udev:/run/udev:ro -v /dev:/dev:ro -it ubuntu
46 | ```
47 | - `-v /run/udev:/run/udev:ro`: The format is "name of the volume to mount:the destination:the access rights". In this case we need `ro` (read-only) access rights. More info at https://docs.docker.com/storage/volumes/
48 | - `-v /dev:/dev:ro`: See above
49 |
50 | In short, we want to allow the [udev](https://en.wikipedia.org/wiki/Udev) tool running inside a container to get access to the hardware information on the host. [udev](https://en.wikipedia.org/wiki/Udev) runs on userspace and doesn't require root access. The SDK will run `udevadm info --query=property --name=...` to retrieve hardware information. You can run the same command inside the container to check if the SDK will succeed.
51 |
52 |
53 | ## Setup (inside the container) ##
54 | - Update:
55 | ```
56 | apt update
57 | ```
58 | - Install [udev](https://en.wikipedia.org/wiki/Udev):
59 | ```
60 | apt install udev
61 | ```
62 |
63 | That's it, now you're ready to run the [runtimeKey](samples/c++/runtimeKey/) application to generate the [runtime key](https://www.doubango.org/SDKs/LicenseManager/docs/Jargon.html#runtime-key) for [activation](https://www.doubango.org/SDKs/LicenseManager/docs/Activation_use_cases.html).
64 |
--------------------------------------------------------------------------------
/Dependencies.md:
--------------------------------------------------------------------------------
1 |
2 | # Dependencies #
3 | **The SDK is developed in C++11** and you'll need **glibc 2.27+** on *Linux* and **[Microsoft Visual C++ 2015 Redistributable(x64) - 14.0.24123](https://www.microsoft.com/en-us/download/details.aspx?id=52685)** (any later version is ok) on *Windows*. **You most likely already have these dependencies on you machine** as almost every program require it.
4 |
5 |
6 |
7 | ## Debugging missing dependencies ##
8 | To check if all dependencies are present:
9 | - **Windows x86_64:** Use [Dependency Walker](https://www.dependencywalker.com/) on [binaries/windows/x86_64/ultimateMRZ-SDK.dll](../../../binaries/windows/x86_64/ultimateMRZ-SDK.dll).
10 | - **Linux x86_64:** Use `ldd ` on [binaries/linux/x86_64/libultimate_mrz-sdk.so](../../../binaries/linux/x86_64/libultimate_mrz-sdk.so).
11 |
12 | ## Known issues ##
13 | On Windows you may have `The code execution cannot proceed because MSVCP140.dll was not found. Reinstalling the program may fix the problem.` message if **[Microsoft Visual C++ 2015 Redistributable(x64) - 14.0.24123](https://www.microsoft.com/en-us/download/details.aspx?id=52685)** is missing.
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2011-2019 Doubango Telecom
2 |
3 | For non commercial use only.
4 |
5 | Please contact us at https://www.doubango.org/#contact for commercial version.
--------------------------------------------------------------------------------
/PerAppLicense.md:
--------------------------------------------------------------------------------
1 | - [Android](#android)
2 | - [License format](#android-license-format)
3 | - [The application identifier](#android-license-format-appid)
4 | - [List of installers](#android-license-format-installers)
5 | - [Signing certificate's fingerprint (SHA256)](#android-license-format-fingerprint)
6 | - [License generation](#android-license-generation)
7 | - [License deployment](#android-license-deployment)
8 | - [iOS](#ios)
9 |
10 |
11 |
12 | Starting version **v2.10.0** we have added support for application-wide licenses. This kind of license is attached to an application identifier rather than a device.
13 | This is suitable for applications distributed via Google Play or any other store with no limitation on the number of devices.
14 |
15 |
16 | # Android #
17 | Everything related to the license is done in C++ to make it harder to decompile.
18 |
19 |
20 | ## License format ##
21 | The license is a base64 encrypted string containing 3 elements:
22 | - The application identifier
23 | - The list of allowed installers (stores)
24 | - The signing certificate's fingerprint
25 |
26 | At runtime we'll check that:
27 | - the application identifier matches the one in the license string `check #1`
28 | - the application was signed using the same signature stored in the license string `check #2`
29 | - the application was installed from a store listed in the license string (Google Play, Amazon, Huawei...) `check #3`
30 |
31 | The above checks means you'll not be able to test a license while developing your app unless the app is deployed and installed from a store. You'll be able to pass `check #1` and `check #2` but not `check #3` if the license is correctly configured. We offer (free) #3 device-based licenses to help you test your app.
32 |
33 |
34 | ### The application identifier (SHA256) ###
35 | The application identifier is in your `build.gradle` at `android {` -> `defaultConfig {` -> `applicationId "<< your appid here >>"`. **The license will no longer work if you change this identifier**. This identifier must remain the same for the application's lifetime.
36 | Example -> https://github.com/DoubangoTelecom/ultimateMRZ-SDK/blob/68c998b3d8ed4f5e0a71fdac3bc04f3f79352224/samples/android/videorecognizer/build.gradle#L8.
37 |
38 |
39 | ### List of installers ###
40 | The license will only work with applications installed from a registered store. By default, we support **Google Play, Amazon and Huawei** stores. New stores can be added on request.
41 |
42 |
43 | ### Signing certificate's fingerprint ###
44 | An application must be signed before deploying it on a store. The signing keys must remain the same for the application's lifetime. By default these keys are [valid for at least 25 years](https://developer.android.com/studio/publish/app-signing#:~:text=Your%20key%20should%20be%20valid,about%20yourself%20for%20your%20certificate.).
45 |
46 | Please note that the dev (debug) keys used to sign an application are not valid for the app stores. On Windows, the dev keystore is at `C:\Users\<>\.android\debug.keystore`. Please do not use that keystore for license generation.
47 |
48 | We'll need the certificate's fingerprint (**SHA256**) to generate your license. The fingerprint could be generated using the following command: `keytool -list -v -keystore -alias -storepass -keypass `. Example: `keytool -list -v -keystore "C:\Projects\AndroidKeystore\android_keystore.jks" -alias myalias -storepass mypass1 -keypass mypass2`.
49 |
50 | For information on how to retrive the certificate's fingerprint: https://help.short.io/en/articles/4171170-where-to-find-android-app-package-name-and-sha256-fingerprint-certificate
51 |
52 |
53 | ## License generation ##
54 | In order to generate a license for your application we'll need 2 elements:
55 | - The application identifier
56 | - The certificate's fingerprint (SHA-256)
57 |
58 |
59 | ## License deployment ##
60 | The license is a base64 encrypted string. It could be stored in a file and loaded at runtime or hard-coded. JSON configuration entry [license_token_data](https://www.doubango.org/SDKs/mrz/docs/Configuration_options.html#license-token-data) is used to pass the license to the MRZ engine in order to unlock the SDK.
61 |
62 |
63 | # iOS #
64 | Coming soon...
65 |
--------------------------------------------------------------------------------
/SDK_TechnicalGuide_v2.0.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/SDK_TechnicalGuide_v2.0.pdf
--------------------------------------------------------------------------------
/VCpp_config.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/VCpp_config.jpg
--------------------------------------------------------------------------------
/VCsharp_config.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/VCsharp_config.jpg
--------------------------------------------------------------------------------
/assets/fonts/OcrB Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/fonts/OcrB Regular.ttf
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient1_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient1_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient2_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient2_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient3_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient3_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient4_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient4_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient5_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient5_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient6_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient6_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient7_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient7_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Czech_passport_2005_MRZ_orient8_1300x1002.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Czech_passport_2005_MRZ_orient8_1300x1002.jpg
--------------------------------------------------------------------------------
/assets/images/Passport-Australia_1280x720.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Passport-Australia_1280x720.jpg
--------------------------------------------------------------------------------
/assets/images/Passport-Australia_1280x720_rotate+90.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Passport-Australia_1280x720_rotate+90.jpg
--------------------------------------------------------------------------------
/assets/images/Passport-Australia_1280x720_rotate-90.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Passport-Australia_1280x720_rotate-90.jpg
--------------------------------------------------------------------------------
/assets/images/Passport-France_1200x864.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/images/Passport-France_1200x864.jpg
--------------------------------------------------------------------------------
/assets/models/mrz.classifier.params.json.doubango:
--------------------------------------------------------------------------------
1 | ultimateMRZ-----dhF(+#oo`zVp`~W+)-)B ,/) bdjo~WdfQI*6+)
dcc.)0 9 ((nMFfv{]KL^{Vhl|dbpbhc( 3!F{MWtOB(piqdll"3,; 1$La 8#nm_'se|tgck/:),]vei#;/1{:ea%bat%LZU'! !i5wkkn"sa)'l}##
#/!.d!9>>';i^ccahfirdphbbRal~raf&Czh&M6Qpu#$--mF6<50gj~lh`on|Zkx}ecgl(2%]k,n*%(%.elodo <;?ZBh~mabYpxxh.-1 nZb|"'bhHmh(ic_gcdhbpqcJNN2_X) # #)%U#$`NZ^bek=)+ohx"!4!><*BhXOLA,W]dTlf^ztudbk#?%pVTc&+2GJ
2 | heU~`eo':j\LFfeKAKg_mvylue`coBFHCa
3 | MciIhk"gu|Vkce!@RK@"4<'$"zifkl|W* MWB[NE*99' x
--------------------------------------------------------------------------------
/assets/models/mrz.classifier.strong.model.flat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/models/mrz.classifier.strong.model.flat
--------------------------------------------------------------------------------
/assets/models/mrz.traineddata:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DoubangoTelecom/ultimateMRZ-SDK/db64de7a955de75c2b554f44923d0eedffe9cd56/assets/models/mrz.traineddata
--------------------------------------------------------------------------------
/assets/samples/mrva.txt:
--------------------------------------------------------------------------------
1 | V= 0 && swigValues[swigValue].swigValue == swigValue)
31 | return swigValues[swigValue];
32 | for (ULTMRZ_SDK_IMAGE_TYPE swigEnum : swigValues)
33 | if (swigEnum.swigValue == swigValue)
34 | return swigEnum;
35 | throw new IllegalArgumentException("No enum " + ULTMRZ_SDK_IMAGE_TYPE.class + " with value " + swigValue);
36 | }
37 |
38 | @SuppressWarnings("unused")
39 | private ULTMRZ_SDK_IMAGE_TYPE() {
40 | this.swigValue = SwigNext.next++;
41 | }
42 |
43 | @SuppressWarnings("unused")
44 | private ULTMRZ_SDK_IMAGE_TYPE(int swigValue) {
45 | this.swigValue = swigValue;
46 | SwigNext.next = swigValue+1;
47 | }
48 |
49 | @SuppressWarnings("unused")
50 | private ULTMRZ_SDK_IMAGE_TYPE(ULTMRZ_SDK_IMAGE_TYPE swigEnum) {
51 | this.swigValue = swigEnum.swigValue;
52 | SwigNext.next = this.swigValue+1;
53 | }
54 |
55 | private final int swigValue;
56 |
57 | private static class SwigNext {
58 | private static int next = 0;
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/java/android/org/doubango/ultimateMrz/Sdk/UltMrzSdkResult.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class UltMrzSdkResult {
12 | private long swigCPtr;
13 | protected boolean swigCMemOwn;
14 |
15 | protected UltMrzSdkResult(long cPtr, boolean cMemoryOwn) {
16 | swigCMemOwn = cMemoryOwn;
17 | swigCPtr = cPtr;
18 | }
19 |
20 | protected static long getCPtr(UltMrzSdkResult obj) {
21 | return (obj == null) ? 0 : obj.swigCPtr;
22 | }
23 |
24 | protected void finalize() {
25 | delete();
26 | }
27 |
28 | public synchronized void delete() {
29 | if (swigCPtr != 0) {
30 | if (swigCMemOwn) {
31 | swigCMemOwn = false;
32 | ultimateMrzSdkJNI.delete_UltMrzSdkResult(swigCPtr);
33 | }
34 | swigCPtr = 0;
35 | }
36 | }
37 |
38 | public UltMrzSdkResult() {
39 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_0(), true);
40 | }
41 |
42 | public UltMrzSdkResult(int code, String phrase, String json, long numZones) {
43 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_1(code, phrase, json, numZones), true);
44 | }
45 |
46 | public UltMrzSdkResult(int code, String phrase, String json) {
47 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_2(code, phrase, json), true);
48 | }
49 |
50 | public UltMrzSdkResult(UltMrzSdkResult other) {
51 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_3(UltMrzSdkResult.getCPtr(other), other), true);
52 | }
53 |
54 | public int code() {
55 | return ultimateMrzSdkJNI.UltMrzSdkResult_code(swigCPtr, this);
56 | }
57 |
58 | public String phrase() {
59 | return ultimateMrzSdkJNI.UltMrzSdkResult_phrase(swigCPtr, this);
60 | }
61 |
62 | public String json() {
63 | return ultimateMrzSdkJNI.UltMrzSdkResult_json(swigCPtr, this);
64 | }
65 |
66 | public long numZones() {
67 | return ultimateMrzSdkJNI.UltMrzSdkResult_numZones(swigCPtr, this);
68 | }
69 |
70 | public boolean isOK() {
71 | return ultimateMrzSdkJNI.UltMrzSdkResult_isOK(swigCPtr, this);
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/java/android/org/doubango/ultimateMrz/Sdk/ultimateMrzSdk.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class ultimateMrzSdk implements ultimateMrzSdkConstants {
12 | }
13 |
--------------------------------------------------------------------------------
/java/android/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkConstants.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public interface ultimateMrzSdkConstants {
12 | public final static int ULTMRZ_SDK_VERSION_MAJOR = 2;
13 | public final static int ULTMRZ_SDK_VERSION_MINOR = 9;
14 | public final static int ULTMRZ_SDK_VERSION_MICRO = 0;
15 | }
16 |
--------------------------------------------------------------------------------
/java/android/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkJNI.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class ultimateMrzSdkJNI {
12 |
13 | static {
14 | System.loadLibrary("ultimateMRZ_SDK");
15 | }
16 |
17 | public final static native long new_UltMrzSdkResult__SWIG_0();
18 | public final static native long new_UltMrzSdkResult__SWIG_1(int jarg1, String jarg2, String jarg3, long jarg4);
19 | public final static native long new_UltMrzSdkResult__SWIG_2(int jarg1, String jarg2, String jarg3);
20 | public final static native long new_UltMrzSdkResult__SWIG_3(long jarg1, UltMrzSdkResult jarg1_);
21 | public final static native void delete_UltMrzSdkResult(long jarg1);
22 | public final static native int UltMrzSdkResult_code(long jarg1, UltMrzSdkResult jarg1_);
23 | public final static native String UltMrzSdkResult_phrase(long jarg1, UltMrzSdkResult jarg1_);
24 | public final static native String UltMrzSdkResult_json(long jarg1, UltMrzSdkResult jarg1_);
25 | public final static native long UltMrzSdkResult_numZones(long jarg1, UltMrzSdkResult jarg1_);
26 | public final static native boolean UltMrzSdkResult_isOK(long jarg1, UltMrzSdkResult jarg1_);
27 | public final static native long UltMrzSdkEngine_init__SWIG_0(Object jarg1, String jarg2);
28 | public final static native long UltMrzSdkEngine_init__SWIG_1(Object jarg1);
29 | public final static native long UltMrzSdkEngine_deInit();
30 | public final static native long UltMrzSdkEngine_process__SWIG_0(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4, long jarg5, int jarg6);
31 | public final static native long UltMrzSdkEngine_process__SWIG_1(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4, long jarg5);
32 | public final static native long UltMrzSdkEngine_process__SWIG_2(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4);
33 | public final static native long UltMrzSdkEngine_process__SWIG_3(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9, long jarg10, int jarg11);
34 | public final static native long UltMrzSdkEngine_process__SWIG_4(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9, long jarg10);
35 | public final static native long UltMrzSdkEngine_process__SWIG_5(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9);
36 | public final static native int UltMrzSdkEngine_exifOrientation(java.nio.ByteBuffer jarg1, long jarg2);
37 | public final static native long UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_0(boolean jarg1);
38 | public final static native long UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_1();
39 | public final static native void delete_UltMrzSdkEngine(long jarg1);
40 | }
41 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/ULTMRZ_SDK_IMAGE_TYPE.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public enum ULTMRZ_SDK_IMAGE_TYPE {
12 | ULTMRZ_SDK_IMAGE_TYPE_RGB24,
13 | ULTMRZ_SDK_IMAGE_TYPE_RGBA32,
14 | ULTMRZ_SDK_IMAGE_TYPE_BGRA32,
15 | ULTMRZ_SDK_IMAGE_TYPE_NV12,
16 | ULTMRZ_SDK_IMAGE_TYPE_NV21,
17 | ULTMRZ_SDK_IMAGE_TYPE_YUV420P,
18 | ULTMRZ_SDK_IMAGE_TYPE_YVU420P,
19 | ULTMRZ_SDK_IMAGE_TYPE_YUV422P,
20 | ULTMRZ_SDK_IMAGE_TYPE_YUV444P,
21 | ULTMRZ_SDK_IMAGE_TYPE_Y,
22 | ULTMRZ_SDK_IMAGE_TYPE_BGR24;
23 |
24 | public final int swigValue() {
25 | return swigValue;
26 | }
27 |
28 | public static ULTMRZ_SDK_IMAGE_TYPE swigToEnum(int swigValue) {
29 | ULTMRZ_SDK_IMAGE_TYPE[] swigValues = ULTMRZ_SDK_IMAGE_TYPE.class.getEnumConstants();
30 | if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
31 | return swigValues[swigValue];
32 | for (ULTMRZ_SDK_IMAGE_TYPE swigEnum : swigValues)
33 | if (swigEnum.swigValue == swigValue)
34 | return swigEnum;
35 | throw new IllegalArgumentException("No enum " + ULTMRZ_SDK_IMAGE_TYPE.class + " with value " + swigValue);
36 | }
37 |
38 | @SuppressWarnings("unused")
39 | private ULTMRZ_SDK_IMAGE_TYPE() {
40 | this.swigValue = SwigNext.next++;
41 | }
42 |
43 | @SuppressWarnings("unused")
44 | private ULTMRZ_SDK_IMAGE_TYPE(int swigValue) {
45 | this.swigValue = swigValue;
46 | SwigNext.next = swigValue+1;
47 | }
48 |
49 | @SuppressWarnings("unused")
50 | private ULTMRZ_SDK_IMAGE_TYPE(ULTMRZ_SDK_IMAGE_TYPE swigEnum) {
51 | this.swigValue = swigEnum.swigValue;
52 | SwigNext.next = this.swigValue+1;
53 | }
54 |
55 | private final int swigValue;
56 |
57 | private static class SwigNext {
58 | private static int next = 0;
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/UltMrzSdkEngine.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class UltMrzSdkEngine {
12 | private long swigCPtr;
13 | protected boolean swigCMemOwn;
14 |
15 | protected UltMrzSdkEngine(long cPtr, boolean cMemoryOwn) {
16 | swigCMemOwn = cMemoryOwn;
17 | swigCPtr = cPtr;
18 | }
19 |
20 | protected static long getCPtr(UltMrzSdkEngine obj) {
21 | return (obj == null) ? 0 : obj.swigCPtr;
22 | }
23 |
24 | protected void finalize() {
25 | delete();
26 | }
27 |
28 | public synchronized void delete() {
29 | if (swigCPtr != 0) {
30 | if (swigCMemOwn) {
31 | swigCMemOwn = false;
32 | ultimateMrzSdkJNI.delete_UltMrzSdkEngine(swigCPtr);
33 | }
34 | swigCPtr = 0;
35 | }
36 | }
37 |
38 | public static UltMrzSdkResult init(String jsonConfig) {
39 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_init__SWIG_0(jsonConfig), true);
40 | }
41 |
42 | public static UltMrzSdkResult init() {
43 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_init__SWIG_1(), true);
44 | }
45 |
46 | public static UltMrzSdkResult deInit() {
47 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_deInit(), true);
48 | }
49 |
50 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer imageData, long imageWidthInSamples, long imageHeightInSamples, long imageStrideInSamples, int imageExifOrientation) {
51 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_0(imageType.swigValue(), imageData, imageWidthInSamples, imageHeightInSamples, imageStrideInSamples, imageExifOrientation), true);
52 | }
53 |
54 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer imageData, long imageWidthInSamples, long imageHeightInSamples, long imageStrideInSamples) {
55 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_1(imageType.swigValue(), imageData, imageWidthInSamples, imageHeightInSamples, imageStrideInSamples), true);
56 | }
57 |
58 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer imageData, long imageWidthInSamples, long imageHeightInSamples) {
59 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_2(imageType.swigValue(), imageData, imageWidthInSamples, imageHeightInSamples), true);
60 | }
61 |
62 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer yPtr, java.nio.ByteBuffer uPtr, java.nio.ByteBuffer vPtr, long widthInSamples, long heightInSamples, long yStrideInBytes, long uStrideInBytes, long vStrideInBytes, long uvPixelStrideInBytes, int exifOrientation) {
63 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_3(imageType.swigValue(), yPtr, uPtr, vPtr, widthInSamples, heightInSamples, yStrideInBytes, uStrideInBytes, vStrideInBytes, uvPixelStrideInBytes, exifOrientation), true);
64 | }
65 |
66 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer yPtr, java.nio.ByteBuffer uPtr, java.nio.ByteBuffer vPtr, long widthInSamples, long heightInSamples, long yStrideInBytes, long uStrideInBytes, long vStrideInBytes, long uvPixelStrideInBytes) {
67 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_4(imageType.swigValue(), yPtr, uPtr, vPtr, widthInSamples, heightInSamples, yStrideInBytes, uStrideInBytes, vStrideInBytes, uvPixelStrideInBytes), true);
68 | }
69 |
70 | public static UltMrzSdkResult process(ULTMRZ_SDK_IMAGE_TYPE imageType, java.nio.ByteBuffer yPtr, java.nio.ByteBuffer uPtr, java.nio.ByteBuffer vPtr, long widthInSamples, long heightInSamples, long yStrideInBytes, long uStrideInBytes, long vStrideInBytes) {
71 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_process__SWIG_5(imageType.swigValue(), yPtr, uPtr, vPtr, widthInSamples, heightInSamples, yStrideInBytes, uStrideInBytes, vStrideInBytes), true);
72 | }
73 |
74 | public static int exifOrientation(java.nio.ByteBuffer jpegMetaDataPtr, long jpegMetaDataSize) {
75 | return ultimateMrzSdkJNI.UltMrzSdkEngine_exifOrientation(jpegMetaDataPtr, jpegMetaDataSize);
76 | }
77 |
78 | public static UltMrzSdkResult requestRuntimeLicenseKey(boolean rawInsteadOfJSON) {
79 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_0(rawInsteadOfJSON), true);
80 | }
81 |
82 | public static UltMrzSdkResult requestRuntimeLicenseKey() {
83 | return new UltMrzSdkResult(ultimateMrzSdkJNI.UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_1(), true);
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/UltMrzSdkResult.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class UltMrzSdkResult {
12 | private long swigCPtr;
13 | protected boolean swigCMemOwn;
14 |
15 | protected UltMrzSdkResult(long cPtr, boolean cMemoryOwn) {
16 | swigCMemOwn = cMemoryOwn;
17 | swigCPtr = cPtr;
18 | }
19 |
20 | protected static long getCPtr(UltMrzSdkResult obj) {
21 | return (obj == null) ? 0 : obj.swigCPtr;
22 | }
23 |
24 | protected void finalize() {
25 | delete();
26 | }
27 |
28 | public synchronized void delete() {
29 | if (swigCPtr != 0) {
30 | if (swigCMemOwn) {
31 | swigCMemOwn = false;
32 | ultimateMrzSdkJNI.delete_UltMrzSdkResult(swigCPtr);
33 | }
34 | swigCPtr = 0;
35 | }
36 | }
37 |
38 | public UltMrzSdkResult() {
39 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_0(), true);
40 | }
41 |
42 | public UltMrzSdkResult(int code, String phrase, String json, long numZones) {
43 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_1(code, phrase, json, numZones), true);
44 | }
45 |
46 | public UltMrzSdkResult(int code, String phrase, String json) {
47 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_2(code, phrase, json), true);
48 | }
49 |
50 | public UltMrzSdkResult(UltMrzSdkResult other) {
51 | this(ultimateMrzSdkJNI.new_UltMrzSdkResult__SWIG_3(UltMrzSdkResult.getCPtr(other), other), true);
52 | }
53 |
54 | public int code() {
55 | return ultimateMrzSdkJNI.UltMrzSdkResult_code(swigCPtr, this);
56 | }
57 |
58 | public String phrase() {
59 | return ultimateMrzSdkJNI.UltMrzSdkResult_phrase(swigCPtr, this);
60 | }
61 |
62 | public String json() {
63 | return ultimateMrzSdkJNI.UltMrzSdkResult_json(swigCPtr, this);
64 | }
65 |
66 | public long numZones() {
67 | return ultimateMrzSdkJNI.UltMrzSdkResult_numZones(swigCPtr, this);
68 | }
69 |
70 | public boolean isOK() {
71 | return ultimateMrzSdkJNI.UltMrzSdkResult_isOK(swigCPtr, this);
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/ultimateMrzSdk.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class ultimateMrzSdk implements ultimateMrzSdkConstants {
12 | }
13 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkConstants.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public interface ultimateMrzSdkConstants {
12 | public final static int ULTMRZ_SDK_VERSION_MAJOR = 2;
13 | public final static int ULTMRZ_SDK_VERSION_MINOR = 9;
14 | public final static int ULTMRZ_SDK_VERSION_MICRO = 0;
15 | }
16 |
--------------------------------------------------------------------------------
/java/org/doubango/ultimateMrz/Sdk/ultimateMrzSdkJNI.java:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------------
2 | * This file was automatically generated by SWIG (http://www.swig.org).
3 | * Version 2.0.9
4 | *
5 | * Do not make changes to this file unless you know what you are doing--modify
6 | * the SWIG interface file instead.
7 | * ----------------------------------------------------------------------------- */
8 |
9 | package org.doubango.ultimateMrz.Sdk;
10 |
11 | public class ultimateMrzSdkJNI {
12 | public final static native long new_UltMrzSdkResult__SWIG_0();
13 | public final static native long new_UltMrzSdkResult__SWIG_1(int jarg1, String jarg2, String jarg3, long jarg4);
14 | public final static native long new_UltMrzSdkResult__SWIG_2(int jarg1, String jarg2, String jarg3);
15 | public final static native long new_UltMrzSdkResult__SWIG_3(long jarg1, UltMrzSdkResult jarg1_);
16 | public final static native void delete_UltMrzSdkResult(long jarg1);
17 | public final static native int UltMrzSdkResult_code(long jarg1, UltMrzSdkResult jarg1_);
18 | public final static native String UltMrzSdkResult_phrase(long jarg1, UltMrzSdkResult jarg1_);
19 | public final static native String UltMrzSdkResult_json(long jarg1, UltMrzSdkResult jarg1_);
20 | public final static native long UltMrzSdkResult_numZones(long jarg1, UltMrzSdkResult jarg1_);
21 | public final static native boolean UltMrzSdkResult_isOK(long jarg1, UltMrzSdkResult jarg1_);
22 | public final static native long UltMrzSdkEngine_init__SWIG_0(String jarg1);
23 | public final static native long UltMrzSdkEngine_init__SWIG_1();
24 | public final static native long UltMrzSdkEngine_deInit();
25 | public final static native long UltMrzSdkEngine_process__SWIG_0(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4, long jarg5, int jarg6);
26 | public final static native long UltMrzSdkEngine_process__SWIG_1(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4, long jarg5);
27 | public final static native long UltMrzSdkEngine_process__SWIG_2(int jarg1, java.nio.ByteBuffer jarg2, long jarg3, long jarg4);
28 | public final static native long UltMrzSdkEngine_process__SWIG_3(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9, long jarg10, int jarg11);
29 | public final static native long UltMrzSdkEngine_process__SWIG_4(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9, long jarg10);
30 | public final static native long UltMrzSdkEngine_process__SWIG_5(int jarg1, java.nio.ByteBuffer jarg2, java.nio.ByteBuffer jarg3, java.nio.ByteBuffer jarg4, long jarg5, long jarg6, long jarg7, long jarg8, long jarg9);
31 | public final static native int UltMrzSdkEngine_exifOrientation(java.nio.ByteBuffer jarg1, long jarg2);
32 | public final static native long UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_0(boolean jarg1);
33 | public final static native long UltMrzSdkEngine_requestRuntimeLicenseKey__SWIG_1();
34 | public final static native void delete_UltMrzSdkEngine(long jarg1);
35 | }
36 |
--------------------------------------------------------------------------------
/objc/objc.i:
--------------------------------------------------------------------------------
1 | /* File : objc.i */
2 |
3 | /* http://www.swig.org/Doc1.3/Library.html#Library_carrays
4 | * 8.3.2 Passing binary data */
5 | %apply (char *STRING, int LENGTH) { (const void* buffer, int len) };
6 |
7 | %include ../swig.i
--------------------------------------------------------------------------------
/perl/perl.i:
--------------------------------------------------------------------------------
1 | /* File : perl.i */
2 |
3 | /* http://www.swig.org/Doc1.3/Library.html#Library_carrays
4 | * 8.3.2 Passing binary data */
5 | %apply (char *STRING, int LENGTH) { (const void* buffer, int len) };
6 |
7 | %include ../swig.i
8 |
--------------------------------------------------------------------------------
/perl/ultimateMrzSdk.pm:
--------------------------------------------------------------------------------
1 | # This file was automatically generated by SWIG (http://www.swig.org).
2 | # Version 2.0.9
3 | #
4 | # Do not make changes to this file unless you know what you are doing--modify
5 | # the SWIG interface file instead.
6 |
7 | package ultimateMrzSdk;
8 | use base qw(Exporter);
9 | use base qw(DynaLoader);
10 | package ultimateMrzSdkc;
11 | bootstrap ultimateMrzSdk;
12 | package ultimateMrzSdk;
13 | @EXPORT = qw();
14 |
15 | # ---------- BASE METHODS -------------
16 |
17 | package ultimateMrzSdk;
18 |
19 | sub TIEHASH {
20 | my ($classname,$obj) = @_;
21 | return bless $obj, $classname;
22 | }
23 |
24 | sub CLEAR { }
25 |
26 | sub FIRSTKEY { }
27 |
28 | sub NEXTKEY { }
29 |
30 | sub FETCH {
31 | my ($self,$field) = @_;
32 | my $member_func = "swig_${field}_get";
33 | $self->$member_func();
34 | }
35 |
36 | sub STORE {
37 | my ($self,$field,$newval) = @_;
38 | my $member_func = "swig_${field}_set";
39 | $self->$member_func($newval);
40 | }
41 |
42 | sub this {
43 | my $ptr = shift;
44 | return tied(%$ptr);
45 | }
46 |
47 |
48 | # ------- FUNCTION WRAPPERS --------
49 |
50 | package ultimateMrzSdk;
51 |
52 |
53 | ############# Class : ultimateMrzSdk::UltMrzSdkResult ##############
54 |
55 | package ultimateMrzSdk::UltMrzSdkResult;
56 | use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
57 | @ISA = qw( ultimateMrzSdk );
58 | %OWNER = ();
59 | %ITERATORS = ();
60 | sub new {
61 | my $pkg = shift;
62 | my $self = ultimateMrzSdkc::new_UltMrzSdkResult(@_);
63 | bless $self, $pkg if defined($self);
64 | }
65 |
66 | sub DESTROY {
67 | return unless $_[0]->isa('HASH');
68 | my $self = tied(%{$_[0]});
69 | return unless defined $self;
70 | delete $ITERATORS{$self};
71 | if (exists $OWNER{$self}) {
72 | ultimateMrzSdkc::delete_UltMrzSdkResult($self);
73 | delete $OWNER{$self};
74 | }
75 | }
76 |
77 | *code = *ultimateMrzSdkc::UltMrzSdkResult_code;
78 | *phrase = *ultimateMrzSdkc::UltMrzSdkResult_phrase;
79 | *json = *ultimateMrzSdkc::UltMrzSdkResult_json;
80 | *numZones = *ultimateMrzSdkc::UltMrzSdkResult_numZones;
81 | *isOK = *ultimateMrzSdkc::UltMrzSdkResult_isOK;
82 | sub DISOWN {
83 | my $self = shift;
84 | my $ptr = tied(%$self);
85 | delete $OWNER{$ptr};
86 | }
87 |
88 | sub ACQUIRE {
89 | my $self = shift;
90 | my $ptr = tied(%$self);
91 | $OWNER{$ptr} = 1;
92 | }
93 |
94 |
95 | ############# Class : ultimateMrzSdk::UltMrzSdkEngine ##############
96 |
97 | package ultimateMrzSdk::UltMrzSdkEngine;
98 | use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
99 | @ISA = qw( ultimateMrzSdk );
100 | %OWNER = ();
101 | %ITERATORS = ();
102 | *init = *ultimateMrzSdkc::UltMrzSdkEngine_init;
103 | *deInit = *ultimateMrzSdkc::UltMrzSdkEngine_deInit;
104 | *process = *ultimateMrzSdkc::UltMrzSdkEngine_process;
105 | *requestRuntimeLicenseKey = *ultimateMrzSdkc::UltMrzSdkEngine_requestRuntimeLicenseKey;
106 | sub DESTROY {
107 | return unless $_[0]->isa('HASH');
108 | my $self = tied(%{$_[0]});
109 | return unless defined $self;
110 | delete $ITERATORS{$self};
111 | if (exists $OWNER{$self}) {
112 | ultimateMrzSdkc::delete_UltMrzSdkEngine($self);
113 | delete $OWNER{$self};
114 | }
115 | }
116 |
117 | sub DISOWN {
118 | my $self = shift;
119 | my $ptr = tied(%$self);
120 | delete $OWNER{$ptr};
121 | }
122 |
123 | sub ACQUIRE {
124 | my $self = shift;
125 | my $ptr = tied(%$self);
126 | $OWNER{$ptr} = 1;
127 | }
128 |
129 |
130 | # ------- VARIABLE STUBS --------
131 |
132 | package ultimateMrzSdk;
133 |
134 | *ULTMRZ_SDK_VERSION_MAJOR = *ultimateMrzSdkc::ULTMRZ_SDK_VERSION_MAJOR;
135 | *ULTMRZ_SDK_VERSION_MINOR = *ultimateMrzSdkc::ULTMRZ_SDK_VERSION_MINOR;
136 | *ULTMRZ_SDK_VERSION_MICRO = *ultimateMrzSdkc::ULTMRZ_SDK_VERSION_MICRO;
137 | *ULTMRZ_SDK_IMAGE_TYPE_RGB24 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_RGB24;
138 | *ULTMRZ_SDK_IMAGE_TYPE_RGBA32 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_RGBA32;
139 | *ULTMRZ_SDK_IMAGE_TYPE_BGRA32 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_BGRA32;
140 | *ULTMRZ_SDK_IMAGE_TYPE_NV12 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_NV12;
141 | *ULTMRZ_SDK_IMAGE_TYPE_NV21 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_NV21;
142 | *ULTMRZ_SDK_IMAGE_TYPE_YUV420P = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_YUV420P;
143 | *ULTMRZ_SDK_IMAGE_TYPE_YVU420P = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_YVU420P;
144 | *ULTMRZ_SDK_IMAGE_TYPE_YUV422P = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_YUV422P;
145 | *ULTMRZ_SDK_IMAGE_TYPE_YUV444P = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_YUV444P;
146 | *ULTMRZ_SDK_IMAGE_TYPE_Y = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_Y;
147 | *ULTMRZ_SDK_IMAGE_TYPE_BGR24 = *ultimateMrzSdkc::ULTMRZ_SDK_IMAGE_TYPE_BGR24;
148 | 1;
149 |
--------------------------------------------------------------------------------
/python/README.md:
--------------------------------------------------------------------------------
1 | This SDK is developped using C++11 and comes with Python wrappers generated using SWIG.
2 |
3 | There is no Python extension in the repository. Generating pre-built extension will force us to choose a specific Python version which means you'll be bound to this decision.
4 | To avoid being bound to a specific Python version we let the extension build task up to you. Building the extension is very easy and doesn't require any specific skill.
5 |
6 | # C++ Compiler #
7 | You'll need a C++ compiler.
8 |
9 | On Windows we recommend Visual Studio 2015 Community or later.
10 |
11 | On Linux we recommend recent GCC/G++ version with support for C++11.
12 |
13 | # Building #
14 | You'll need Python, all versions are supported but ***we highly recommend 3.0 or later***. You'll also need **Cython** and **python-dev** packages. Other packages may be required but you can easily install them using **pip tool**.
15 |
16 | On Windows we recommend using Anaconda.
17 |
18 | Before building the extension you have to navigate to the folder containing the [binaries](../binaries):
19 | ```
20 | cd ultimateMRZ-SDK/binaries/<>/<>
21 | ```
22 | For example:
23 | - On Windows x86_64: [binaries/windows/x86_64](../binaries/windows/x86_64)
24 | - On Linux x86_64: [binaries/linux/x86_64](../binaries/linux/x86_64)
25 | - On Raspbian arm32 : [binaries/raspbian/armv7l](../binaries/raspbian/armv7l)
26 | - ... you got the idea
27 |
28 | From the the binaries folder (`ultimateMRZ-SDK/binaries/<>/<>`), call the [setup.py](setup.py) script:
29 | ```
30 | python ../../../python/setup.py build_ext --inplace -v
31 | ```
32 | If you have multiple python versions installed, then you may use a virtual env, a full path to the executable... Also, you may use `python3` instead of `python` to make sure you're using version 3. The python version used to build the extension should be the same to use in order to run the samples.
33 |
34 | This will build and install the extension in the current folder. The extension is named **_ultimateMrzSdk.pyd** on Windows and **_ultimateMrzSdk.so** on Linux.
35 |
36 | Now you're ready to run Python scripts using the extension. We highly recommend checking the recognizer sample: [ultimateMRZ-SDK/samples/python/recognizer](../samples/python/recognizer)
37 |
38 | # Know issues #
39 | If you get `TypeError: super() takes at least 1 argument (0 given)` error message, then make sure you're using Python 3. We tested the code on version **3.6.9** (Windows 8), **3.6.8** (Ubuntu 18) and **3.7.3** (Raspbian Buster). Run `python --version` to print your Python version. You may use `python3` instead of `python` to make sure you're using version 3.
40 |
--------------------------------------------------------------------------------
/python/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | """
4 | pyton_setup.py file for SWIG ultimateMrzSdk
5 | You must run this file from 'binaries/os/arch' (e.g. 'binaries/windows/x86_64') folder.
6 | """
7 |
8 | from distutils.core import setup, Extension
9 | from distutils import sysconfig
10 | from Cython.Distutils import build_ext
11 | from sys import platform
12 | import os
13 |
14 | # Shared library name
15 | print("Your platform: %s" % platform)
16 | LIBNAME = 'ultimate_mrz-sdk'
17 | if platform.startswith('win'):
18 | LIBNAME = 'ultimateMRZ-SDK'
19 |
20 | # Do not add suffix (e.g. 'cp36-win_amd64')
21 | class NoSuffixBuilder(build_ext):
22 | def get_ext_filename(self, ext_name):
23 | filename = super().get_ext_filename(ext_name)
24 | suffix = sysconfig.get_config_var('EXT_SUFFIX')
25 | ext = os.path.splitext(filename)[1]
26 | return filename.replace(suffix, "") + ext
27 |
28 | ultimateMrzSdk_module = Extension('_ultimateMrzSdk',
29 | sources=[os.path.abspath('../../../python/ultimateMRZ-SDK-API-PUBLIC-SWIG_python.cxx')],
30 | include_dirs=['../../../c++'],
31 | language='c++11',
32 | library_dirs=['.'],
33 | libraries=[LIBNAME]
34 | )
35 |
36 | setup (name = 'ultimateMrzSdk',
37 | version = '2.4',
38 | author = "Doubango AI",
39 | description = """ultimateMrzSdk for python""",
40 | ext_modules = [ultimateMrzSdk_module],
41 | py_modules = ["ultimateMrzSdk"],
42 | cmdclass={"build_ext": NoSuffixBuilder},
43 | )
--------------------------------------------------------------------------------
/ruby/ruby.i:
--------------------------------------------------------------------------------
1 | /* File : ruby.i */
2 |
3 | /* http://www.swig.org/Doc1.3/Library.html#Library_carrays
4 | * 8.3.2 Passing binary data */
5 | %apply (char *STRING, int LENGTH) { (const void* buffer, int len) };
6 |
7 | %include ../swig.i
8 |
--------------------------------------------------------------------------------
/samples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0)
2 |
3 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/c++)
--------------------------------------------------------------------------------
/samples/README.md:
--------------------------------------------------------------------------------
1 | - [android](android) folder contains GUI applications for Android 5.0+ (Java)
2 | - [c++](c++) folder contains command-line sample applications for Windows, Raspberry Pi and Linux. These samples can also be used for Android or iOS but we recommend using the one in [android](android) and [iOS](iOS) folders.
3 | - [csharp](csharp) folder contains command-line Visual Studio sample applications configured for Win64 but work on any platform supporting C-Sharp
4 | - [iOS](iOS) folder contains GUI applications for iOS 8.0+
5 | - [java](java) folder contains command-line sample applications for all supported platforms
6 | - [python](python) folder contains command-line sample applications for all supported platforms
7 |
8 |
--------------------------------------------------------------------------------
/samples/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/samples/android/.idea/.name:
--------------------------------------------------------------------------------
1 | ultimateMrz
--------------------------------------------------------------------------------
/samples/android/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/samples/android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
15 |
16 |
--------------------------------------------------------------------------------
/samples/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |