diff --git a/AssetBundles/Android/Android b/AssetBundles/Android/Android new file mode 100644 index 0000000..89482b8 Binary files /dev/null and b/AssetBundles/Android/Android differ diff --git a/AssetBundles/Android/Android.manifest b/AssetBundles/Android/Android.manifest new file mode 100644 index 0000000..1d68946 --- /dev/null +++ b/AssetBundles/Android/Android.manifest @@ -0,0 +1,31 @@ +ManifestFileVersion: 0 +CRC: 256577813 +AssetBundleManifest: + AssetBundleInfos: + Info_0: + Name: ui_homepage.ab + Dependencies: + Dependency_0: ui_common.ab + Info_1: + Name: common.ab + Dependencies: {} + Info_2: + Name: language.ab + Dependencies: {} + Info_3: + Name: ui_common.ab + Dependencies: + Dependency_0: ui_loginpage.ab + Info_4: + Name: ui_loginpage.ab + Dependencies: + Dependency_0: ui_common.ab + Info_5: + Name: ui_safetylearningpage.ab + Dependencies: + Dependency_0: ui_common.ab + Info_6: + Name: ui_connectdevicepage.ab + Dependencies: + Dependency_0: common.ab + Dependency_1: ui_common.ab diff --git a/AssetBundles/Android/common.ab b/AssetBundles/Android/common.ab index e2ab3b0..8a4abd0 100644 Binary files a/AssetBundles/Android/common.ab and b/AssetBundles/Android/common.ab differ diff --git a/AssetBundles/Android/common.ab.manifest b/AssetBundles/Android/common.ab.manifest index 08cc253..7d05c97 100644 --- a/AssetBundles/Android/common.ab.manifest +++ b/AssetBundles/Android/common.ab.manifest @@ -1,66 +1,21 @@ ManifestFileVersion: 0 -CRC: 233218370 +CRC: 374579679 Hashes: AssetFileHash: serializedVersion: 2 - Hash: c80e189aa6f9c8d7ee6bc50f7300305d + Hash: 23b30b8b7538d15e7e1f5c745bb57c50 TypeTreeHash: serializedVersion: 2 - Hash: be157f972cb3f854d77a3240d64a7387 + Hash: 958b54fb77cc0a35b3bf79f07d0e96ea IncrementalBuildHash: serializedVersion: 2 - Hash: c80e189aa6f9c8d7ee6bc50f7300305d + Hash: 23b30b8b7538d15e7e1f5c745bb57c50 HashAppended: 0 ClassTypes: -- Class: 21 - Script: {instanceID: 0} -- Class: 28 - Script: {instanceID: 0} -- Class: 48 - Script: {instanceID: 0} - Class: 74 Script: {instanceID: 0} -- Class: 114 - Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} -- Class: 115 - Script: {instanceID: 0} -- Class: 128 - Script: {instanceID: 0} -SerializeReferenceClassIdentifiers: -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.FaceInfo_Legacy -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.FontAssetCreationSettings -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.KerningTable -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_Character -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_FontFeatureTable -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_FontWeightPair -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_GlyphAdjustmentRecord -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_GlyphPairAdjustmentRecord -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.TMP_GlyphValueRecord -- AssemblyName: UnityEngine.TextCoreFontEngineModule - ClassName: UnityEngine.TextCore.FaceInfo -- AssemblyName: UnityEngine.TextCoreFontEngineModule - ClassName: UnityEngine.TextCore.Glyph -- AssemblyName: UnityEngine.TextCoreFontEngineModule - ClassName: UnityEngine.TextCore.GlyphMetrics -- AssemblyName: UnityEngine.TextCoreFontEngineModule - ClassName: UnityEngine.TextCore.GlyphRect +SerializeReferenceClassIdentifiers: [] Assets: -- Assets/Res/common/LiberationSans SDF - Drop Shadow.mat -- Assets/Res/common/TMP_SDF-Mobile.shader -- Assets/Res/common/LiberationSans SDF - Fallback.asset -- Assets/Res/common/LiberationSans SDF - Outline.mat +- Assets/Res/common/loadingNew.anim - Assets/Res/common/loading.anim -- Assets/Res/common/MiSans-Medium.ttf -- Assets/Res/common/MiSans-Medium SDF.asset -- Assets/Res/common/LiberationSans SDF.asset -- Assets/Res/common/LiberationSans.ttf Dependencies: [] diff --git a/AssetBundles/Android/google-services-desktop.json b/AssetBundles/Android/google-services-desktop.json deleted file mode 100644 index 28770f6..0000000 --- a/AssetBundles/Android/google-services-desktop.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "project_info": { - "project_number": "785438724947", - "project_id": "photonmatrix-ac0b5", - "storage_bucket": "photonmatrix-ac0b5.firebasestorage.app" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:785438724947:android:352ede76bb25311f51c7a6", - "android_client_info": { - "package_name": "com.photonmatrix.photonmatrix" - } - }, - "oauth_client": [ - { - "client_id": "785438724947-kpjbqi43hbj6eddianbjsgkgkkclkfmd.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyAntcCsZGurbXg7TFbPMPx5aek6HDYYVxk" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "785438724947-kpjbqi43hbj6eddianbjsgkgkkclkfmd.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "785438724947-r578u4au09ebieu0pnahj8ef08s1uhqp.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.photonmatrix.photonmatrix" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/AssetBundles/Android/google-services-desktop.json.meta b/AssetBundles/Android/google-services-desktop.json.meta deleted file mode 100644 index 67700b6..0000000 --- a/AssetBundles/Android/google-services-desktop.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c24a7550296d5d54d91f866dd40936db -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/language.ab b/AssetBundles/Android/language.ab index 053d55c..fa2290c 100644 Binary files a/AssetBundles/Android/language.ab and b/AssetBundles/Android/language.ab differ diff --git a/AssetBundles/Android/language.ab.manifest b/AssetBundles/Android/language.ab.manifest index 5948615..1958aba 100644 --- a/AssetBundles/Android/language.ab.manifest +++ b/AssetBundles/Android/language.ab.manifest @@ -1,15 +1,15 @@ ManifestFileVersion: 0 -CRC: 749593259 +CRC: 142284609 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 81a8de0bb4c5928c43220b249b335c6b + Hash: 98e62aa9d1a917725e16d689a36329b2 TypeTreeHash: serializedVersion: 2 Hash: 5ad585dd02dfb5016c0dad519eab8f49 IncrementalBuildHash: serializedVersion: 2 - Hash: 81a8de0bb4c5928c43220b249b335c6b + Hash: 98e62aa9d1a917725e16d689a36329b2 HashAppended: 0 ClassTypes: - Class: 49 diff --git a/AssetBundles/Android/list.json b/AssetBundles/Android/list.json deleted file mode 100644 index 74d5909..0000000 --- a/AssetBundles/Android/list.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "version": "1.0.1", - "assetbundles": [ - { - "name": "common.ab", - "size": 12854223, - "md5": "c2fa51b131e3d8a65d4134c8670ee99b" - }, - { - "name": "language.ab", - "size": 2226, - "md5": "6e10d9c8c23778a25684dd8d69350510" - }, - { - "name": "ui_common.ab", - "size": 12606, - "md5": "1dfaf11957a90b775e0be5f6fe37452b" - }, - { - "name": "ui_homepage.ab", - "size": 9787, - "md5": "4c4595943f5c31673338e2ca83147ee8" - }, - { - "name": "ui_loginpage.ab", - "size": 241923, - "md5": "520989d12bfdae3368c3fd88f8381d3e" - }, - { - "name": "common.ab.manifest", - "size": 2173, - "md5": "7f35fb8fc14986f31d17c6483a90b4f3" - }, - { - "name": "language.ab.manifest", - "size": 473, - "md5": "335cc7d7481861141ee8e6fff52f3976" - }, - { - "name": "ui_common.ab.manifest", - "size": 2905, - "md5": "a05683fbffe6068095d6b7ef877f0ef4" - }, - { - "name": "ui_homepage.ab.manifest", - "size": 2419, - "md5": "c3971548d08125ef72bade017cebabdc" - }, - { - "name": "ui_loginpage.ab.manifest", - "size": 4757, - "md5": "99941302876547c4759f674f80fee5db" - } - ] -} \ No newline at end of file diff --git a/AssetBundles/Android/ui_common.ab b/AssetBundles/Android/ui_common.ab index 42c7ace..57f2c64 100644 Binary files a/AssetBundles/Android/ui_common.ab and b/AssetBundles/Android/ui_common.ab differ diff --git a/AssetBundles/Android/ui_common.ab.manifest b/AssetBundles/Android/ui_common.ab.manifest index 6935178..efafa67 100644 --- a/AssetBundles/Android/ui_common.ab.manifest +++ b/AssetBundles/Android/ui_common.ab.manifest @@ -1,15 +1,15 @@ ManifestFileVersion: 0 -CRC: 714414049 +CRC: 2161279840 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 1153a9a71c2079962f868c3866d681ad + Hash: 4ea1223b61d0b2425614da34c0e9dd5c TypeTreeHash: serializedVersion: 2 - Hash: 24e7573d98028b3cc7bcae0654eab5fa + Hash: 3d0aa9280e2017137102b2dcf180d097 IncrementalBuildHash: serializedVersion: 2 - Hash: 1153a9a71c2079962f868c3866d681ad + Hash: 4ea1223b61d0b2425614da34c0e9dd5c HashAppended: 0 ClassTypes: - Class: 1 @@ -21,15 +21,15 @@ ClassTypes: - Class: 48 Script: {instanceID: 0} - Class: 114 - Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + Script: {fileID: 11500000, guid: 767fbd85f067c1a4da213c13282cc05e, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} - Class: 114 Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} -- Class: 114 - Script: {fileID: 11500000, guid: 767fbd85f067c1a4da213c13282cc05e, type: 3} - Class: 114 Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} - Class: 114 @@ -49,12 +49,38 @@ ClassTypes: - Class: 224 Script: {instanceID: 0} SerializeReferenceClassIdentifiers: +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.FaceInfo_Legacy +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.FontAssetCreationSettings +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.KerningTable +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_Character +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_FontFeatureTable +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_FontWeightPair +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_GlyphAdjustmentRecord +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_GlyphPairAdjustmentRecord +- AssemblyName: Unity.TextMeshPro + ClassName: TMPro.TMP_GlyphValueRecord - AssemblyName: Unity.TextMeshPro ClassName: TMPro.VertexGradient - AssemblyName: UnityEngine.CoreModule ClassName: UnityEngine.Events.PersistentCallGroup - AssemblyName: UnityEngine.CoreModule ClassName: UnityEngine.RectOffset +- AssemblyName: UnityEngine.TextCoreFontEngineModule + ClassName: UnityEngine.TextCore.FaceInfo +- AssemblyName: UnityEngine.TextCoreFontEngineModule + ClassName: UnityEngine.TextCore.Glyph +- AssemblyName: UnityEngine.TextCoreFontEngineModule + ClassName: UnityEngine.TextCore.GlyphMetrics +- AssemblyName: UnityEngine.TextCoreFontEngineModule + ClassName: UnityEngine.TextCore.GlyphRect - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.AnimationTriggers - AssemblyName: UnityEngine.UI @@ -76,10 +102,24 @@ SerializeReferenceClassIdentifiers: - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.SpriteState Assets: -- "Assets/Res/ui/common/\u9009\u53D6\u5934\u50CF.prefab" -- "Assets/Res/ui/common/\u8FD4\u56DE.png" -- "Assets/Res/ui/common/\u9009\u62E9\u6846.png" - "Assets/Res/ui/common/\u9A8C\u8BC1\u7801\u7EC4\u4EF6.prefab" +- Assets/Res/ui/common/Rectangle 132 (2).png +- "Assets/Res/ui/common/\u5C0F\u6309\u94AE.png" +- "Assets/Res/ui/common/Check-small (\u6821\u9A8C-\u5C0F).png" +- "Assets/Res/ui/common/\u9009\u53D6\u5934\u50CF.prefab" +- "Assets/Res/ui/common/\u6307\u7EB9.png" +- "Assets/Res/ui/common/\u8FD4\u56DE.png" +- "Assets/Res/ui/common/Right (\u53F3) (1).png" +- Assets/Res/ui/common/Loading.png +- "Assets/Res/ui/common/\u89C6\u9891.png" +- "Assets/Res/ui/common/\u9009\u62E9\u6846.png" +- "Assets/Res/ui/common/\u58F0\u97F3.png" +- "Assets/Res/ui/common/\u8BBE\u5907\u540D\u6B21.png" +- Assets/Res/ui/common/Rectangle 148 (1).png +- "Assets/Res/ui/common/\u5BC6\u7801 - \u5C55\u793A.png" +- Assets/Res/ui/common/Rectangle 148.png +- "Assets/Res/ui/common/Close (\u5173\u95ED).png" +- Assets/Res/ui/common/Ellipse 32.png +- "Assets/Res/ui/common/\u5B9A\u65F6.png" Dependencies: -- D:/unity_project/Kill/AssetBundles/Android/common.ab - D:/unity_project/Kill/AssetBundles/Android/ui_loginpage.ab diff --git a/AssetBundles/Android/ui_common.ab.manifest.meta b/AssetBundles/Android/ui_common.ab.manifest.meta deleted file mode 100644 index a42880d..0000000 --- a/AssetBundles/Android/ui_common.ab.manifest.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 411ccbd3ce3893b4cb7c2f82531993fe -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_common.ab.meta b/AssetBundles/Android/ui_common.ab.meta deleted file mode 100644 index 64463e7..0000000 --- a/AssetBundles/Android/ui_common.ab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6692d8124d25ece40acb1da49bb1bf7e -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_connectdevicepage.ab b/AssetBundles/Android/ui_connectdevicepage.ab new file mode 100644 index 0000000..5b90f8d Binary files /dev/null and b/AssetBundles/Android/ui_connectdevicepage.ab differ diff --git a/AssetBundles/Android/ui_connectdevicepage.ab.manifest b/AssetBundles/Android/ui_connectdevicepage.ab.manifest new file mode 100644 index 0000000..7e93cf6 --- /dev/null +++ b/AssetBundles/Android/ui_connectdevicepage.ab.manifest @@ -0,0 +1,106 @@ +ManifestFileVersion: 0 +CRC: 1954010819 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: c0f0a227dcda8c2fa20631441d246eaa + TypeTreeHash: + serializedVersion: 2 + Hash: f416264907a65aa92adeeb00bf60fec2 + IncrementalBuildHash: + serializedVersion: 2 + Hash: c0f0a227dcda8c2fa20631441d246eaa +HashAppended: 0 +ClassTypes: +- Class: 1 + Script: {instanceID: 0} +- Class: 21 + Script: {instanceID: 0} +- Class: 28 + Script: {instanceID: 0} +- Class: 48 + Script: {instanceID: 0} +- Class: 74 + Script: {instanceID: 0} +- Class: 111 + Script: {instanceID: 0} +- Class: 114 + Script: {fileID: 11500000, guid: 2f6d707cba0376a43bc6d9f0a27ea376, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: cc4db0165ab541a44978ccde28b3bc29, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 89f1d49b50a31514787b4e268b1c73bb, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} +- Class: 115 + Script: {instanceID: 0} +- Class: 128 + Script: {instanceID: 0} +- Class: 213 + Script: {instanceID: 0} +- Class: 222 + Script: {instanceID: 0} +- Class: 224 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.ArgumentCache +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.PersistentCallGroup +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.PersistentListenerMode +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.RectOffset +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.AnimationTriggers +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Button/ButtonClickedEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.ColorBlock +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.FontData +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.InputField/EndEditEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.InputField/OnChangeEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.InputField/SubmitEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.MaskableGraphic/CullStateChangedEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Navigation +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.ScrollRect/ScrollRectEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.SpriteState +Assets: +- Assets/Res/ui/connectdevicepage/Frame 19.png +- Assets/Res/ui/connectdevicepage/icon.png +- Assets/Res/ui/connectdevicepage/Rectangle 132 (3).png +- Assets/Res/ui/connectdevicepage/Frame 20.png +- "Assets/Res/ui/connectdevicepage/\u786E\u8BA4.png" +- Assets/Res/ui/connectdevicepage/connectDevicePage.prefab +- Assets/Res/ui/connectdevicepage/Rectangle 136.png +- "Assets/Res/ui/connectdevicepage/\u626B\u63CF.png" +- Assets/Res/ui/connectdevicepage/Vector.png +Dependencies: +- D:/unity_project/Kill/AssetBundles/Android/common.ab +- D:/unity_project/Kill/AssetBundles/Android/ui_common.ab diff --git a/AssetBundles/Android/ui_homepage.ab b/AssetBundles/Android/ui_homepage.ab index 0970197..ab9c14a 100644 Binary files a/AssetBundles/Android/ui_homepage.ab and b/AssetBundles/Android/ui_homepage.ab differ diff --git a/AssetBundles/Android/ui_homepage.ab.manifest b/AssetBundles/Android/ui_homepage.ab.manifest index bd0f009..81d24ff 100644 --- a/AssetBundles/Android/ui_homepage.ab.manifest +++ b/AssetBundles/Android/ui_homepage.ab.manifest @@ -1,15 +1,15 @@ ManifestFileVersion: 0 -CRC: 3121207904 +CRC: 2873620311 Hashes: AssetFileHash: serializedVersion: 2 - Hash: c751eb049ed9e8f8eb1a7678ce2327e6 + Hash: a5e8163239fbf5550ab3beedb10929b1 TypeTreeHash: serializedVersion: 2 - Hash: 2da964eb972714674342a2708c4b8066 + Hash: 252cf1d368eeed7b0aa25c6e638ef9a7 IncrementalBuildHash: serializedVersion: 2 - Hash: c751eb049ed9e8f8eb1a7678ce2327e6 + Hash: a5e8163239fbf5550ab3beedb10929b1 HashAppended: 0 ClassTypes: - Class: 1 @@ -24,14 +24,10 @@ ClassTypes: Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - Class: 114 Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} -- Class: 114 - Script: {fileID: 11500000, guid: d199490a83bb2b844b9695cbf13b01ef, type: 3} -- Class: 114 - Script: {fileID: 11500000, guid: 71c1514a6bd24e1e882cebbe1904ce04, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - Class: 114 - Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + Script: {fileID: 11500000, guid: 89f1d49b50a31514787b4e268b1c73bb, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 7fdaf0aeaf14a6d4c9beb4770e903acf, type: 3} - Class: 115 @@ -45,10 +41,12 @@ ClassTypes: - Class: 224 Script: {instanceID: 0} SerializeReferenceClassIdentifiers: -- AssemblyName: Unity.TextMeshPro - ClassName: TMPro.VertexGradient +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.ArgumentCache - AssemblyName: UnityEngine.CoreModule ClassName: UnityEngine.Events.PersistentCallGroup +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.PersistentListenerMode - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.AnimationTriggers - AssemblyName: UnityEngine.UI @@ -57,12 +55,6 @@ SerializeReferenceClassIdentifiers: ClassName: UnityEngine.UI.ColorBlock - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.FontData -- AssemblyName: UnityEngine.UI - ClassName: UnityEngine.UI.InputField/EndEditEvent -- AssemblyName: UnityEngine.UI - ClassName: UnityEngine.UI.InputField/OnChangeEvent -- AssemblyName: UnityEngine.UI - ClassName: UnityEngine.UI.InputField/SubmitEvent - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.MaskableGraphic/CullStateChangedEvent - AssemblyName: UnityEngine.UI @@ -70,6 +62,9 @@ SerializeReferenceClassIdentifiers: - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.SpriteState Assets: +- "Assets/Res/ui/homepage/\u65E0\u8BBE\u5907.png" - Assets/Res/ui/homepage/homePage.prefab +- "Assets/Res/ui/homepage/\u4E2A\u4EBA\u4E2D\u5FC3.png" +- "Assets/Res/ui/homepage/\u6D88\u606F.png" Dependencies: -- D:/unity_project/Kill/AssetBundles/Android/common.ab +- D:/unity_project/Kill/AssetBundles/Android/ui_common.ab diff --git a/AssetBundles/Android/ui_homepage.ab.manifest.meta b/AssetBundles/Android/ui_homepage.ab.manifest.meta deleted file mode 100644 index effca9f..0000000 --- a/AssetBundles/Android/ui_homepage.ab.manifest.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 427bee84e8448674196ec081992050a0 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_homepage.ab.meta b/AssetBundles/Android/ui_homepage.ab.meta deleted file mode 100644 index b4463c5..0000000 --- a/AssetBundles/Android/ui_homepage.ab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6012662144bcee14e9f85185bd36b2c1 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_loginpage.ab b/AssetBundles/Android/ui_loginpage.ab index 8a25ca6..37d653b 100644 Binary files a/AssetBundles/Android/ui_loginpage.ab and b/AssetBundles/Android/ui_loginpage.ab differ diff --git a/AssetBundles/Android/ui_loginpage.ab.manifest b/AssetBundles/Android/ui_loginpage.ab.manifest index f202b4f..57f4b25 100644 --- a/AssetBundles/Android/ui_loginpage.ab.manifest +++ b/AssetBundles/Android/ui_loginpage.ab.manifest @@ -1,15 +1,15 @@ ManifestFileVersion: 0 -CRC: 4028950989 +CRC: 1506138910 Hashes: AssetFileHash: serializedVersion: 2 - Hash: 59dce4d2a0ce9e0ae41212946c77f075 + Hash: 111b08c284632c8965632707d85adb47 TypeTreeHash: serializedVersion: 2 - Hash: 70589c2c13c216b3c5fa3022c1dc899e + Hash: 481727e0eda7646426efebfcf2086aca IncrementalBuildHash: serializedVersion: 2 - Hash: 59dce4d2a0ce9e0ae41212946c77f075 + Hash: 111b08c284632c8965632707d85adb47 HashAppended: 0 ClassTypes: - Class: 1 @@ -21,9 +21,13 @@ ClassTypes: - Class: 48 Script: {instanceID: 0} - Class: 114 - Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + Script: {fileID: 11500000, guid: 1a5913bec98c8024087f4dbe7b40ab1c, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} - Class: 114 Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - Class: 114 @@ -36,8 +40,6 @@ ClassTypes: Script: {fileID: 11500000, guid: 271b50f7241504b49a6a7493d13721e7, type: 3} - Class: 114 Script: {fileID: 11500000, guid: f53257c6334f5224a8c3d192d5653d1c, type: 3} -- Class: 114 - Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} - Class: 114 @@ -50,8 +52,6 @@ ClassTypes: Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 89f1d49b50a31514787b4e268b1c73bb, type: 3} -- Class: 114 - Script: {fileID: 11500000, guid: 1a5913bec98c8024087f4dbe7b40ab1c, type: 3} - Class: 114 Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} - Class: 114 @@ -104,23 +104,17 @@ SerializeReferenceClassIdentifiers: - AssemblyName: UnityEngine.UI ClassName: UnityEngine.UI.Toggle/ToggleEvent Assets: -- "Assets/Res/ui/loginPage/\u5BC6\u7801 (1) 1.png" -- Assets/Res/ui/loginPage/Rectangle 135.png -- Assets/Res/ui/loginPage/Frame 2 (1).png -- Assets/Res/ui/loginPage/Rectangle 132 (1).png -- "Assets/Res/ui/loginPage/\u9009\u62E9\u6846.png" -- "Assets/Res/ui/loginPage/Check-small (\u6821\u9A8C-\u5C0F).png" -- Assets/Res/ui/loginPage/Group 144.png -- "Assets/Res/ui/loginPage/\u90AE\u7BB1-F 1.png" -- Assets/Res/ui/loginPage/Group 143.png -- "Assets/Res/ui/loginPage/\u9690\u79C1\u534F\u8BAE\u6846.png" -- Assets/Res/ui/loginPage/Rectangle 148 (1).png -- Assets/Res/ui/loginPage/Rectangle 132.png -- Assets/Res/ui/loginPage/Rectangle 148.png -- Assets/Res/ui/loginPage/loginPage.prefab -- "Assets/Res/ui/loginPage/Close (\u5173\u95ED).png" -- Assets/Res/ui/loginPage/bg.png -- Assets/Res/ui/loginPage/Ellipse 32.png -- Assets/Res/ui/loginPage/Rectangle 67.png +- "Assets/Res/ui/loginpage/\u5BC6\u7801 (1) 1.png" +- Assets/Res/ui/loginpage/Rectangle 135.png +- Assets/Res/ui/loginpage/Frame 2 (1).png +- Assets/Res/ui/loginpage/Rectangle 132 (1).png +- Assets/Res/ui/loginpage/Group 144.png +- "Assets/Res/ui/loginpage/\u90AE\u7BB1-F 1.png" +- Assets/Res/ui/loginpage/Group 143.png +- "Assets/Res/ui/loginpage/\u9690\u79C1\u534F\u8BAE\u6846.png" +- Assets/Res/ui/loginpage/Rectangle 132.png +- Assets/Res/ui/loginpage/loginPage.prefab +- Assets/Res/ui/loginpage/bg.png +- Assets/Res/ui/loginpage/Rectangle 67.png Dependencies: - D:/unity_project/Kill/AssetBundles/Android/ui_common.ab diff --git a/AssetBundles/Android/ui_loginpage.ab.manifest.meta b/AssetBundles/Android/ui_loginpage.ab.manifest.meta deleted file mode 100644 index 5643b2f..0000000 --- a/AssetBundles/Android/ui_loginpage.ab.manifest.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8d67207d165a11a41abac6e85483b748 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_loginpage.ab.meta b/AssetBundles/Android/ui_loginpage.ab.meta deleted file mode 100644 index 6608e5c..0000000 --- a/AssetBundles/Android/ui_loginpage.ab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 65d66671e6ec89c46a4bd059254702a0 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/AssetBundles/Android/ui_safetylearningpage.ab b/AssetBundles/Android/ui_safetylearningpage.ab new file mode 100644 index 0000000..4d9daab Binary files /dev/null and b/AssetBundles/Android/ui_safetylearningpage.ab differ diff --git a/AssetBundles/Android/ui_safetylearningpage.ab.manifest b/AssetBundles/Android/ui_safetylearningpage.ab.manifest new file mode 100644 index 0000000..75eee85 --- /dev/null +++ b/AssetBundles/Android/ui_safetylearningpage.ab.manifest @@ -0,0 +1,131 @@ +ManifestFileVersion: 0 +CRC: 3023159928 +Hashes: + AssetFileHash: + serializedVersion: 2 + Hash: e7d4b9173c45ea64a3cc42487ba61dea + TypeTreeHash: + serializedVersion: 2 + Hash: b6d37feeab1eec1182d85292d55ae196 + IncrementalBuildHash: + serializedVersion: 2 + Hash: e7d4b9173c45ea64a3cc42487ba61dea +HashAppended: 0 +ClassTypes: +- Class: 1 + Script: {instanceID: 0} +- Class: 21 + Script: {instanceID: 0} +- Class: 28 + Script: {instanceID: 0} +- Class: 48 + Script: {instanceID: 0} +- Class: 114 + Script: {fileID: 11500000, guid: e982ad7d1eca06640864d29509a997f8, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 15f5bd88ea349c4488f6e34e51cecd59, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 271b50f7241504b49a6a7493d13721e7, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 6153f65e187d768439e5be590953dfb1, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 89f1d49b50a31514787b4e268b1c73bb, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 7b6c36ccd2295994fa13a1cc24de7db4, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 89cec4ea05849a04981cec13b33447ea, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: d0b148fe25e99eb48b9724523833bab1, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: fa3a4570827eff04fb79b0bdd622e953, type: 3} +- Class: 114 + Script: {fileID: 11500000, guid: 50d2a45eec2b4a34e9aa449adf569f10, type: 3} +- Class: 115 + Script: {instanceID: 0} +- Class: 128 + Script: {instanceID: 0} +- Class: 213 + Script: {instanceID: 0} +- Class: 222 + Script: {instanceID: 0} +- Class: 224 + Script: {instanceID: 0} +- Class: 328 + Script: {instanceID: 0} +SerializeReferenceClassIdentifiers: +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.ArgumentCache +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.PersistentCallGroup +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.Events.PersistentListenerMode +- AssemblyName: UnityEngine.CoreModule + ClassName: UnityEngine.RectOffset +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.EventSystems.EventTrigger/Entry +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.EventSystems.EventTrigger/TriggerEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.AnimationTriggers +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Button/ButtonClickedEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.ColorBlock +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.FontData +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.MaskableGraphic/CullStateChangedEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Navigation +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.ScrollRect/ScrollRectEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Scrollbar/ScrollEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.Slider/SliderEvent +- AssemblyName: UnityEngine.UI + ClassName: UnityEngine.UI.SpriteState +Assets: +- "Assets/Res/ui/safetylearningpage/\u666E\u901A\u80CC\u666F.png" +- Assets/Res/ui/safetylearningpage/Group 152.png +- "Assets/Res/ui/safetylearningpage/\u9519\u8BEFicon.png" +- "Assets/Res/ui/safetylearningpage/\u5168\u5C4F\u6846.png" +- "Assets/Res/ui/safetylearningpage/\u64AD\u653E.png" +- "Assets/Res/ui/safetylearningpage/\u9009\u4E2D.png" +- Assets/Res/ui/safetylearningpage/Ellipse 29.png +- "Assets/Res/ui/safetylearningpage/\u6B63\u786E\u80CC\u666F.png" +- "Assets/Res/ui/safetylearningpage/\u89E3\u6790.prefab" +- Assets/Res/ui/safetylearningpage/Rectangle 165.png +- "Assets/Res/ui/safetylearningpage/\u95EE\u9898.prefab" +- "Assets/Res/ui/safetylearningpage/\u5168\u5C4F\u56FE\u6807.png" +- Assets/Res/ui/safetylearningpage/Group 146.png +- "Assets/Res/ui/safetylearningpage/\u64AD\u653E\u5668\u80CC\u666F.png" +- "Assets/Res/ui/safetylearningpage/\u9898\u76EE.prefab" +- "Assets/Res/ui/safetylearningpage/\u9519\u8BEF\u80CC\u666F.png" +- "Assets/Res/ui/safetylearningpage/\u6B63\u786Eicon.png" +- Assets/Res/ui/safetylearningpage/Rectangle 119.png +- Assets/Res/ui/safetylearningpage/safetylearningPage.prefab +Dependencies: +- D:/unity_project/Kill/AssetBundles/Android/ui_common.ab diff --git a/Assets/Editor/iOSPermissionPostProcessor.cs b/Assets/Editor/iOSPermissionPostProcessor.cs new file mode 100644 index 0000000..c974e8a --- /dev/null +++ b/Assets/Editor/iOSPermissionPostProcessor.cs @@ -0,0 +1,26 @@ +#if UNITY_IOS +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.iOS.Xcode; +using System.IO; + +public class iOSPermissionPostProcessor +{ + [PostProcessBuild] + public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject) + { + if (target != BuildTarget.iOS) return; + + string plistPath = Path.Combine(pathToBuiltProject, "Info.plist"); + PlistDocument plist = new PlistDocument(); + plist.ReadFromString(File.ReadAllText(plistPath)); + + PlistElementDict rootDict = plist.root; + + // 添加摄像头权限描述 + rootDict.SetString("NSCameraUsageDescription", "需要摄像头权限来扫描二维码连接设备"); + + File.WriteAllText(plistPath, plist.WriteToString()); + } +} +#endif diff --git a/Assets/Editor/iOSPermissionPostProcessor.cs.meta b/Assets/Editor/iOSPermissionPostProcessor.cs.meta new file mode 100644 index 0000000..ba83f6f --- /dev/null +++ b/Assets/Editor/iOSPermissionPostProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1f4f56027df03044a3449ef64ca037e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor/iOSWiFiBuildPostProcessor.cs b/Assets/Editor/iOSWiFiBuildPostProcessor.cs new file mode 100644 index 0000000..8f8463a --- /dev/null +++ b/Assets/Editor/iOSWiFiBuildPostProcessor.cs @@ -0,0 +1,45 @@ +#if UNITY_IOS +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.iOS.Xcode; +using System.IO; + +public class iOSWiFiBuildPostProcessor +{ + [PostProcessBuild] + public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject) + { + if (target != BuildTarget.iOS) return; + + string plistPath = Path.Combine(pathToBuiltProject, "Info.plist"); + PlistDocument plist = new PlistDocument(); + plist.ReadFromString(File.ReadAllText(plistPath)); + + PlistElementDict rootDict = plist.root; + + // 添加位置权限描述(iOS 获取 WiFi 需要) + rootDict.SetString("NSLocationWhenInUseUsageDescription", "需要位置权限来获取当前 WiFi 信息"); + + // 添加蓝牙权限描述 + rootDict.SetString("NSBluetoothAlwaysUsageDescription", "需要蓝牙权限来连接设备"); + rootDict.SetString("NSBluetoothPeripheralUsageDescription", "需要蓝牙权限来连接设备"); + + // 添加后台模式 + PlistElementArray bgModes = rootDict.CreateArray("UIBackgroundModes"); + bgModes.AddString("fetch"); + bgModes.AddString("bluetooth-central"); + + File.WriteAllText(plistPath, plist.WriteToString()); + + // 添加 CoreBluetooth.framework + string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject); + PBXProject proj = new PBXProject(); + proj.ReadFromString(File.ReadAllText(projPath)); + string targetGuid = proj.GetUnityMainTargetGuid(); + + proj.AddFrameworkToProject(targetGuid, "CoreBluetooth.framework", false); + + File.WriteAllText(projPath, proj.WriteToString()); + } +} +#endif diff --git a/Assets/Editor/iOSWiFiBuildPostProcessor.cs.meta b/Assets/Editor/iOSWiFiBuildPostProcessor.cs.meta new file mode 100644 index 0000000..275ac9c --- /dev/null +++ b/Assets/Editor/iOSWiFiBuildPostProcessor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee71c8bd300d72e438892bbfe5e78bd5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index ca5b02b..5ca2966 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -2,7 +2,23 @@ + + + + + + + + + + + + + + + + diff --git a/Assets/Plugins/BluetoothHardwareInterface.cs b/Assets/Plugins/BluetoothHardwareInterface.cs index 699b3fa..259c82f 100644 --- a/Assets/Plugins/BluetoothHardwareInterface.cs +++ b/Assets/Plugins/BluetoothHardwareInterface.cs @@ -316,7 +316,7 @@ public class BluetoothLEHardwareInterface if (!locationAsked) { Permission.RequestUserPermission("android.permission.ACCESS_FINE_LOCATION"); - locationAsked = false; + locationAsked = true; timerValue = 2; } } @@ -327,7 +327,7 @@ public class BluetoothLEHardwareInterface if (!connectAsked) { Permission.RequestUserPermission("android.permission.BLUETOOTH_CONNECT"); - connectAsked = false; + connectAsked = true; timerValue = 2; } } diff --git a/Assets/Plugins/iOS/BluetoothHelper.mm b/Assets/Plugins/iOS/BluetoothHelper.mm new file mode 100644 index 0000000..0a8b5cb --- /dev/null +++ b/Assets/Plugins/iOS/BluetoothHelper.mm @@ -0,0 +1,41 @@ +#import +#import + +// 全局 CBCentralManager 用于检查蓝牙状态 +static CBCentralManager *centralManager = nil; + +extern "C" { + // 获取蓝牙状态 + // 0 = Unknown, 1 = Resetting, 2 = Unsupported, 3 = Unauthorized, 4 = PoweredOff, 5 = PoweredOn + int GetBluetoothStateIOS() { + if (centralManager == nil) { + centralManager = [[CBCentralManager alloc] initWithDelegate:nil queue:nil options:@{CBCentralManagerOptionShowPowerAlertKey: @NO}]; + } + + switch (centralManager.state) { + case CBManagerStateUnknown: + return 0; + case CBManagerStateResetting: + return 1; + case CBManagerStateUnsupported: + return 2; + case CBManagerStateUnauthorized: + return 3; + case CBManagerStatePoweredOff: + return 4; + case CBManagerStatePoweredOn: + return 5; + default: + return 0; + } + } + + // 打开蓝牙设置页面 + void OpenBluetoothSettingsIOS() { + // iOS 10+ 使用 UIApplicationOpenSettingsURLString + NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; + if ([[UIApplication sharedApplication] canOpenURL:settingsURL]) { + [[UIApplication sharedApplication] openURL:settingsURL options:@{} completionHandler:nil]; + } + } +} diff --git a/Assets/Plugins/iOS/BluetoothHelper.mm.meta b/Assets/Plugins/iOS/BluetoothHelper.mm.meta new file mode 100644 index 0000000..84c18fa --- /dev/null +++ b/Assets/Plugins/iOS/BluetoothHelper.mm.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: b51f7ee4c32678a46a9b5a5441e0ab2f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/iOS/WiFiHelper.mm b/Assets/Plugins/iOS/WiFiHelper.mm new file mode 100644 index 0000000..99cc2bc --- /dev/null +++ b/Assets/Plugins/iOS/WiFiHelper.mm @@ -0,0 +1,29 @@ +#import +#import + +extern "C" { + const char* GetWiFiSSID() { + NSString *ssid = nil; + + NSArray *interfaces = (__bridge_transfer NSArray *)CNCopySupportedInterfaces(); + + for (NSString *interfaceName in interfaces) { + NSDictionary *info = (__bridge_transfer NSDictionary *)CNCopyCurrentNetworkInfo((__bridge CFStringRef)interfaceName); + + if (info && info[@"SSID"]) { + ssid = info[@"SSID"]; + break; + } + } + + if (ssid == nil) { + return NULL; + } + + const char *utf8String = [ssid UTF8String]; + char *result = (char *)malloc(strlen(utf8String) + 1); + strcpy(result, utf8String); + + return result; + } +} diff --git a/Assets/Plugins/iOS/WiFiHelper.mm.meta b/Assets/Plugins/iOS/WiFiHelper.mm.meta new file mode 100644 index 0000000..9a6d6ec --- /dev/null +++ b/Assets/Plugins/iOS/WiFiHelper.mm.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 68b45a04bd851304e81662754e08006f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/net2.0.meta b/Assets/Plugins/net2.0.meta new file mode 100644 index 0000000..566f188 --- /dev/null +++ b/Assets/Plugins/net2.0.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a788d68a8e802da41853b21948565145 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/net2.0/zxing.XML b/Assets/Plugins/net2.0/zxing.XML new file mode 100644 index 0000000..e9c4610 --- /dev/null +++ b/Assets/Plugins/net2.0/zxing.XML @@ -0,0 +1,14560 @@ + + + + zxing + + + + + Extends with more information specific to the Aztec format, + like the number of layers and whether it's compact. + + + + + Gets a value indicating whether this Aztec code is compact. + + + true if compact; otherwise, false. + + + + + Gets the nb datablocks. + + + + + Gets the nb layers. + + + + + Gets the number of corrected errors. + + + + + Initializes a new instance of the class. + + The bits. + The points. + if set to true [compact]. + The nb datablocks. + The nb layers. + + + + Initializes a new instance of the class. + + The bits. + The points. + if set to true [compact]. + The nb datablocks. + The nb layers. + + + + + The main class which implements Aztec Code decoding -- as opposed to locating and extracting + the Aztec Code from an image. + + David Olivier + + + + Decodes the specified detector result. + + The detector result. + + + + + This method is used for testing the high-level encoder + + + + + + + Gets the string encoded in the aztec code bits + + The corrected bits. + the decoded string + + + + gets the table corresponding to the char passed + + The t. + + + + + Gets the character (or string) corresponding to the passed code in the given table + + the table used + the code of the character + + + + + Performs RS error correction on an array of bits. + + The rawbits. + the corrected array + + + + Gets the array of bits from an Aztec Code matrix + + The matrix. + the array of bits + + + + Reads a code of given length and at given index in an array of bits + + The rawbits. + The start index. + The length. + + + + + Reads a code of length 8 in an array of bits, padding with zeros + + + + + + + + Packs a bit array into bytes, most significant bit first + + + + + + + Encapsulates logic that can detect an Aztec Code in an image, even if the Aztec Code + is rotated or skewed, or partially obscured. + + David Olivier + + + + Initializes a new instance of the class. + + The image. + + + + Detects an Aztec Code in an image. + + + + + Detects an Aztec Code in an image. + + if true, image is a mirror-image of original. + + encapsulating results of detecting an Aztec Code + + + + + Extracts the number of data layers and data blocks from the layer around the bull's eye + + bullEyeCornerPoints the array of bull's eye corners + the number of errors corrected during parameter extraction + + + + + Corrects the parameter bits using Reed-Solomon algorithm + + paremeter bits + compact true if this is a compact Aztec code + the corrected parameter + + + + Finds the corners of a bull-eye centered on the passed point + This returns the centers of the diagonal points just outside the bull's eye + Returns [topRight, bottomRight, bottomLeft, topLeft] + + Center point + The corners of the bull-eye + + + + Finds a candidate center point of an Aztec code from an image + + the center point + + + + Gets the Aztec code corners from the bull's eye corners and the parameters. + + the array of bull's eye corners + the array of aztec code corners + + + + Creates a BitMatrix by sampling the provided image. + topLeft, topRight, bottomRight, and bottomLeft are the centers of the squares on the + diagonal just outside the bull's eye. + + The image. + The top left. + The bottom left. + The bottom right. + The top right. + + + + + Samples a line + + start point (inclusive) + end point (exclusive) + number of bits + the array of bits as an int (first bit is high-order bit of result) + + + + Determines whether [is white or black rectangle] [the specified p1]. + + The p1. + The p2. + The p3. + The p4. + true if the border of the rectangle passed in parameter is compound of white points only + or black points only + + + + Gets the color of a segment + + The p1. + The p2. + 1 if segment more than 90% black, -1 if segment is more than 90% white, 0 else + + + + Gets the coordinate of the first point with a different color in the given direction + + The init. + if set to true [color]. + The dx. + The dy. + + + + + Expand the square represented by the corner points by pushing out equally in all directions + + the corners of the square, which has the bull's eye at its center + the original length of the side of the square in the target bit matrix + the new length of the size of the square in the target bit matrix + the corners of the expanded square + + + + Aztec 2D code representation + + Rustam Abdullaev + + + + Compact or full symbol indicator + + + + + Size in pixels (width and height) + + + + + Number of levels + + + + + Number of data codewords + + + + + The symbol image + + + + + represents a token for a binary shift + + + + + initializing constructor + + + + + + + + appends the byte array to the BitArray + + + + + + + string representation + + + + + + Generates Aztec 2D barcodes. + + Rustam Abdullaev + + + + default EC percent 33 + + + + + default layers 0 + + + + + Encodes the given string content as an Aztec symbol (without ECI code) + + input data string; must be encodable as ISO/IEC 8859-1 (Latin-1) + Aztec symbol matrix with metadata + + + + + input data string; must be encodable as ISO/IEC 8859-1 (Latin-1) + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + Aztec symbol matrix with metadata + + + + Encodes the given string content as an Aztec symbol + + input data string + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + character set in which to encode string using ECI; if null, no ECI code will be inserted, and the string must be encodable as ISO/IEC 8859-1 (Latin-1), the default encoding of the symbol. + Aztec symbol matrix with metadata + + + + Encodes the given string content as an Aztec symbol + + input data string + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + character set in which to encode string using ECI; if null, no ECI code will be inserted, and the string must be encodable as ISO/IEC 8859-1 (Latin-1), the default encoding of the symbol. + if true, dont't add ECI segment + Aztec symbol matrix with metadata + + + + Encodes the given binary content as an Aztec symbol (without ECI code) + + input data + Aztec symbol matrix with metadata + + + + Encodes the given binary content as an Aztec symbol (without ECI code) + + input data string + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + Aztec symbol matrix with metadata + + + + Encodes the given binary content as an Aztec symbol + + input data string + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + character set to mark using ECI; if null, no ECI code will be inserted, and the default encoding of ISO/IEC 8859-1 will be assuming by readers. + Aztec symbol matrix with metadata + + + + Encodes the given binary content as an Aztec symbol + + input data string + minimal percentage of error check words (According to ISO/IEC 24778:2008, a minimum of 23% + 3 words is recommended) + if non-zero, a user-specified value for the number of layers + character set to mark using ECI; if null, no ECI code will be inserted, and the default encoding of ISO/IEC 8859-1 will be assuming by readers. + if true, don't add ECI segment, regardless if encoding ist set + Aztec symbol matrix with metadata + + + + This produces nearly optimal encodings of text into the first-level of + encoding used by Aztec code. + It uses a dynamic algorithm. For each prefix of the string, it determines + a set of encodings that could lead to this prefix. We repeatedly add a + character and generate a new set of optimal encodings until we have read + through the entire input. + @author Frank Yellin + @author Rustam Abdullaev + + + + + + + + + + + + + + + + + + + + + + if true, disable ECI segment + + + + Convert the text represented by this High Level Encoder into a BitArray. + + text represented by this encoder encoded as a + + + + + + + + + initializing constructor + + + + + + + + append token to bitarray + + + + + + + string representation + + + + + + State represents all information about a sequence necessary to generate the current output. + Note that a state is immutable. + + + + + Create a new state representing this state with a latch to a (not + necessary different) mode, and then a code. + + + + + Create a new state representing this state, with a temporary shift + to a different mode to output a single value. + + + + + Create a new state representing this state, but an additional character + output in Binary Shift mode. + + + + + Create the state identical to this one, but we are no longer in + Binary Shift mode. + + + + + Returns true if "this" state is better (or equal) to be in than "that" + state under all possible circumstances. + + + + + + + + + + represents an empty token + + + + + constructor + + + + + + previous token + + + + + adds a new simple token + + + + + + + + + + + + + + + + append to bitarray + + + + + + + This implementation can detect and decode Aztec codes in an image. + + David Olivier + + + + Locates and decodes a barcode in some format within an image. + + image of barcode to decode + + a String representing the content encoded by the Data Matrix code + + + + + Locates and decodes a Data Matrix code in an image. + + image of barcode to decode + passed as a {@link java.util.Hashtable} from {@link com.google.zxing.DecodeHintType} + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + Aztec result meta data. + + + + + Gets a value indicating whether this Aztec code is compact. + + + true if compact; otherwise, false. + + + + + Gets the nb datablocks. + + + + + Gets the nb layers. + + + + + + + + + + + + + string represenation of that instance + + + + + + Renders an Aztec code as a + + + + + default character set + + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Encoding of the byte array + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + The class holds the available options for the + + + + + Representing the minimal percentage of error correction words. + Note: an Aztec symbol should have a minimum of 25% EC words. + + + + + Specifies the required number of layers for an Aztec code: + a negative number (-1, -2, -3, -4) specifies a compact Aztec code + 0 indicates to use the minimum number of layers (the default) + a positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code + + + + + Specifies what character encoding to use where applicable (type ) + + + + + Enumerates barcode formats known to this package. + + Sean Owen + + + Aztec 2D barcode format. + + + CODABAR 1D format. + + + Code 39 1D format. + + + Code 93 1D format. + + + Code 128 1D format. + + + Data Matrix 2D barcode format. + + + EAN-8 1D format. + + + EAN-13 1D format. + + + ITF (Interleaved Two of Five) 1D format. + + + MaxiCode 2D barcode format. + + + PDF417 format. + + + QR Code 2D barcode format. + + + RSS 14 + + + RSS EXPANDED + + + UPC-A 1D format. + + + UPC-E 1D format. + + + UPC/EAN extension format. Not a stand-alone format. + + + MSI + + + Plessey + + + Intelligent Mail barcode + + + Pharmacode format. + + + + UPC_A | UPC_E | EAN_13 | EAN_8 | CODABAR | CODE_39 | CODE_93 | CODE_128 | ITF | RSS_14 | RSS_EXPANDED + without MSI (to many false-positives) and IMB (not enough tested, and it looks more like a 2D) + + + + + A smart class to decode the barcode inside a bitmap object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a luminance source object for a bitmap. + If null, an exception is thrown when Decode is called + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + + + + Initializes a new instance of the class. + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a luminance source object for a bitmap. + If null, an exception is thrown when Decode is called + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + Sets the function to create a luminance source object for a rgb raw byte array. + + + + A smart class to decode the barcode inside a bitmap object + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a luminance source object for a bitmap. + If null, an exception is thrown when Decode is called + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + + + + Initializes a new instance of the class. + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a luminance source object for a bitmap. + If null, an exception is thrown when Decode is called + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + Sets the function to create a luminance source object for a rgb raw byte array. + + + + Constructor for additional image formats for one BarcodeReader class + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + Sets the function to create a luminance source object for a rgb raw byte array. + + + + Optional: Gets or sets the function to create a luminance source object for a bitmap. + If null a platform specific default LuminanceSource is used + + + The function to create a luminance source object. + + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + A smart class to decode the barcode inside a bitmap object + + + + + represents the default function which is called to get a instance from a raw byte array + + + + + Gets or sets the options. + + + The options. + + + + + Gets the reader which should be used to find and decode the barcode. + + + The reader. + + + + + Gets or sets a method which is called if an important point is found + + + The result point callback. + + + + + event is executed if a result was found via decode + + + + + Gets or sets a value indicating whether the image should be automatically rotated. + Rotation is supported for 90, 180 and 270 degrees + + + true if image should be rotated; otherwise, false. + + + + + Gets or sets a value indicating whether the image should be automatically inverted + if no result is found in the original image. + ATTENTION: Please be carefully because it slows down the decoding process if it is used + + + true if image should be inverted; otherwise, false. + + + + + Optional: Gets or sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + + + The function to create a binarizer object. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Sets the reader which should be used to find and decode the barcode. + If null then MultiFormatReader is used + Sets the function to create a binarizer object for a luminance source. + If null then HybridBinarizer is used + Sets the function to create a luminance source object for a rgb array. + If null the RGBLuminanceSource is used. The handler is only called when Decode with a byte[] array is called. + + + + Tries to decode a barcode within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + Tries to decode barcodes within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + raises the ResultFound event + + + + + + raises the ResultFound event + + + + + + calls the explicitResultPointFound action + + + + + + Decodes the specified barcode bitmap. + + The image as byte[] array. + The width. + The height. + The format. + + the result data or null + + + + + Decodes the specified barcode bitmap. + + The image as byte[] array. + The width. + The height. + The format. + + the result data or null + + + + + A smart class to encode some content to a barcode image + + + + + Initializes a new instance of the class. + + + + + A smart class to encode some content to raw pixel data + + + + + Initializes a new instance of the class. + + + + + A smart class to encode some content to a svg barcode image + + + + + Initializes a new instance of the class. + + + + + A base class for specific barcode writers with specific formats of barcode images. + + The type of the output. + + + + Gets or sets the renderer which should be used to render the encoded BitMatrix. + + + + + Encodes the specified contents and returns a rendered instance of the barcode. + For rendering the instance of the property Renderer is used and has to be set before + calling that method. + + The contents. + + + + + Returns a rendered instance of the barcode which is given by a BitMatrix. + For rendering the instance of the property Renderer is used and has to be set before + calling that method. + + The matrix. + + + + + A base class for specific barcode writers with specific formats of barcode images. + + + + + Gets or sets the barcode format. + The value is only suitable if the MultiFormatWriter is used. + + + + + Gets or sets the options container for the encoding and renderer process. + + + + + Gets or sets the writer which encodes the content to a BitMatrix. + If no value is set the MultiFormatWriter is used. + + + + + + + + + + + + + + + + Encodes the specified contents and returns a BitMatrix array. + That array has to be rendered manually or with a IBarcodeRenderer. + + The contents. + + + + + The base class for luminance sources which supports + cropping and rotating based upon the luminance values. + + + + + weight of the red channel for calculating a gray scale image + + + + + weight of the green channel for calculating a gray scale image + + + + + weight of the blue channel for calculating a gray scale image + + + + + numbers of bits which for right shifting + + + + + + + + + + Initializes a new instance of the class. + + The width. + The height. + + + + Initializes a new instance of the class. + + The luminance array. + The width. + The height. + + + + Fetches one row of luminance data from the underlying platform's bitmap. Values range from + 0 (black) to 255 (white). It is preferable for implementations of this method + to only fetch this row rather than the whole image, since no 2D Readers may be installed and + getMatrix() may never be called. + + The row to fetch, 0 <= y < Height. + An optional preallocated array. If null or too small, it will be ignored. + Always use the returned object, and ignore the .length of the array. + + An array containing the luminance data. + + + + + gets the luminance matrix + + + + + Returns a new object with rotated image data by 90 degrees counterclockwise. + Only callable if {@link #isRotateSupported()} is true. + + + A rotated version of this object. + + + + + TODO: not implemented yet + + + A rotated version of this object. + + + + + + Whether this subclass supports counter-clockwise rotation. + + + + Returns a new object with cropped image data. Implementations may keep a reference to the + original data rather than a copy. Only callable if CropSupported is true. + + The left coordinate, 0 <= left < Width. + The top coordinate, 0 <= top <= Height. + The width of the rectangle to crop. + The height of the rectangle to crop. + + A cropped version of this object. + + + + + + Whether this subclass supports cropping. + + + + + Whether this subclass supports invertion. + + + + Inverts the luminance values (newValue = 255 - oldValue) + + + + + Should create a new luminance source with the right class type. + The method is used in methods crop and rotate. + + The new luminances. + The width. + The height. + + + + This class hierarchy provides a set of methods to convert luminance data to 1 bit data. + It allows the algorithm to vary polymorphically, for example allowing a very expensive + thresholding technique for servers and a fast one for mobile. It also permits the implementation + to vary, e.g. a JNI version for Android and a Java fallback version for other platforms. + + dswitkin@google.com (Daniel Switkin) + + + + + Initializes a new instance of the class. + + The source. + + + + Gets the luminance source object. + + + + Converts one row of luminance data to 1 bit data. May actually do the conversion, or return + cached data. Callers should assume this method is expensive and call it as seldom as possible. + This method is intended for decoding 1D barcodes and may choose to apply sharpening. + For callers which only examine one row of pixels at a time, the same BitArray should be reused + and passed in with each call for performance. However it is legal to keep more than one row + at a time if needed. + + The row to fetch, which must be in [0, bitmap height) + An optional preallocated array. If null or too small, it will be ignored. + If used, the Binarizer will call BitArray.clear(). Always use the returned object. + + The array of bits for this row (true means black). + + + Converts a 2D array of luminance data to 1 bit data. As above, assume this method is expensive + and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or + may not apply sharpening. Therefore, a row from this matrix may not be identical to one + fetched using getBlackRow(), so don't mix and match between them. + + The 2D array of bits for the image (true means black). + + + Creates a new object with the same type as this Binarizer implementation, but with pristine + state. This is needed because Binarizer implementations may be stateful, e.g. keeping a cache + of 1 bit data. See Effective Java for why we can't use Java's clone() method. + + The LuminanceSource this Binarizer will operate on. + A new concrete Binarizer implementation object. + + + + Gets the width of the luminance source object. + + + + + Gets the height of the luminance source object. + + + + + This class is the core bitmap class used by ZXing to represent 1 bit data. Reader objects + accept a BinaryBitmap and attempt to decode it. + + dswitkin@google.com (Daniel Switkin) + + + + + + + + + + The width of the bitmap. + + + + + The height of the bitmap. + + + + + Converts one row of luminance data to 1 bit data. May actually do the conversion, or return + cached data. Callers should assume this method is expensive and call it as seldom as possible. + This method is intended for decoding 1D barcodes and may choose to apply sharpening. + + The row to fetch, which must be in [0, bitmap height). + An optional preallocated array. If null or too small, it will be ignored. + If used, the Binarizer will call BitArray.clear(). Always use the returned object. + + The array of bits for this row (true means black). + + + + Converts a 2D array of luminance data to 1 bit. As above, assume this method is expensive + and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or + may not apply sharpening. Therefore, a row from this matrix may not be identical to one + fetched using getBlackRow(), so don't mix and match between them. + + The 2D array of bits for the image (true means black). + + + + Whether this bitmap can be cropped. + + + + + Returns a new object with cropped image data. Implementations may keep a reference to the + original data rather than a copy. Only callable if isCropSupported() is true. + + The left coordinate, which must be in [0, Width) + The top coordinate, which must be in [0, Height) + The width of the rectangle to crop. + The height of the rectangle to crop. + A cropped version of this object. + + + + Whether this bitmap supports counter-clockwise rotation. + + + + + Returns a new object with rotated image data by 90 degrees counterclockwise. + Only callable if is true. + + A rotated version of this object. + + + + Returns a new object with rotated image data by 45 degrees counterclockwise. + Only callable if is true. + + A rotated version of this object. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + class which represents the luminance values for a bitmap object + + + + + Initializes a new instance of the class. + + The width. + The height. + + + + Initializes a new instance of the class + with the image of a Bitmap instance + + The bitmap. + + + + calculates the luminance values for bitmaps + + + + + + + old slow way for unsupported bit depth + + + + + + + calculates the luminance values for 1-bit indexed bitmaps + + + + + + + + calculates the luminance values for 4-bit indexed bitmaps + + + + + + + + calculates the luminance values for 8-bit indexed bitmaps + + + + + + + + calculates the luminance values for 565 encoded bitmaps + + + + + + + + calculates the luminance values for 24-bit encoded bitmaps + + + + + + + + calculates the luminance values for 32-bit encoded bitmaps without respecting the alpha channel + + + + + + + calculates the luminance values for 32-bit encoded bitmaps with alpha channel + + + calculates the luminance values for 32-bit CMYK encoded bitmaps (k is ignored at the momen) + + + + Should create a new luminance source with the right class type. + The method is used in methods crop and rotate. + + The new luminances. + The width. + The height. + + + +

See + + DoCoMo's documentation about the result types represented by subclasses of this class.

+ +

Thanks to Jeff Griffin for proposing rewrite of these classes that relies less + on exception-based mechanisms during parsing.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ + Implements KDDI AU's address book format. See + + http://www.au.kddi.com/ezfactory/tec/two_dimensions/index.html. + (Thanks to Yuzo for translating!) + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + Implements the "MECARD" address book entry format. + + Supported keys: N, SOUND, TEL, EMAIL, NOTE, ADR, BDAY, URL, plus ORG + Unsupported keys: TEL-AV, NICKNAME + + Except for TEL, multiple values for keys are also not supported; + the first one found takes precedence. + + Our understanding of the MECARD format is based on this document: + + http://www.mobicode.org.tw/files/OMIA%20Mobile%20Bar%20Code%20Standard%20v3.2.1.doc + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Represents a parsed result that encodes contact information, like that in an address book entry. + + Sean Owen + + + + initializing constructor + + + + + + + + + + + + initializing constructor + + + + + + + + + + + + + + + + + + + + + the names + + + + + the nicknames + + + + + In Japanese, the name is written in kanji, which can have multiple readings. Therefore a hint + is often provided, called furigana, which spells the name phonetically. + + The pronunciation of the getNames() field, often in hiragana or katakana. + + + + the phone numbers + + + + optional descriptions of the type of each phone number. It could be like "HOME", but, + there is no guaranteed or standard format. + + + + the e-mail addresses + + + + optional descriptions of the type of each e-mail. It could be like "WORK", but, + there is no guaranteed or standard format. + + + + the instant messenger addresses + + + + + the note field + + + + + the addresses + + + + optional descriptions of the type of each e-mail. It could be like "WORK", but, + there is no guaranteed or standard format. + + + + the title + + + + + the organisations + + + + + the urls + + + + birthday formatted as yyyyMMdd (e.g. 19780917) + + + a location as a latitude/longitude pair + + + Implements the "BIZCARD" address book entry format, though this has been + largely reverse-engineered from examples observed in the wild -- still + looking for a definitive reference. + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Represents a parsed result that encodes a calendar event at a certain time, optionally with attendees and a location. + + Sean Owen + + + + initializing constructor + + + + + + + + + + + + + + + summary + + + + + Gets the start. + + + + + Determines whether [is start all day]. + + if start time was specified as a whole day + + + + event end , or null if event has no duration + + + + + Gets a value indicating whether this instance is end all day. + + true if end time was specified as a whole day + + + + location + + + + + organizer + + + + + attendees + + + + + description + + + + + latitude + + + + + longitude + + + + + Parses a string as a date. RFC 2445 allows the start and end fields to be of type DATE (e.g. 20081021) + or DATE-TIME (e.g. 20081021T123000 for local time, or 20081021T123000Z for UTC). + + The string to parse + + if not a date formatted string + + + + Represents a parsed result that encodes an email message including recipients, subject and body text. + + Sean Owen + + + + the email address + + + + + the TOs + + + + + the CCs + + + + + the BCCs + + + + + the subject + + + + + the body + + + + + the mailto: uri + + + + + Represents a result that encodes an e-mail address, either as a plain address + like "joe@example.org" or a mailto: URL like "mailto:joe@example.org". + + Sean Owen + + + + Implements the "MATMSG" email message entry format. + + Supported keys: TO, SUB, BODY + + Sean Owen + + + + This implements only the most basic checking for an email address's validity -- that it contains + an '@' and contains no characters disallowed by RFC 2822. This is an overly lenient definition of + validity. We want to generally be lenient here since this class is only intended to encapsulate what's + in a barcode, not "judge" it. + + The email. + + true if it is basically a valid email address; otherwise, false. + + + + + Represents a parsed result that encodes extended product information as encoded by the RSS format, like weight, price, dates, etc. + + Antonio Manuel Benjumea Conde, Servinform, S.A. + Agustín Delgado, Servinform, S.A. + + + + extension for kilogram weight type + + + + + extension for pounds weight type + + + + + initializing constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + the raw text + + + + + the product id + + + + + the sscc + + + + + the lot number + + + + + the production date + + + + + the packaging date + + + + + the best before date + + + + + the expiration date + + + + + the weight + + + + + the weight type + + + + + the weight increment + + + + + the price + + + + + the price increment + + + + + the price currency + + + + + the uncommon AIs + + + + + the display representation (raw text) + + + + + Parses strings of digits that represent a RSS Extended code. + + Antonio Manuel Benjumea Conde, Servinform, S.A. + Agustín Delgado, Servinform, S.A. + + + + tries to parse a text representation to a specific result object + + + + + + + Represents a parsed result that encodes a geographic coordinate, with latitude, longitude and altitude. + + Sean Owen + + + latitude in degrees + + + + longitude in degrees + + + + altitude in meters. If not specified, in the geo URI, returns 0.0 + + + + query string associated with geo URI or null if none exists + + + + the geo URI + + + + a URI link to Google Maps which display the point on the Earth described + by this instance, and sets the zoom level in a way that roughly reflects the + altitude, if specified + + + + Parses a "geo:" URI result, which specifies a location on the surface of + the Earth as well as an optional altitude above the surface. See + + http://tools.ietf.org/html/draft-mayrhofer-geo-uri-00. + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Represents a parsed result that encodes a product ISBN number. + + jbreiden@google.com (Jeff Breidenbach) + + + + the ISBN number + + + + Parses strings of digits that represent a ISBN. + + + jbreiden@google.com (Jeff Breidenbach) + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + See ISBN-13 For Dummies + + The result. + + + +

Abstract class representing the result of decoding a barcode, as more than + a String -- as some type of structured data. This might be a subclass which represents + a URL, or an e-mail address. {@link ResultParser#parseResult(Result)} will turn a raw + decoded string into the most appropriate type of structured representation.

+ +

Thanks to Jeff Griffin for proposing rewrite of these classes that relies less + on exception-based mechanisms during parsing.

+
+ Sean Owen +
+ + + user friendly value + + + + + gets the type of the parsed result + + + + + user friendly value + + + + + constructor + + + + + + gets a user friendly value + + + + + + compare two objects + + + + + + + gets the hashcode + + + + + + append to result if not null or empty + + + + + + + append to result if not null or empty + + + + + + + Represents the type of data encoded by a barcode -- from plain text, to a + URI, to an e-mail address, etc. + + Sean Owen + + + + address book + + + + + email address + + + + + product + + + + + URI + + + + + Text + + + + + geo coordinates + + + + + telefon + + + + + sms + + + + + calendar + + + + + wifi + + + + + ISBN + + + + + VIN + + + + + Represents a parsed result that encodes a product by an identifier of some kind. + + dswitkin@google.com (Daniel Switkin) + + + + product id + + + + + normalized product id + + + + + Parses strings of digits that represent a UPC code. + + dswitkin@google.com (Daniel Switkin) + + +

Abstract class representing the result of decoding a barcode, as more than + a String -- as some type of structured data. This might be a subclass which represents + a URL, or an e-mail address. {@link #parseResult(com.google.zxing.Result)} will turn a raw + decoded string into the most appropriate type of structured representation.

+ +

Thanks to Jeff Griffin for proposing rewrite of these classes that relies less + on exception-based mechanisms during parsing.

+
+ Sean Owen +
+ + + Attempts to parse the raw {@link Result}'s contents as a particular type + of information (email, URL, etc.) and return a {@link ParsedResult} encapsulating + the result of parsing. + + the raw to parse + encapsulating the parsing result + + + + Parses the result. + + The result. + + + + + append value to result, if not null + + + + + + + append value to result, if not null + + + + + + + wrap, if not null + + + + + + + unescape backslash + + + + + + + parse hex digit + + + + + + + decodes url + + + + + +

Parses an "sms:" URI result, which specifies a number to SMS and optional + "via" number. See + the IETF draft on this.

+ +

This actually also parses URIs starting with "mms:", "smsto:", "mmsto:", "SMSTO:", and + "MMSTO:", and treats them all the same way, and effectively converts them to an "sms:" URI + for purposes of forwarding to the platform.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ + + Represents a parsed result that encodes an SMS message, including recipients, subject and body text. + + Sean Owen + + + + initializing constructor + + + + + + + + + initializing constructor + + + + + + + + + numbers + + + + + vias + + + + + subject + + + + + body + + + + + sms uri + + + + +

Parses an "smsto:" URI result, whose format is not standardized but appears to be like: + {@code smsto:number(:body)}.

+

This actually also parses URIs starting with "smsto:", "mmsto:", "SMSTO:", and + "MMSTO:", and treats them all the same way, and effectively converts them to an "sms:" URI + for purposes of forwarding to the platform.

+
+ Sean Owen +
+ + + attempt to parse the raw result to the specific type + + + + + + +

Parses an "smtp:" URI result, whose format is not standardized but appears to be like: + smtp[:subject[:body]]}.

+

See http://code.google.com/p/zxing/issues/detail?id=536

+
+ Sean Owen +
+ + + attempt to parse the raw result to the specific type + + + + + + + Represents a parsed result that encodes a telephone number. + + Sean Owen + + + + initializing constructor + + + + + + + + number + + + + + URI + + + + + title + + + + + Parses a "tel:" URI result, which specifies a phone number. + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + A simple result type encapsulating a string that has no further interpretation. + + Sean Owen + + + + initializing constructor + + + + + + + text + + + + + language + + + + + A simple result type encapsulating a URI that has no further interpretation. + + Sean Owen + + + + URI + + + + + title + + + + true if the URI contains suspicious patterns that may suggest it intends to + mislead the user about its true nature. At the moment this looks for the presence + of user/password syntax in the host/authority portion of a URI which may be used + in attempts to make the URI's host appear to be other than it is. Example: + http://yourbank.com@phisher.com This URI connects to phisher.com but may appear + to connect to yourbank.com at first glance. + + + + + initializing constructor + + + + + + Transforms a string that represents a URI into something more proper, by adding or canonicalizing + the protocol. + + + + + Tries to parse results that are a URI of some kind. + + Sean Owen + + + @return true if the URI contains suspicious patterns that may suggest it intends to + mislead the user about its true nature. At the moment this looks for the presence + of user/password syntax in the host/authority portion of a URI which may be used + in attempts to make the URI's host appear to be other than it is. Example: + http://yourbank.com@phisher.com This URI connects to phisher.com but may appear + to connect to yourbank.com at first glance. + + + Parses the "URLTO" result format, which is of the form "URLTO:[title]:[url]". + This seems to be used sometimes, but I am not able to find documentation + on its origin or official format? + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Parses contact information formatted according to the VCard (2.1) format. This is not a complete + implementation but should parse information as commonly encoded in 2D barcodes. + + Sean Owen + + + Formats name fields of the form "Public;John;Q.;Reverend;III" into a form like + "Reverend John Q. Public III". + + @param names name values to format, in place + + + + Partially implements the iCalendar format's "VEVENT" format for specifying a + calendar event. See RFC 2445. This supports SUMMARY, DTSTART and DTEND fields. + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Represents a parsed result that encodes a Vehicle Identification Number (VIN). + + + + + VIN + + + + + manufacturer id + + + + + vehicle descriptor section + + + + + vehicle identifier section + + + + + country code + + + + + vehicle attributes + + + + + model year + + + + + plant code + + + + + sequential number + + + + + initializing constructor + + + + + + + + + + + + + + a user friendly representation + + + + + Detects a result that is likely a vehicle identification number. + @author Sean Owen + + + + + attempt to parse the raw result to the specific type + + + + + + + Represents a parsed result that encodes wifi network information, like SSID and password. + + Vikram Aggarwal + + + + initializing constructor + + + + + + + + initializing constructor + + + + + + + + + initializing constructor + + + + + + + + + + + + + SSID + + + + + network encryption + + + + + password + + + + + hidden flag + + + + + identity + + + + + anonymous + + + + + eap + + + + + phase 2 method + + + + +

Parses a WIFI configuration string. Strings will be of the form:

+

{@code WIFI:T:[network type];S:[network SSID];P:[network password];H:[hidden?];;}

+

The fields can appear in any order. Only "S:" is required.

+

For WPA2 enterprise(EAP), strings will be of the form:

+

{@code WIFI:T:WPA2-EAP;S:[network SSID];H:[hidden?];E:[EAP method];PH2:[Phase 2 method];A:[anonymous identity];I:[username];P:[password];;}

+

"EAP method" can e.g.be "TTLS" or "PWD" or one of the other fields in WifiEnterpriseConfig.Eap and "Phase 2 method" can e.g.be "MSCHAPV2" or any of the other fields in WifiEnterpriseConfig.Phase2

+
+ Vikram Aggarwal + Sean Owen + Steffen Kieß +
+ + + attempt to parse the raw result to the specific type + + + + + + + A simple, fast array of bits, represented compactly by an array of ints internally. + + Sean Owen + + + + size of the array, number of elements + + + + + size of the array in bytes + + + + + index accessor + + + + + + + default constructor + + + + + initializing constructor + + desired size of the array + + + + Flips bit i. + + bit to set + + + + + Gets the next set. + + first bit to check + index of first bit that is set, starting from the given index, or size if none are set + at or beyond this given index + + + + see getNextSet(int) + + index to start looking for unset bit + index of next unset bit, or if none are unset until the end + + + Sets a block of 32 bits, starting at bit i. + index position of the new 32 bit block + the new value of the next 32 bits. + + + + Sets a range of bits. + + start of range, inclusive. + end of range, exclusive + + + Clears all bits (sets to false). + + + Efficient method to check if a range of bits is set, or not set. + + + start of range, inclusive. + + end of range, exclusive + + if true, checks that bits in range are set, otherwise checks that they are not set + + true iff all bits are set or not set in range, according to value argument + if end is less than start or the range is not contained in the array + + + + Appends the bit. + + The bit. + + + underlying array of ints. The first element holds the first 32 bits, and the least + significant bit is bit 0. + + + + + Appends the least-significant bits, from value, in order from most-significant to + least-significant. For example, appending 6 bits from 0x000001E will append the bits + 0, 1, 1, 1, 1, 0 in that order. + + containing bits to append + bits from value to append + + + + adds the array to the end + + + + + + XOR operation + + + + + + converts to bytes. + + first bit to start writing + array to write into. Bytes are written most-significant byte first. This is the opposite + of the internal representation, which is exposed by BitArray + position in array to start writing + how many bytes to write + + + Reverses all bits in the array. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Erstellt ein neues Objekt, das eine Kopie der aktuellen Instanz darstellt. + + + Ein neues Objekt, das eine Kopie dieser Instanz darstellt. + + + + +

Represents a 2D matrix of bits. In function arguments below, and throughout the common + module, x is the column position, and y is the row position. The ordering is always x, y. + The origin is at the top-left.

+

Internally the bits are represented in a 1-D array of 32-bit ints. However, each row begins + with a new int. This is done intentionally so that we can copy out a row into a very + efficiently.

+

The ordering of bits is row-major. Within each int, the least significant bits are used first, + meaning they represent lower x values. This is compatible with 's implementation.

+
+ Sean Owen + dswitkin@google.com (Daniel Switkin) +
+ + The width of the matrix + + + + The height of the matrix + + + + This method is for compatibility with older code. It's only logical to call if the matrix + is square, so I'm throwing if that's not the case. + + + row/column dimension of this matrix + + + + + The rowsize of the matrix + + + + + Creates an empty square . + + height and width + + + + Creates an empty square . + + bit matrix width + bit matrix height + + + + Interprets a 2D array of booleans as a , where "true" means an "on" bit. + + bits of the image, as a row-major 2D array. Elements are arrays representing rows + representation of image + + + + parse the string representation to a bitmatrix + + + + + + + +

Gets the requested bit, where true means black.

+ +
+ The horizontal component (i.e. which column) + + The vertical component (i.e. which row) + + value of given bit in matrix + +
+ + +

Flips the given bit.

+
+ The horizontal component (i.e. which column) + The vertical component (i.e. which row) +
+ + +

Flips every bit in the matrix.

+
+
+ + + flip all of the bits, if shouldBeFlipped is true for the coordinates + + should return true, if the bit at a given coordinate should be flipped + + + + Exclusive-or (XOR): Flip the bit in this {@code BitMatrix} if the corresponding + mask bit is set. + + The mask. + + + Clears all bits (sets to false). + + +

Sets a square region of the bit matrix to true.

+ +
+ The horizontal position to begin at (inclusive) + + The vertical position to begin at (inclusive) + + The width of the region + + The height of the region + +
+ + A fast method to retrieve one row of data from the matrix as a BitArray. + + + The row to retrieve + + An optional caller-allocated BitArray, will be allocated if null or too small + + The resulting BitArray - this reference should always be used even when passing + your own row + + + + + Sets the row. + + row to set + {@link BitArray} to copy from + + + + Modifies this {@code BitMatrix} to represent the same but rotated the given degrees(0, 90, 180, 270) + + number of degrees to rotate through counter-clockwise(0, 90, 180, 270) + + + + + Modifies this {@code BitMatrix} to represent the same but rotated 180 degrees + + + + + Modifies this {@code BitMatrix} to represent the same but rotated 90 degrees counterclockwise + + + + + This is useful in detecting the enclosing rectangle of a 'pure' barcode. + + {left,top,width,height} enclosing rectangle of all 1 bits, or null if it is all white + + + + This is useful in detecting a corner of a 'pure' barcode. + + {x,y} coordinate of top-left-most 1 bit, or null if it is all white + + + + bottom right + + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The set string. + The unset string. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The set string. + The unset string. + The line separator. + + A that represents this instance. + + + + + Clones this instance. + + + + + + + + + + + + Converts this ByteMatrix to a black and white bitmap. + + A black and white bitmap converted from this ByteMatrix. + + +

This provides an easy abstraction to read bits at a time from a sequence of bytes, where the + number of bits read is not often a multiple of 8.

+ +

This class is thread-safe but not reentrant. Unless the caller modifies the bytes array + it passed in, in which case all bets are off.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ + bytes from which this will read bits. Bits will be read from the first byte first. + Bits are read within a byte from most-significant to least-significant bit. + + + + + index of next bit in current byte which would be read by the next call to {@link #readBits(int)}. + + + + + index of next byte in input byte array which would be read by the next call to {@link #readBits(int)}. + + + + number of bits to read + + int representing the bits read. The bits will appear as the least-significant + bits of the int + + if numBits isn't in [1,32] or more than is available + + + number of bits that can be read successfully + + + + + Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1 of ISO 18004. + + Sean Owen + + + + encoding name + + + + + contains get encoding class; + can be set externally if override is necessary + + + + character set ECI value + representing ECI of given value, or null if it is legal but unsupported + + + character set ECI encoding name + representing ECI for character encoding, or null if it is legal but unsupported + + + + + encoding + CharacterSetECI representing ECI for character encoding, or null if it is legal but unsupported + + + + returns the encoding object fo the specified charset + + + + + + + returns the encoding object fo the specified name + + + + + + + Encapsulates the result of decoding a matrix of bits. This typically + applies to 2D barcode formats. For now it contains the raw bytes obtained, + as well as a String interpretation of those bytes, if applicable. + Sean Owen + + + + + raw bytes representing the result, or null if not applicable + + + + + how many bits of are valid; typically 8 times its length + + + + + text representation of the result + + + + + list of byte segments in the result, or null if not applicable + + + + + name of error correction level used, or null if not applicable + + + + + gets a value which describe if structure append data was found + + + + + number of errors corrected, or null if not applicable + + + + + gives the sequence number of the result if structured append was found + + + + + number of erasures corrected, or null if not applicable + + + + + gives the parity information if structured append was found + + + + + Miscellanseous data value for the various decoders + + The other. + + + + gives the symbology identifier + + + + + initializing constructor + + + + + + + + + initializing constructor + + + + + + + + + + initializing constructor + + + + + + + + + + + initializing constructor + + + + + + + + + + + + initializing constructor + + + + + + + + + + initializing constructor + + + + + + + + + + + + + initializing constructor + + + + + + + + + + + + + + Defines an container for encoder options + + + + + Gets the data container for all options + + + + + event is raised when a value is changed + + + + + Gets or sets a flag which cause a deeper look into the bitmap + + + true if [try harder]; otherwise, false. + + + + + Gets or sets a value indicating whether the image should be automatically inverted + if no result is found in the original image. + ATTENTION: Please be carefully because it slows down the decoding process if it is used + + + true if image should be inverted; otherwise, false. + + + + + Image is a pure monochrome image of a barcode. + + + true if monochrome image of a barcode; otherwise, false. + + + + + Specifies what character encoding to use when decoding, where applicable (type String) + + + The character set. + + + + + Image is known to be of one of a few possible formats. + Maps to a {@link java.util.List} of {@link BarcodeFormat}s. + + + The possible formats. + + + + + if Code39 could be detected try to use extended mode for full ASCII character set + + + + + Don't fail if a Code39 is detected but can't be decoded in extended mode. + Return the raw Code39 result instead. Maps to . + + + + + Assume Code 39 codes employ a check digit. Maps to . + + + true if it should assume a Code 39 check digit; otherwise, false. + + + + + If true, return the start and end digits in a Codabar barcode instead of stripping them. They + are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them + to not be. Doesn't matter what it maps to; use . + + + + + Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed. + For example this affects FNC1 handling for Code 128 (aka GS1-128). + + + true if it should assume GS1; otherwise, false. + + + + + Assume MSI codes employ a check digit. Maps to . + + + true if it should assume a MSI check digit; otherwise, false. + + + + + Allowed lengths of encoded data -- reject anything else. Maps to an int[]. + + + + + Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this. + Maps to an int[] of the allowed extension lengths, for example [2], [5], or [2, 5]. + If it is optional to have an extension, do not set this hint. If this is set, + and a UPC or EAN barcode is found but an extension is not, then no result will be returned + at all. + + + + + Initializes a new instance of the class. + + + + Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Encapsulates the result of detecting a barcode in an image. This includes the raw + matrix of black/white pixels corresponding to the barcode, and possibly points of interest + in the image, like the location of finder patterns or corners of the barcode in the image.

+
+ Sean Owen +
+ + + the detected bits + + + + + the pixel points where the result is found + + + + + initializing constructor + + + + + + + General math-related and numeric utility functions. + + + + + Ends up being a bit faster than {@link Math#round(float)}. This merely rounds its + argument to the nearest int, where x.5 rounds up to x+1. Semantics of this shortcut + differ slightly from {@link Math#round(float)} in that half rounds down for negative + values. -2.5 rounds to -3, not -2. For purposes here it makes no difference. + + real value to round + nearest int + + + + + + + + + + Euclidean distance between points A and B + + + + + + + + + + Euclidean distance between points A and B + + + + + values to sum + sum of values in array + + +

A somewhat generic detector that looks for a barcode-like rectangular region within an image. + It looks within a mostly white region of an image for a region of black and white, but mostly + black. It returns the four corners of the region, as best it can determine.

+ +
+ Sean Owen +
+ + + initializing constructor + + + + + +

Detects a rectangular region of black and white -- mostly black -- with a region of mostly + white, in an image.

+
+ [] describing the corners of the rectangular region. The first and + last points are opposed on the diagonal, as are the second and third. The first point will be + the topmost point and the last, the bottommost. The second point will be leftmost and the + third, the rightmost + +
+ + Attempts to locate a corner of the barcode by scanning up, down, left or right from a center + point which should be within the barcode. + + + center's x component (horizontal) + + same as deltaY but change in x per step instead + + minimum value of x + + maximum value of x + + center's y component (vertical) + + change in y per step. If scanning up this is negative; down, positive; + left or right, 0 + + minimum value of y to search through (meaningless when di == 0) + + maximum value of y + + maximum run of white pixels that can still be considered to be within + the barcode + + a encapsulating the corner that was found + + + + Computes the start and end of a region of pixels, either horizontally or vertically, that could + be part of a Data Matrix barcode. + + + if scanning horizontally, this is the row (the fixed vertical location) + where we are scanning. If scanning vertically it's the column, the fixed horizontal location + + largest run of white pixels that can still be considered part of the + barcode region + + minimum pixel location, horizontally or vertically, to consider + + maximum pixel location, horizontally or vertically, to consider + + if true, we're scanning left-right, instead of up-down + + int[] with start and end of found range, or null if no such range is found + (e.g. only white was found) + + + + + Detects a candidate barcode-like rectangular region within an image. It + starts around the center of the image, increases the size of the candidate + region until it finds a white rectangular region. By keeping track of the + last black points it encountered, it determines the corners of the barcode. + + David Olivier + + + + Creates a WhiteRectangleDetector instance + + The image. + null, if image is too small, otherwise a WhiteRectangleDetector instance + + + + Creates a WhiteRectangleDetector instance + + barcode image to find a rectangle in + initial size of search area around center + x position of search center + y position of search center + + null, if image is too small, otherwise a WhiteRectangleDetector instance + + + + + Initializes a new instance of the class. + + The image. + if image is too small + + + + Initializes a new instance of the class. + + The image. + Size of the init. + The x. + The y. + + + + Detects a candidate barcode-like rectangular region within an image. It + starts around the center of the image, increases the size of the candidate + region until it finds a white rectangular region. + + [] describing the corners of the rectangular + region. The first and last points are opposed on the diagonal, as + are the second and third. The first point will be the topmost + point and the last, the bottommost. The second point will be + leftmost and the third, the rightmost + + + + recenters the points of a constant distance towards the center + + bottom most point + left most point + right most point + top most point + [] describing the corners of the rectangular + region. The first and last points are opposed on the diagonal, as + are the second and third. The first point will be the topmost + point and the last, the bottommost. The second point will be + leftmost and the third, the rightmost + + + + Determines whether a segment contains a black point + + min value of the scanned coordinate + max value of the scanned coordinate + value of fixed coordinate + set to true if scan must be horizontal, false if vertical + + true if a black point has been found, else false. + + + + + Superclass of classes encapsulating types ECIs, according to "Extended Channel Interpretations" + 5.3 of ISO 18004. + + Sean Owen + + + + the ECI value + + + + ECI value + representing ECI of given value, or null if it is legal but unsupported + ArgumentException if ECI value is invalid + + + + Set of CharsetEncoders for a given input string + Invariants: + - The list contains only encoders from CharacterSetECI(list is shorter then the list of encoders available on + the platform for which ECI values are defined). + - The list contains encoders at least one encoder for every character in the input. + - The first encoder in the list is always the ISO-8859-1 encoder even of no character in the input can be encoded + by it. + - If the input contains a character that is not in ISO-8859-1 then the last two entries in the list will be the + UTF-8 encoder and the UTF-16BE encoder. + + @author Alex Geller + + + + + Constructs an encoder set + + the string that needs to be encoded + The preferred { @link Charset } or null. + fnc1 denotes the character in the input that represents the FNC1 character or -1 for a non-GS1 bar + code.When specified, it is considered an error to pass it as argument to the methods canEncode() or encode(). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + returns -1 if no priority charset was defined + + -1 if no priority charset was defined + + + + + + + + + + + + + + + + + + + + + + + + Interface to navigate a sequence of ECIs and bytes. + @author Alex Geller + + + + + Returns the length of this input.The length is the number of {@code byte}s in or ECIs in the sequence. + + + + + Returns the {@code byte} value at the specified index. An index ranges from zero to {@code length() - 1}. The first { @code byte} + value of the sequence is at index zero, the next at index one, and so on, as for array indexing. + + the index of the {@code byte} value to be returned + the specified {@code byte} value as character or the FNC1 character + if the {@code index} argument is negative or not less than {@code Length} + if the value at the {@code index} argument is an ECI (@see #isECI) + + + + Returns a {@code CharSequence} that is a subsequence of this sequence. + The subsequence starts with the {@code char} value at the specified index and + ends with the {@code char} value at index {@code end - 1}. The length + (in {@code char}s) of the + returned sequence is {@code end - start}, so if {@code start == end} + then an empty sequence is returned. + + the start index, inclusive + the start index, inclusive + the specified subsequence + if {@code start} or {@code end} are negative, + if {@code end} is greater than { @code length()}, + or if {@code start} is greater than { @code end} + if a value in the range {@code start}-{@code end} is an ECI (@see #isECI) + + + + Determines if a value is an ECI + + the index of the value + true if the value at position {@code index} is an ECI + if the {@code index} argument is negative or not less than {@code length()} + + + + Returns the {@code int} ECI value at the specified index. An index ranges from zero + to {@code length() - 1}. The first {@code byte} value of the sequence is at + index zero, the next at index one, and so on, as for array + indexing. + + the index of the {@code int} value to be returned + the specified {@code int} ECI value. + The ECI specified the encoding of all bytes with a higher index until the + next ECI or until the end of the input if no other ECI follows. + if the value at the {@code index} argument is not an ECI (@see #isECI) + + + + + + + + + + + + + Class that converts a sequence of ECIs and bytes into a string + + @author Alex Geller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Appends {@code value} as a byte value + + character whose lowest byte is to be appended + + + + Appends {@code value} as a byte value + + byte to append + + + + Appends the characters in {@code value} as bytes values + + string to append + + + + Append the string repesentation of {@code value} (short for {@code append(String.valueOf(value))}) + + int to append as a string + + + + Appends ECI value to output. + + ECI value to append, as an int + + + + + Appends the characters from {@code value} (unlike all other append methods of this class who append bytes) + + characters to append + + + + Short for {@code toString().length()} (if possible, use {@link #isEmpty()} instead) + + length of string representation in characters + + + + true if nothing has been appended + + + + + + + + + + + Defines an container for encoder options + + + + + Gets the data container for all options + + + + + Specifies the height of the barcode image + + + + + Specifies the width of the barcode image + + + + + Don't put the content string into the output image. + + + + + Specifies margin, in pixels, to use when generating the barcode. The meaning can vary + by format; for example it controls margin before and after the barcode horizontally for + most 1D formats. + + + + + Specifies whether the data should be encoded to the GS1 standard; + FNC1 character is added in front of the data + + + + + Don't add a white area around the generated barcode if the requested size is larger than then barcode. + + + + + Initializes a new instance of the class. + + + + This Binarizer implementation uses the old ZXing global histogram approach. It is suitable + for low-end mobile devices which don't have enough CPU or memory to use a local thresholding + algorithm. However, because it picks a global black point, it cannot handle difficult shadows + and gradients. + + Faster mobile devices and all desktop applications should probably use HybridBinarizer instead. + + dswitkin@google.com (Daniel Switkin) + Sean Owen + + + + + Initializes a new instance of the class. + + The source. + + + + Applies simple sharpening to the row data to improve performance of the 1D Readers. + + + + + + + + Does not sharpen the data, as this call is intended to only be used by 2D Readers. + + + + + Creates a new object with the same type as this Binarizer implementation, but with pristine + state. This is needed because Binarizer implementations may be stateful, e.g. keeping a cache + of 1 bit data. See Effective Java for why we can't use Java's clone() method. + + The LuminanceSource this Binarizer will operate on. + + A new concrete Binarizer implementation object. + + + + Implementations of this class can, given locations of finder patterns for a QR code in an + image, sample the right points in the image to reconstruct the QR code, accounting for + perspective distortion. It is abstracted since it is relatively expensive and should be allowed + to take advantage of platform-specific optimized implementations, like Sun's Java Advanced + Imaging library, but which may not be available in other environments such as J2ME, and vice + versa. + + The implementation used can be controlled by calling {@link #setGridSampler(GridSampler)} + with an instance of a class which implements this interface. + + Sean Owen + + + the current implementation of + + + + Sets the implementation of used by the library. One global + instance is stored, which may sound problematic. But, the implementation provided + ought to be appropriate for the entire platform, and all uses of this library + in the whole lifetime of the JVM. For instance, an Android activity can swap in + an implementation that takes advantage of native platform libraries. + + The platform-specific object to install. + + + +

Samples an image for a square matrix of bits of the given dimension. This is used to extract + the black/white modules of a 2D barcode like a QR Code found in an image. Because this barcode + may be rotated or perspective-distorted, the caller supplies four points in the source image + that define known points in the barcode, so that the image may be sampled appropriately.

+

The last eight "from" parameters are four X/Y coordinate pairs of locations of points in + the image that define some significant points in the image to be sample. For example, + these may be the location of finder pattern in a QR Code.

+

The first eight "to" parameters are four X/Y coordinate pairs measured in the destination + , from the top left, where the known points in the image given by the "from" + parameters map to.

+

These 16 parameters define the transformation needed to sample the image.

+
+ image to sample + The dimension X. + The dimension Y. + The p1 preimage X. + The p1 preimage Y. + The p2 preimage X. + The p2 preimage Y. + The p3 preimage X. + The p3 preimage Y. + The p4 preimage X. + The p4 preimage Y. + The p1 image X. + The p1 image Y. + The p2 image X. + The p2 image Y. + The p3 image X. + The p3 image Y. + The p4 image X. + The p4 image Y. + + representing a grid of points sampled from the image within a region + defined by the "from" parameters + + ReaderException if image can't be sampled, for example, if the transformation defined +
+ + + + + + + + + + + +

Checks a set of points that have been transformed to sample points on an image against + the image's dimensions to see if the point are even within the image.

+ +

This method will actually "nudge" the endpoints back onto the image if they are found to be + barely (less than 1 pixel) off the image. This accounts for imperfect detection of finder + patterns in an image where the QR Code runs all the way to the image border.

+ +

For efficiency, the method will check points from either end of the line until one is found + to be within the image. Because the set of points are assumed to be linear, this is valid.

+ +
+ image into which the points should map + + actual points in x1,y1,...,xn,yn form + +
+ + This class implements a local thresholding algorithm, which while slower than the + GlobalHistogramBinarizer, is fairly efficient for what it does. It is designed for + high frequency images of barcodes with black data on white backgrounds. For this application, + it does a much better job than a global blackpoint with severe shadows and gradients. + However it tends to produce artifacts on lower frequency images and is therefore not + a good general purpose binarizer for uses outside ZXing. + + This class extends GlobalHistogramBinarizer, using the older histogram approach for 1D readers, + and the newer local approach for 2D readers. 1D decoding using a per-row histogram is already + inherently local, and only fails for horizontal gradients. We can revisit that problem later, + but for now it was not a win to use local blocks for 1D. + + This Binarizer is the default for the unit tests and the recommended class for library users. + dswitkin@google.com (Daniel Switkin) + + + + + gives the black matrix + + + + + initializing constructor + + + + + + creates a new instance + + + + + + + Calculates the final BitMatrix once for all requests. This could be called once from the + constructor instead, but there are some advantages to doing it lazily, such as making + profiling easier, and not doing heavy lifting when callers don't expect it. + + + + + For each 8x8 block in the image, calculate the average black point using a 5x5 grid + of the blocks around it. Also handles the corner cases (fractional blocks are computed based + on the last 8 pixels in the row/column which are also used in the previous block). + + The luminances. + Width of the sub. + Height of the sub. + The width. + The height. + The black points. + The matrix. + + + + Applies a single threshold to an 8x8 block of pixels. + + The luminances. + The xoffset. + The yoffset. + The threshold. + The stride. + The matrix. + + + + Calculates a single black point for each 8x8 block of pixels and saves it away. + See the following thread for a discussion of this algorithm: + http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0 + + The luminances. + Width of the sub. + Height of the sub. + The width. + The height. + + + + + Class that converts a character string into a sequence of ECIs and bytes + The implementation uses the Dijkstra algorithm to produce minimal encodings + @author Alex Geller + + + + + Constructs a minimal input + + the character string to encode + The preferred {@link Charset}. When the value of the argument is null, the algorithm + chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority + charset to encode any character in the input that can be encoded by it if the charset is among the + supported charsets. + denotes the character in the input that represents the FNC1 character or -1 if this is not GS1 + input. + + + + + + + + + + Returns the length of this input. The length is the number + of {@code byte}s, FNC1 characters or ECIs in the sequence. + + + + + + + + + + + + + Returns the {@code byte} value at the specified index. An index ranges from zero + to {@code length() - 1}. The first {@code byte} value of the sequence is at + index zero, the next at index one, and so on, as for array + indexing. + + the index of the {@code byte} value to be returned + the specified {@code byte} value as character or the FNC1 character + if the {@code index} argument is negative or not less than + {@code length()} + if the value at the {@code index} argument is an ECI (@see #isECI) + + + + Returns a {@code CharSequence} that is a subsequence of this sequence. + The subsequence starts with the {@code char} value at the specified index and + ends with the {@code char} value at index {@code end - 1}. The length + (in {@code char}s) of the + returned sequence is {@code end - start}, so if {@code start == end} + then an empty sequence is returned. + + the start index, inclusive + the end index, exclusive + the specified subsequence + if {@code start} or {@code end} are negative, + if {@code end} is greater than {@code length()}, + or if {@code start} is greater than {@code end} + if a value in the range {@code start}-{@code end} is an ECI (@see #isECI) + + + + Determines if a value is an ECI + + the index of the value + true if the value at position {@code index} is an ECI + if the {@code index} argument is negative or not less than + {@code length()} + + + + Determines if a value is the FNC1 character + + the index of the value + true if the value at position {@code index} is the FNC1 character + if the {@code index} argument is negative or not less than + {@code length()} + + + + Returns the {@code int} ECI value at the specified index. An index ranges from zero + to {@code length() - 1}. The first {@code byte} value of the sequence is at + index zero, the next at index one, and so on, as for array + indexing. + + the index of the {@code int} value to be returned + the specified {@code int} ECI value. + The ECI specified the encoding of all bytes with a higher index until the + next ECI or until the end of the input if no other ECI follows. + if the {@code index} argument is negative or not less than + {@code length()} + if the value at the {@code index} argument is not an ECI (@see #isECI) + + + + + + + + +

This class implements a perspective transform in two dimensions. Given four source and four + destination points, it will compute the transformation implied between them. The code is based + directly upon section 3.4.2 of George Wolberg's "Digital Image Warping"; see pages 54-56.

+
+ Sean Owen +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Convenience method, not optimized for performance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

This class contains utility methods for performing mathematical operations over + the Galois Fields. Operations use a given primitive polynomial in calculations.

+

Throughout this package, elements of the GF are represented as an {@code int} + for convenience and speed (but at the cost of memory).

+ +

The size of the GF is assumed to be a power of two.

+ +
+ Sean Owen +
+ + + Aztec data 12 + + + + + Aztec data 10 + + + + + Aztec data 6 + + + + + Aztec param + + + + + QR Code + + + + + Data Matrix + + + + + Aztec data 8 + + + + + Maxicode + + + + + Create a representation of GF(size) using the given primitive polynomial. + + irreducible polynomial whose coefficients are represented by + * the bits of an int, where the least-significant bit represents the constant + * coefficient + the size of the field + the factor b in the generator polynomial can be 0- or 1-based + * (g(x) = (x+a^b)(x+a^(b+1))...(x+a^(b+2t-1))). + * In most cases it should be 1, but for QR code it is 0. + + + + Builds the monomial. + + The degree. + The coefficient. + the monomial representing coefficient * x^degree + + + + Implements both addition and subtraction -- they are the same in GF(size). + + sum/difference of a and b + + + + Exps the specified a. + + 2 to the power of a in GF(size) + + + + Logs the specified a. + + A. + base 2 log of a in GF(size) + + + + Inverses the specified a. + + multiplicative inverse of a + + + + Multiplies the specified a with b. + + A. + The b. + product of a and b in GF(size) + + + + Gets the size. + + + + + Gets the generator base. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + +

Represents a polynomial whose coefficients are elements of a GF. + Instances of this class are immutable.

+

Much credit is due to William Rucklidge since portions of this code are an indirect + port of his C++ Reed-Solomon implementation.

+
+ Sean Owen +
+ + + Initializes a new instance of the class. + + the {@link GenericGF} instance representing the field to use + to perform computations + coefficients as ints representing elements of GF(size), arranged + from most significant (highest-power term) coefficient to least significant + if argument is null or empty, + or if leading coefficient is 0 and this is not a + constant polynomial (that is, it is not the monomial "0") + + + + degree of this polynomial + + + + + Gets a value indicating whether this is zero. + + true iff this polynomial is the monomial "0" + + + + coefficient of x^degree term in this polynomial + + The degree. + coefficient of x^degree term in this polynomial + + + + evaluation of this polynomial at a given point + + A. + evaluation of this polynomial at a given point + + +

Implements Reed-Solomon decoding, as the name implies.

+ +

The algorithm will not be explained here, but the following references were helpful + in creating this implementation:

+ + + +

Much credit is due to William Rucklidge since portions of this code are an indirect + port of his C++ Reed-Solomon implementation.

+ +
+ Sean Owen + William Rucklidge + sanfordsquires +
+ + + constructor + + + + + +

Decodes given set of received codewords, which include both data and error-correction + codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, + in the input.

+
+ data and error-correction codewords + number of error-correction codewords available + false: decoding fails +
+ + + Decodes given set of received codewords, which include both data and error-correction + codewords.Really, this means it uses Reed-Solomon to detect and correct errors, in-place, + in the input. + + data and error-correction codewords + number of error-correction codewords available + the number of errors corrected + false: decoding fails + + + + Implements Reed-Solomon encoding, as the name implies. + + Sean Owen + William Rucklidge + + + + constructor + + + + + + encodes + + + + + + + Common string-related functions. + + Sean Owen + Alex Dupre + + + + default encoding of the current platform (name) + + + + + default encoding of the current platform (type) + + + + + Shift JIS encoding if available + + + + + GB 2312 encoding if available + + + + + ECU JP encoding if available + + + + + ISO8859-1 encoding if available + + + + + JIS_IS is supported or not + + + + + EUC_JP is supported or not + + + + + SJIS + + + + + GB2312 + + + + + EUC-JP + + + + + UTF-8 + + + + + ISO-8859-1 + + + + + Guesses the encoding. + + bytes encoding a string, whose encoding should be guessed + decode hints if applicable + name of guessed encoding; at the moment will only guess one of: + "SJIS", "UTF8", "ISO8859_1", or the platform default encoding if none + of these can possibly be correct + + + + bytes encoding a string, whose encoding should be guessed + decode hints if applicable + Charset of guessed encoding; at the moment will only guess one of: + {@link #SHIFT_JIS_CHARSET}, {@link StandardCharsets#UTF_8}, + {@link StandardCharsets#ISO_8859_1}, {@link StandardCharsets#UTF_16}, + or the platform default encoding if + none of these can possibly be correct + + + + This implementation can detect and decode Data Matrix codes in an image. + + bbrown@google.com (Brian Brown) + + + + + Locates and decodes a Data Matrix code in an image. + + + a String representing the content encoded by the Data Matrix code + + + + Locates and decodes a Data Matrix code in an image. + + + + a String representing the content encoded by the Data Matrix code + + + + does nothing here + + + + + This method detects a code in a "pure" image -- that is, pure monochrome image + which contains only an unrotated, unskewed, image of a code, with some white border + around it. This is a specialized method that works exceptionally fast in this special + case. + + + + + + + This object renders a Data Matrix code as a BitMatrix 2D array of greyscale values. + + dswitkin@google.com (Daniel Switkin) + Guillaume Le Biller Added to zxing lib. + + + + encodes the content to a BitMatrix + + + + + + + + + + encodes the content to a BitMatrix + + + + + + + + + + + Encode the given symbol info to a bit matrix. + + The DataMatrix placement. + The symbol info to encode. + + + + + The bit matrix generated. + + + + Convert the ByteMatrix to BitMatrix. + + The input matrix. + The requested width of the image (in pixels) with the Datamatrix code + The requested height of the image (in pixels) with the Datamatrix code + + + The output matrix. + + + + bbrown@google.com (Brian Brown) + + + + + to parse + if dimension is < 8 or > 144 or not 0 mod 2 + + + + +

Creates the version object based on the dimension of the original bit matrix from + the datamatrix code.

+ +

See ISO 16022:2006 Table 7 - ECC 200 symbol attributes

+ + Original including alignment patterns + encapsulating the Data Matrix Code's "version" + if the dimensions of the mapping matrix are not valid + Data Matrix dimensions. +
+
+ + +

Reads the bits in the representing the mapping matrix (No alignment patterns) + in the correct order in order to reconstitute the codewords bytes contained within the + Data Matrix Code.

+ + bytes encoded within the Data Matrix Code + if the exact number of bytes expected is not read +
+
+ + +

Reads a bit of the mapping matrix accounting for boundary wrapping.

+ + Row to read in the mapping matrix + Column to read in the mapping matrix + Number of rows in the mapping matrix + Number of columns in the mapping matrix + value of the given bit in the mapping matrix +
+
+ + +

Reads the 8 bits of the standard Utah-shaped pattern.

+ +

See ISO 16022:2006, 5.8.1 Figure 6

+ + Current row in the mapping matrix, anchored at the 8th bit (LSB) of the pattern + Current column in the mapping matrix, anchored at the 8th bit (LSB) of the pattern + Number of rows in the mapping matrix + Number of columns in the mapping matrix + byte from the utah shape +
+
+ + +

Reads the 8 bits of the special corner condition 1.

+ +

See ISO 16022:2006, Figure F.3

+ + Number of rows in the mapping matrix + Number of columns in the mapping matrix + byte from the Corner condition 1 +
+
+ + +

Reads the 8 bits of the special corner condition 2.

+ +

See ISO 16022:2006, Figure F.4

+ + Number of rows in the mapping matrix + Number of columns in the mapping matrix + byte from the Corner condition 2 +
+
+ + +

Reads the 8 bits of the special corner condition 3.

+ +

See ISO 16022:2006, Figure F.5

+ + Number of rows in the mapping matrix + Number of columns in the mapping matrix + byte from the Corner condition 3 +
+
+ + +

Reads the 8 bits of the special corner condition 4.

+ +

See ISO 16022:2006, Figure F.6

+ + Number of rows in the mapping matrix + Number of columns in the mapping matrix + byte from the Corner condition 4 +
+
+ + +

Extracts the data region from a that contains + alignment patterns.

+ + Original with alignment patterns + BitMatrix that has the alignment patterns removed +
+
+ + +

Encapsulates a block of data within a Data Matrix Code. Data Matrix Codes may split their data into + multiple blocks, each of which is a unit of data and error-correction codewords. Each + is represented by an instance of this class.

+ + bbrown@google.com (Brian Brown) +
+
+ + +

When Data Matrix Codes use multiple data blocks, they actually interleave the bytes of each of them. + That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This + method will separate the data into original blocks.

+ + bytes as read directly from the Data Matrix Code + version of the Data Matrix Code + DataBlocks containing original bytes, "de-interleaved" from representation in the + Data Matrix Code +
+
+ + +

Data Matrix Codes can encode text as bits in one of several modes, and can use multiple modes + in one Data Matrix Code. This class decodes the bits back into text.

+ +

See ISO 16022:2006, 5.2.1 - 5.2.9.2

+ + bbrown@google.com (Brian Brown) + Sean Owen +
+
+ + + See ISO 16022:2006, Annex C Table C.1 + The C40 Basic Character Set (*'s used for placeholders for the shift values) + + + + + See ISO 16022:2006, Annex C Table C.2 + The Text Basic Character Set (*'s used for placeholders for the shift values) + + + + + See ISO 16022:2006, 5.2.3 and Annex C, Table C.2 + + + + + See ISO 16022:2006, 5.2.5 and Annex C, Table C.1 + + + + + See ISO 16022:2006, 5.2.6 and Annex C, Table C.2 + + + + + See ISO 16022:2006, 5.2.7 + + + + + See ISO 16022:2006, 5.2.8 and Annex C Table C.3 + + + + + See ISO 16022:2006, 5.2.9 and Annex B, B.2 + + + + See ISO 16022:2007, 5.4.1 + + + + See ISO 16022:2006, Annex B, B.2 + + + + +

The main class which implements Data Matrix Code decoding -- as opposed to locating and extracting + the Data Matrix Code from an image.

+ + bbrown@google.com (Brian Brown) +
+
+ + + Initializes a new instance of the class. + + + + +

Convenience method that can decode a Data Matrix Code represented as a 2D array of booleans. + "true" is taken to mean a black module.

+ + booleans representing white/black Data Matrix Code modules + text and bytes encoded within the Data Matrix Code + if the Data Matrix Code cannot be decoded +
+
+ + +

Decodes a Data Matrix Code represented as a . A 1 or "true" is taken + to mean a black module.

+
+ booleans representing white/black Data Matrix Code modules + text and bytes encoded within the Data Matrix Code +
+ + + Given data and error-correction codewords received, possibly corrupted by errors, attempts to + correct the errors in-place using Reed-Solomon error correction. + data and error correction codewords + number of codewords that are data bytes + the number of errors corrected + + + + + The Version object encapsulates attributes about a particular + size Data Matrix Code. + + bbrown@google.com (Brian Brown) + + + + + returns the version numer + + + + + + returns the symbol size rows + + + + + + returns the symbols size columns + + + + + + retursn the data region size rows + + + + + + returns the data region size columns + + + + + + returns the total codewords count + + + + + +

Deduces version information from Data Matrix dimensions.

+ + Number of rows in modules + Number of columns in modules + Version for a Data Matrix Code of those dimensions + if dimensions do correspond to a valid Data Matrix size +
+
+ + +

Encapsulates a set of error-correction blocks in one symbol version. Most versions will + use blocks of differing sizes within one version, so, this encapsulates the parameters for + each set of blocks. It also holds the number of error-correction codewords per block since it + will be the same across all blocks within one version.

+
+
+ + +

Encapsulates the parameters for one error-correction block in one symbol version. + This includes the number of data codewords, and the number of times a block with these + parameters is used consecutively in the Data Matrix code version's format.

+
+
+ + + returns the version number as string + + + + + + See ISO 16022:2006 5.5.1 Table 7 + + + + +

Encapsulates logic that can detect a Data Matrix Code in an image, even if the Data Matrix Code + is rotated or skewed, or partially obscured.

+
+ Sean Owen +
+ + + Initializes a new instance of the class. + + The image. + + + +

Detects a Data Matrix Code in an image.

+
+ encapsulating results of detecting a Data Matrix Code or null +
+ + + Detect a solid side which has minimum transition. + + + + + + + Detect a second solid side next to first solid side. + + + + + + + Calculates the corner position of the white top right module. + + + + + + + Shift the edge points to the module center. + + + + + + + Counts the number of black/white transitions between two points, using something like Bresenham's algorithm. + + + + + + + + Handle "end of data" situations + + the encoder context + the buffer with the remaining encoded characters + + + + Symbol Character Placement Program. Adapted from Annex M.1 in ISO/IEC 16022:2000(E). + + + + + Main constructor + + the codewords to place + the number of columns + the number of rows + + + + num rows + + + + + num cols + + + + + bits + + + + + get a specific bit + + + + + + + + place + + + + + Places the 8 bits of a utah-shaped symbol character in ECC200. + + The row. + The col. + character position + + + + Handle "end of data" situations + + the encoder context + the buffer with the remaining encoded characters + + + + Enumeration for encodation types + + + + + ASCII + + + + + C40 + + + + + TEXT + + + + + X12 + + + + + EDIFACT + + + + + BASE256 + + + + + Error Correction Code for ECC200. + + + + + Lookup table which factors to use for which number of error correction codewords. + See FACTORS. + + + + + Precomputed polynomial factors for ECC 200. + + + + + Creates the ECC200 error correction for an encoded message. + + The codewords. + information about the symbol to be encoded + the codewords with interleaved error correction. + + + + DataMatrix ECC 200 data encoder following the algorithm described in ISO/IEC 16022:200(E) in + annex S. + + + + + Padding character + + + + + mode latch to C40 encodation mode + + + + + mode latch to Base 256 encodation mode + + + + + FNC1 Codeword + + + + + Structured Append Codeword + + + + + Reader Programming + + + + + Upper Shift + + + + + 05 Macro + + + + + 06 Macro + + + + + mode latch to ANSI X.12 encodation mode + + + + + mode latch to Text encodation mode + + + + + mode latch to EDIFACT encodation mode + + + + + ECI character (Extended Channel Interpretation) + + + + + Unlatch from C40 encodation + + + + + Unlatch from X12 encodation + + + + + 05 Macro header + + + + + 06 Macro header + + + + + Macro trailer + + + + + Performs message encoding of a DataMatrix message using the algorithm described in annex P + of ISO/IEC 16022:2000(E). + + the message + the encoded message (the char values range from 0 to 255) + + + + Performs message encoding of a DataMatrix message using the algorithm described in annex P + of ISO/IEC 16022:2000(E). + + the message + requested shape. May be {@code SymbolShapeHint.FORCE_NONE},{@code SymbolShapeHint.FORCE_SQUARE} or {@code SymbolShapeHint.FORCE_RECTANGLE}. + the minimum symbol size constraint or null for no constraint + the maximum symbol size constraint or null for no constraint + encoding mode to start with + the encoded message (the char values range from 0 to 255) + + + + Performs message encoding of a DataMatrix message using the algorithm described in annex P + of ISO/IEC 16022:2000(E). + + the message + requested shape. May be {@code SymbolShapeHint.FORCE_NONE},{@code SymbolShapeHint.FORCE_SQUARE} or {@code SymbolShapeHint.FORCE_RECTANGLE}. + the minimum symbol size constraint or null for no constraint + the maximum symbol size constraint or null for no constraint + encoding mode to start with + enforce C40 encoding + + + the encoded message (the char values range from 0 to 255) + + + + Determines the number of consecutive characters that are encodable using numeric compaction. + + the message + the start position within the message + the requested character count + + + + Encoder that encodes minimally + + Algorithm: + + Uses Dijkstra to produce mathematically minimal encodings that are in some cases smaller than the results produced + by the algorithm described in annex S in the specification ISO/IEC 16022:200(E). The biggest improvment of this + algorithm over that one is the case when the algorithm enters the most inefficient mode, the B256 mode.The + algorithm from the specification algorithm will exit this mode only if it encounters digits so that arbitrarily + inefficient results can be produced if the postfix contains no digits. + + Multi ECI support and ECI switching: + + For multi language content the algorithm selects the most compact representation using ECI modes.Note that unlike + the compaction algorithm used for QR-Codes, this implementation operates in two stages and therfore is not + mathematically optimal.In the first stage, the input string is encoded minimally as a stream of ECI character set + selectors and bytes encoded in the selected encoding.In this stage the algorithm might for example decide to + encode ocurrences of the characters "\u0150\u015C" (O-double-acute, S-circumflex) in UTF-8 by a single ECI or + alternatively by multiple ECIs that switch between IS0-8859-2 and ISO-8859-3 (e.g. in the case that the input + contains many * characters from ISO-8859-2 (Latin 2) and few from ISO-8859-3 (Latin 3)). + In a second stage this stream of ECIs and bytes is minimally encoded using the various Data Matrix encoding modes. + While both stages encode mathematically minimally it is not ensured that the result is mathematically minimal since + the size growth for inserting an ECI in the first stage can only be approximated as the first stage does not know + in which mode the ECI will occur in the second stage(may, or may not require an extra latch to ASCII depending on + the current mode). The reason for this shortcoming are difficulties in implementing it in a straightforward and + readable manner. + + GS1 support + + FNC1 delimiters can be encoded in the input string by using the FNC1 character specified in the encoding function. + When a FNC1 character is specified then a leading FNC1 will be encoded and all ocurrences of delimiter characters + while result in FNC1 codewords in the symbol. + + @author Alex Geller + + + + Performs message encoding of a DataMatrix message + + @param msg the message + @return the encoded message (the char values range from 0 to 255) + + + Performs message encoding of a DataMatrix message + + @param msg the message + @param priorityCharset The preferred {@link Charset}. When the value of the argument is null, the algorithm + chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority + charset to encode any character in the input that can be encoded by it if the charset is among the + supported charsets. + @param fnc1 denotes the character in the input that represents the FNC1 character or -1 if this is not a GS1 + bar code. If the value is not -1 then a FNC1 is also prepended. + @param shape requested shape. + @return the encoded message (the char values range from 0 to 255) + + + Encodes input minimally and returns an array of the codewords + + @param input The string to encode + @param priorityCharset The preferred {@link Charset}. When the value of the argument is null, the algorithm + chooses charsets that leads to a minimal representation. Otherwise the algorithm will use the priority + charset to encode any character in the input that can be encoded by it if the charset is among the + supported charsets. + @param fnc1 denotes the character in the input that represents the FNC1 character or -1 if this is not a GS1 + bar code. If the value is not -1 then a FNC1 is also prepended. + @param shape requested shape. + @param macroId Prepends the specified macro function in case that a value of 5 or 6 is specified. + @return An array of bytes representing the codewords of a minimal encoding. + + + @return the number of words in which the string starting at from can be encoded in c40 or text mode. + The number of characters encoded is returned in characterLength. + The number of characters encoded is also minimal in the sense that the algorithm stops as soon + as a character encoding fills a C40 word competely (three C40 values). An exception is at the + end of the string where two C40 values are allowed (according to the spec the third c40 value + is filled with 0 (Shift 1) in this case). + + + Returns Mode.ASCII in case that: + - Mode is EDIFACT and characterLength is less than 4 or the remaining characters can be encoded in at most 2 + ASCII bytes. + - Mode is C40, TEXT or X12 and the remaining characters can be encoded in at most 1 ASCII byte. + Returns mode in all other cases. + + + + Peeks ahead and returns 1 if the postfix consists of exactly two digits, 2 if the postfix consists of exactly + two consecutive digits and a non extended character or of 4 digits. + Returns 0 in any other case + + + + Returns the capacity in codewords of the smallest symbol that has enough capacity to fit the given minimal + number of codewords. + + + + Returns the remaining capacity in codewords of the smallest symbol that has enough capacity to fit the given + minimal number of codewords. + + + + @return the size in bytes + + + + Symbol info table for DataMatrix. + + + + + matrix width + + + + + matrix height + + + + Overrides the symbol info set used by this class. Used for testing purposes. + + @param override the symbol info set to use + + + + initializing constructor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + symbol data width + + + + + + symbol data height + + + + + + symbol width + + + + + + symbol height + + + + + + codeword count + + + + + + interleaved block count + + + + + + data length for interleaved block + + + + + + + error length for interleaved block + + + + + + + user friendly representation + + + + + + Enumeration for DataMatrix symbol shape hint. It can be used to force square or rectangular + symbols. + + + + + doesn't force anything + + + + + forces square image + + + + + forces rectangle image + + + + + The class holds the available options for the DatamatrixWriter + + + + + Specifies the matrix shape for Data Matrix + + + + + Specifies a minimum barcode size + + + + + Specifies a maximum barcode size + + + + + Specifies the default encodation + Make sure that the content fits into the encodation value, otherwise there will be an exception thrown. + standard value: Encodation.ASCII + + + + + Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false" + The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1 + character set via ECIs. + Please note that in that case, the most compact character encoding is chosen for characters in + the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not + support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by + means of the {@link #CHARACTER_SET} encoding hint. + Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case + group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords + for the purpose of delimiting AIs. + + + + + Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This + option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive. + + + + + Specifies what character encoding to use where applicable (type {@link String}) + + + + + Encapsulates a type of hint that a caller may pass to a barcode reader to help it + more quickly or accurately decode it. It is up to implementations to decide what, + if anything, to do with the information that is supplied. + + + Sean Owen + dswitkin@google.com (Daniel Switkin) + + + + Unspecified, application-specific hint. Maps to an unspecified . + + + + + Image is a pure monochrome image of a barcode. Doesn't matter what it maps to; + use = true. + + + + + Image is known to be of one of a few possible formats. + Maps to a of s. + + + + + Spend more time to try to find a barcode; optimize for accuracy, not speed. + Doesn't matter what it maps to; use = true. + + + + + Specifies what character encoding to use when decoding, where applicable (type String) + + + + + Allowed lengths of encoded data -- reject anything else. Maps to an int[]. + + + + + Assume Code 39 codes employ a check digit. Maps to . + + + + + The caller needs to be notified via callback when a possible + is found. Maps to a . + + + + + Assume MSI codes employ a check digit. Maps to . + + + + + if Code39 could be detected try to use extended mode for full ASCII character set + Maps to . + + + + + Don't fail if a Code39 is detected but can't be decoded in extended mode. + Return the raw Code39 result instead. Maps to . + + + + + 1D readers supporting rotation with TRY_HARDER enabled. + But BarcodeReader class can do auto-rotating for 1D and 2D codes. + Enabling that option prevents 1D readers doing double rotation. + BarcodeReader enables that option automatically if "global" auto-rotation is enabled. + Maps to . + + + + + Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed. + For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to; + use . + + + + + If true, return the start and end digits in a Codabar barcode instead of stripping them. They + are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them + to not be. Doesn't matter what it maps to; use . + + + + + Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this. + Maps to an int[] of the allowed extension lengths, for example [2], [5], or [2, 5]. + If it is optional to have an extension, do not set this hint. If this is set, + and a UPC or EAN barcode is found but an extension is not, then no result will be returned + at all. + + + + + If true, also tries to decode as inverted image. All configured decoders are simply called a + second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}. + + + + + Simply encapsulates a width and height. + + + + + initializing constructor + + + + + + + the width + + + + + the height + + + + + + + + + + + + + + + + + + + + + + + + These are a set of hints that you may pass to Writers to specify their behavior. + + dswitkin@google.com (Daniel Switkin) + + + + Specifies the width of the barcode image + type: + + + + + Specifies the height of the barcode image + type: + + + + + Don't put the content string into the output image. + type: + + + + + Specifies what degree of error correction to use, for example in QR Codes. + Type depends on the encoder. For example for QR codes it's type + + For Aztec it is of type , representing the minimal percentage of error correction words. + In all cases, it can also be a representation of the desired value as well. + Note: an Aztec symbol should have a minimum of 25% EC words. + For PDF417 it is of type or (between 0 and 8), + + + + + Specifies what character encoding to use where applicable. + type: + + + + + Specifies margin, in pixels, to use when generating the barcode. The meaning can vary + by format; for example it controls margin before and after the barcode horizontally for + most 1D formats. + type: , or representation of the integer value + + + + + Specifies the aspect ratio to use. Default is 4. + type: , or 1-4. + + + + + Specifies the desired aspect ratio (number of columns / number of rows) of the output image. Default is 3. + type: . + + + + + Specifies whether to use compact mode for PDF417 + type: , or "true" or "false" + value + + + + + Specifies what compaction mode to use for PDF417. + type: or value of one of its + enum values + + + + + Specifies the minimum and maximum number of rows and columns for PDF417. + type: + + + + + The Specifies that the PDF417 will contain macro metadata. + type: + + + + + Don't append ECI segment. + That is against the specification of QR Code but some + readers have problems if the charset is switched from + ISO-8859-1 (default) to UTF-8 with the necessary ECI segment. + If you set the property to true you can use UTF-8 encoding + and the ECI segment is omitted. + type: + + + + + Specifies the matrix shape for Data Matrix (type ) + + + + + Specifies a minimum barcode size (type ). Only applicable to Data Matrix now. + + + + + Specifies a maximum barcode size (type ). Only applicable to Data Matrix now. + + + + + if true, don't switch to codeset C for numbers + + + + + Specifies the default encodation for Data Matrix (type ) + Make sure that the content fits into the encodation value, otherwise there will be an exception thrown. + standard value: Encodation.ASCII + + + + + Specifies the required number of layers for an Aztec code. + A negative number (-1, -2, -3, -4) specifies a compact Aztec code + 0 indicates to use the minimum number of layers (the default) + A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code + type: , or representation of the integer value + + + + + Specifies the exact version of QR code to be encoded. + (Type , or representation of the integer value). + + + + + Specifies whether the data should be encoded to the GS1 standard + type: , or "true" or "false" + value + + + + + Specifies the QR code mask pattern to be used. Allowed values are + 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select + the optimal mask pattern. + (Type , or representation of the integer value). + + + + + Forces which encoding will be used. Currently only used for Code-128 code sets (Type ). + Valid values are "A", "B", "C". + see also CODE128_FORCE_CODESET_B + This option and {@link #CODE128_COMPACT} are mutually exclusive. + + + + + Specifies whether to use compact mode for QR code (type , or "true" or "false" + Please note that when compaction is performed, the most compact character encoding is chosen + for characters in the input that are not in the ISO-8859-1 character set. Based on experience, + some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can + be forced to UTF-8 by means of the encoding hint. + + + + + if set to true, barcode writer uses WIDTH and HEIGHT as maximum values and in combination with MARGIN=0 + there is no white border added. The resulting image would be smaller than the requested size. + + + + + Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false" + The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1 + character set via ECIs. + Please note that in that case, the most compact character encoding is chosen for characters in + the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not + support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by + means of the {@link #CHARACTER_SET} encoding hint. + Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case + group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords + for the purpose of delimiting AIs. + This option and {@link #FORCE_C40} are mutually exclusive. + + + + + Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false" + This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually + exclusive options. + + + + + Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This + option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive. + + + + + Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false" + {@link String} value). + Please note that in that case, the most compact character encoding is chosen for characters in + the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not + support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by + means of the {@link #CHARACTER_SET} encoding hint. + + + + + Thrown when a barcode was successfully detected, but some aspect of + the content did not conform to the barcode's format rules. This could have + been due to a mis-detection. + Sean Owen + + + + + + + + + + + + + + + + + + + + + + + + + Interface for a smart class to decode the barcode inside a bitmap object + + + Interface for a smart class to decode the barcode inside a bitmap object + + + Interface for a smart class to decode multiple barcodes inside a bitmap object + + + Interface for a smart class to decode multiple barcodes inside a bitmap object + + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + event is executed when a result point was found + + + + + event is executed when a result was found via decode + + + + + Specifies some options which influence the decoding process + + + + + Decodes the specified barcode bitmap which is given by a generic byte array with the order RGB24. + + The image as RGB24 array. + The width. + The height. + The format. + + the result data or null + + + + + Tries to decode a barcode within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + Decodes the specified barcode bitmap which is given by a generic byte array with the order RGB24. + + The image as RGB24 array. + The width. + The height. + The format. + + the result data or null + + + + + Tries to decode barcodes within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + Interface for a smart class to decode the barcode inside a bitmap object + + + Interface for a smart class to decode multiple barcodes inside a bitmap object + + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + Decodes the specified barcode bitmap. + + The barcode bitmap. + the result data or null + + + + Interface for a smart class to decode the barcode inside a bitmap object + + + Interface for a smart class to decode multiple barcodes inside a bitmap object + + + + + event is executed when a result point was found + + + + + event is executed when a result was found via decode + + + + + Specifies some options which influence the decoding process + + + + + Decodes the specified barcode bitmap which is given by a generic byte array. + + The barcode bitmap. + The width. + The height. + The format. + + the result data or null + + + + + Tries to decode a barcode within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + Decodes the specified barcode bitmap which is given by a generic byte array with the order RGB24. + + The barcode bitmap. + The width. + The height. + The format. + + the result data or null + + + + + Tries to decode barcodes within an image which is given by a luminance source. + That method gives a chance to prepare a luminance source completely before calling + the time consuming decoding method. On the other hand there is a chance to create + a luminance source which is independent from external resources (like Bitmap objects) + and the decoding call can be made in a background thread. + + The luminance source. + + + + + Interface for a smart class to encode some content into a barcode + + + Interface for a smart class to encode some content into a barcode + + + + + Creates a visual representation of the contents + + + + + Returns a rendered instance of the barcode which is given by a BitMatrix. + + + + + Get or sets the barcode format which should be generated + (only suitable if MultiFormatWriter is used for property Encoder which is the default) + + + + + Gets or sets the options container for the encoding and renderer process. + + + + + Gets or sets the writer which encodes the content to a BitMatrix. + If no value is set the MultiFormatWriter is used. + + + + + Encodes the specified contents. + + The contents. + + + + + Interface for a smart class to encode some content into a barcode + + + + + Creates a visual representation of the contents + + + + + Returns a rendered instance of the barcode which is given by a BitMatrix. + + + + + Interface for a smart class to encode some content into a barcode + + + + + Creates a visual representation of the contents + + + + + Returns a rendered instance of the barcode which is given by a BitMatrix. + + + + + Interface for a smart class to encode some content into a barcode + + + + + Creates a visual representation of the contents + + The contents. + + + + + Returns a rendered instance of the barcode which is given by a BitMatrix. + + The matrix. + + + + + Interface for a smart class to encode some content into a barcode + + + + + Get or sets the barcode format which should be generated + (only suitable if MultiFormatWriter is used for property Encoder which is the default) + + + + + Gets or sets the options container for the encoding and renderer process. + + + + + Gets or sets the writer which encodes the content to a BitMatrix. + If no value is set the MultiFormatWriter is used. + + + + + Encodes the specified contents. + + The contents. + + + + + implements an Intelligent Mail barcode + Rishabh Hatgadkar + + + + + decode the image + + + + + + + + resets internal state + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + A wrapper implementation of {@link LuminanceSource} which inverts the luminances it returns -- black becomes + white and vice versa, and each value becomes (255-value). + + Sean Owen + + + + Initializes a new instance of the class. + + The @delegate. + + + + Fetches one row of luminance data from the underlying platform's bitmap. Values range from + 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have + to bitwise and with 0xff for each value. It is preferable for implementations of this method + to only fetch this row rather than the whole image, since no 2D Readers may be installed and + getMatrix() may never be called. + + The row to fetch, 0 <= y < Height. + An optional preallocated array. If null or too small, it will be ignored. + Always use the returned object, and ignore the .length of the array. + + An array containing the luminance data. + + + + + Fetches luminance data for the underlying bitmap. Values should be fetched using: + int luminance = array[y * width + x] & 0xff; + + A row-major 2D array of luminance values. Do not use result.length as it may be + larger than width * height bytes on some platforms. Do not modify the contents + of the result. + + + + + + Whether this subclass supports cropping. + + + + Returns a new object with cropped image data. Implementations may keep a reference to the + original data rather than a copy. Only callable if CropSupported is true. + + The left coordinate, 0 <= left < Width. + The top coordinate, 0 <= top <= Height. + The width of the rectangle to crop. + The height of the rectangle to crop. + + A cropped version of this object. + + + + + + Whether this subclass supports counter-clockwise rotation. + + + + Inverts this instance. + + original delegate {@link LuminanceSource} since invert undoes itself + + + + Returns a new object with rotated image data by 90 degrees counterclockwise. + Only callable if {@link #isRotateSupported()} is true. + + + A rotated version of this object. + + + + + Returns a new object with rotated image data by 45 degrees counterclockwise. + Only callable if {@link #isRotateSupported()} is true. + + + A rotated version of this object. + + + + + The purpose of this class hierarchy is to abstract different bitmap implementations across + platforms into a standard interface for requesting greyscale luminance values. The interface + only provides immutable methods; therefore crop and rotation create copies. This is to ensure + that one Reader does not modify the original luminance source and leave it in an unknown state + for other Readers in the chain. + + dswitkin@google.com (Daniel Switkin) + + + + initializing constructor + + + + + + + Fetches one row of luminance data from the underlying platform's bitmap. Values range from + 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have + to bitwise and with 0xff for each value. It is preferable for implementations of this method + to only fetch this row rather than the whole image, since no 2D Readers may be installed and + getMatrix() may never be called. + + The row to fetch, which must be in [0, bitmap height) + An optional preallocated array. If null or too small, it will be ignored. + Always use the returned object, and ignore the .length of the array. + + An array containing the luminance data. + + + + Fetches luminance data for the underlying bitmap. Values should be fetched using: + int luminance = array[y * width + x] & 0xff + + + A row-major 2D array of luminance values. Do not use result.length as it may be + larger than width * height bytes on some platforms. Do not modify the contents + of the result. + + + + The width of the bitmap. + + + The height of the bitmap. + + + Whether this subclass supports cropping. + + + + Returns a new object with cropped image data. Implementations may keep a reference to the + original data rather than a copy. Only callable if CropSupported is true. + + The left coordinate, which must be in [0, Width) + The top coordinate, which must be in [0, Height) + The width of the rectangle to crop. + The height of the rectangle to crop. + A cropped version of this object. + + + Whether this subclass supports counter-clockwise rotation. + + + + Returns a new object with rotated image data by 90 degrees counterclockwise. + Only callable if is true. + + A rotated version of this object. + + + + Returns a new object with rotated image data by 45 degrees counterclockwise. + Only callable if is true. + + A rotated version of this object. + + + + + Whether this subclass supports invertion. + + + + inverts the luminance values, not supported here. has to implemented in sub classes + + + + + + + + + + + + mike32767 + Manuel Kasten + + + + + to parse + + + + +

MaxiCodes can encode text or structured information as bits in one of several modes, + with multiple character sets in one code. This class decodes the bits back into text.

+ + mike32767 + Manuel Kasten +
+
+ + +

The main class which implements MaxiCode decoding -- as opposed to locating and extracting + the MaxiCode from an image.

+ + Manuel Kasten +
+
+ + + constructor + + + + + decode the bits + + + + + + + decode the bits + + + + + + + + This implementation can detect and decode a MaxiCode in an image. + + + + + Locates and decodes a MaxiCode in an image. + + a String representing the content encoded by the MaxiCode + if a MaxiCode cannot be decoded + + + + + Locates and decodes a MaxiCode within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + does nothing here + + + + + This method detects a code in a "pure" image -- that is, pure monochrome image + which contains only an unrotated, unskewed, image of a code, with some white border + around it. This is a specialized method that works exceptionally fast in this special + case. + + + + + + + + MultiFormatReader is a convenience class and the main entry point into the library for most uses. + By default it attempts to decode all barcode formats that the library supports. Optionally, you + can provide a hints object to request different behavior, for example only decoding QR codes. + + Sean Owen + dswitkin@google.com (Daniel Switkin) + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + This version of decode honors the intent of Reader.decode(BinaryBitmap) in that it + passes null as a hint to the decoders. However, that makes it inefficient to call repeatedly. + Use setHints() followed by decodeWithState() for continuous scan applications. + + + The pixel data to decode + + The contents of the image + + ReaderException Any errors which occurred + + + Decode an image using the hints provided. Does not honor existing state. + + + The pixel data to decode + + The hints to use, clearing the previous state. + + The contents of the image + + ReaderException Any errors which occurred + + + Decode an image using the state set up by calling setHints() previously. Continuous scan + clients will get a large speed increase by using this instead of decode(). + + + The pixel data to decode + + The contents of the image + + ReaderException Any errors which occurred + + + This method adds state to the MultiFormatReader. By setting the hints once, subsequent calls + to decodeWithState(image) can reuse the same set of readers without reallocating memory. This + is important for performance in continuous scan clients. + + + + + + resets all specific readers + + + + This is a factory class which finds the appropriate Writer subclass for the BarcodeFormat + requested and encodes the barcode with the supplied contents. + + + dswitkin@google.com (Daniel Switkin) + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Gets the collection of supported writers. + + + + + encode the given data + + + + + + + + + + encode the given data + + + + + + + + + + + This class attempts to decode a barcode from an image, not by scanning the whole image, + but by scanning subsets of the image. This is important when there may be multiple barcodes in + an image, and detecting a barcode may find parts of multiple barcode and fail to decode + (e.g. QR Codes). Instead this scans the four quadrants of the image -- and also the center + 'quadrant' to cover the case where a barcode is found in the center. + + + + + + Initializes a new instance of the class. + + The @delegate. + + + + Locates and decodes a barcode in some format within an image. + + image of barcode to decode + + String which the barcode encodes + + + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + +

Attempts to locate multiple barcodes in an image by repeatedly decoding portion of the image. + After one barcode is found, the areas left, above, right and below the barcode's + {@link com.google.zxing.ResultPoint}s are scanned, recursively.

+

A caller may want to also employ {@link ByQuadrantReader} when attempting to find multiple + 2D barcodes, like QR Codes, in an image, where the presence of multiple barcodes might prevent + detecting any one of them.

+

That is, instead of passing a {@link Reader} a caller might pass + new ByQuadrantReader(reader).

+ Sean Owen +
+
+ + + Initializes a new instance of the class. + + The @delegate. + + + + Decodes the multiple. + + The image. + + + + + Decodes the multiple. + + The image. + The hints. + + + + + Locates and decodes a barcode in some format within an image. + + image of barcode to decode + + String which the barcode encodes + + + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + Implementation of this interface attempt to read several barcodes from one image. + Sean Owen + + + + + + Decodes the multiple. + + The image. + + + + + Decodes the multiple. + + The image. + The hints. + + + + +

Encapsulates logic that can detect one or more QR Codes in an image, even if the QR Code + is rotated or skewed, or partially obscured.

+ + Sean Owen + Hannes Erven +
+
+ + + Initializes a new instance of the class. + + The image. + + + + Detects the multi. + + The hints. + + + + +

This class attempts to find finder patterns in a QR Code. Finder patterns are the square + markers at three corners of a QR Code.

+ +

This class is thread-safe but not reentrant. Each thread must allocate its own object.

+ +

In contrast to , this class will return an array of all possible + QR code locations in the image.

+ +

Use the TRY_HARDER hint to ask for a more thorough detection.

+ + Sean Owen + Hannes Erven +
+
+ + + More or less arbitrary cutoff point for determining if two finder patterns might belong + to the same code if they differ less than DIFF_MODSIZE_CUTOFF_PERCENT percent in their + estimated modules sizes. + + + + + More or less arbitrary cutoff point for determining if two finder patterns might belong + to the same code if they differ less than DIFF_MODSIZE_CUTOFF pixels/module in their + estimated modules sizes. + + + + + A comparator that orders FinderPatterns by their estimated module size. + + + + +

Creates a finder that will search the image for three finder patterns.

+ + image to search + callback for result points +
+
+ + + + the 3 best s from our list of candidates. The "best" are + those that have been detected at least CENTER_QUORUM times, and whose module + size differs from the average among those patterns the least + + + + + try to find patterns + + + + + + + This implementation can detect and decode multiple QR Codes in an image. + + + + + Decodes the multiple. + + The image. + + + + + Decodes the multiple. + + The image. + The hints. + + + + + for compatibility with .net 4.0 + + + + + for compatibility with .net 4.0 + + The type of the 1. + The param1. + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The param1. + The param2. + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The type of the 3. + The param1. + The param2. + The param3. + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The type of the 3. + The type of the 4. + The param1. + The param2. + The param3. + The param4. + + + + for compatibility with .net 4.0 + + The type of the result. + + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the result. + The param1. + + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The type of the result. + The param1. + The param2. + + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The type of the 3. + The type of the result. + The param1. + The param2. + The param3. + + + + + for compatibility with .net 4.0 + + The type of the 1. + The type of the 2. + The type of the 3. + The type of the 4. + The type of the result. + The param1. + The param2. + The param3. + The param4. + + + + +

Decodes Codabar barcodes.

+ + Bas Vijfwinkel +
+
+ + These represent the encodings of characters, as patterns of wide and narrow bars. The 7 least-significant bits of + each int correspond to the pattern of wide and narrow, with 1s representing "wide" and 0s representing narrow. + + + + + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + Records the size of all runs of white and black pixels, starting with white. + This is just like recordPattern, except it records all the counters, and + uses our builtin "counters" member for storage. + + row to count from + + + + This class renders CodaBar as []. + + dsbnatut@gmail.com (Kazuki Nishiura) + + + + returns supported formats + + + + + encodes the content + + + + + + + The class holds the available options for the Code128 1D Writer + + + + + if true, don't switch to codeset C for numbers + + + + + Forces which encoding will be used. Currently only used for Code-128 code sets (Type ). Valid values are "A", "B", "C". + + + + + Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false" + This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually + exclusive options. + + + + + avaiable codesets + + + + + none specified + + + + + Codeset A + + + + + Codeset B + + + + + Codeset C + + + + +

Decodes Code 128 barcodes.

+ + Sean Owen +
+
+ + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + This object renders a CODE128 code as a . + + erik.barbara@gmail.com (Erik Barbara) + + + + + returns supported formats + + + + + Encode the contents following specified format. + + + + + starts encoding + + + + + + + Encodes minimally using Divide-And-Conquer with Memoization + + + + Encode the string starting at position position starting with the character set charset + + + + +

Decodes Code 39 barcodes. Supports "Full ASCII Code 39" if USE_CODE_39_EXTENDED_MODE is set.

+ Sean Owen + @see Code93Reader +
+
+ + + Returns a string with all possible characters + + + + + These represent the encodings of characters, as patterns of wide and narrow bars. + The 9 least-significant bits of each int correspond to the pattern of wide and narrow, + with 1s representing "wide" and 0s representing narrow. + + + + + Creates a reader that assumes all encoded data is data, and does not treat the final + character as a check digit. It will not decoded "extended Code 39" sequences. + + + + + Creates a reader that can be configured to check the last character as a check digit. + It will not decoded "extended Code 39" sequences. + + if true, treat the last data character as a check digit, not + data, and verify that the checksum passes. + + + + Creates a reader that can be configured to check the last character as a check digit, + or optionally attempt to decode "extended Code 39" sequences that are used to encode + the full ASCII character set. + + if true, treat the last data character as a check digit, not + data, and verify that the checksum passes. + if true, will attempt to decode extended Code 39 sequences in the text. + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + containing encoded string and start/end of barcode +
+ + + This object renders a CODE39 code as a . + erik.barbara@gmail.com (Erik Barbara) + + + + + returns supported formats + + + + + Encode the contents to byte array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + a {@code boolean[]} of horizontal pixels (false = white, true = black) + + + + + + +

Decodes Code 93 barcodes.

+ Sean Owen + +
+
+ + + These represent the encodings of characters, as patterns of wide and narrow bars. + The 9 least-significant bits of each int correspond to the pattern of wide and narrow. + + + + + Initializes a new instance of the class. + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + containing encoded string and start/end of barcode +
+ + + This object renders a CODE93 code as a BitMatrix + + + + + returns supported formats + + + + + + barcode contents to encode.It should not be encoded for extended characters. + a { @code bool[]} of horizontal pixels(false = white, true = black) + + + + + output to append to + start position + pattern to append + unused + 9 + + + +

Implements decoding of the EAN-13 format.

+ + dswitkin@google.com (Daniel Switkin) + Sean Owen + alasdair@google.com (Alasdair Mackintosh) +
+
+ + + Initializes a new instance of the class. + + + + + Subclasses override this to decode the portion of a barcode between the start + and end guard patterns. + + row of black/white values to search + start/end offset of start guard pattern + to append decoded chars to + + horizontal offset of first pixel after the "middle" that was decoded or -1 if decoding could not complete successfully + + + + + Get the format of this decoder. + The 1D format. + + + + + Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded + digits in a barcode, determines the implicitly encoded first digit and adds it to the + result string. + + string to insert decoded first digit into + int whose bits indicates the pattern of odd/even L/G patterns used to + encode digits + -1 if first digit cannot be determined + + + + This object renders an EAN13 code as a . + aripollak@gmail.com (Ari Pollak) + + + + + returns supported formats + + + + + Encode the contents to byte array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + a {@code boolean[]} of horizontal pixels (false = white, true = black) + + + + + + +

Implements decoding of the EAN-8 format.

+ Sean Owen +
+
+ + + Initializes a new instance of the class. + + + + + Decodes the middle. + + The row. + The start range. + The result. + + + + + Get the format of this decoder. + The 1D format. + + + + + This object renders an EAN8 code as a . + aripollak@gmail.com (Ari Pollak) + + + + + returns supported formats + + + + + + + a byte array of horizontal pixels (false = white, true = black) + + + + + Records EAN prefix to GS1 Member Organization, where the member organization + correlates strongly with a country. This is an imperfect means of identifying + a country of origin by EAN-13 barcode value. See + + http://en.wikipedia.org/wiki/List_of_GS1_country_codes. + + Sean Owen + + + + +

Implements decoding of the ITF format, or Interleaved Two of Five.

+ +

This Reader will scan ITF barcodes of certain lengths only. + At the moment it reads length 6, 8, 10, 12, 14, 16, 18, 20, 24, 44 and 48 as these have appeared "in the wild". Not all + lengths are scanned, especially shorter ones, to avoid false positives. This in turn is due to a lack of + required checksum function.

+ +

The checksum is optional and is not applied by this Reader. The consumer of the decoded + value will have to apply a checksum if required.

+ +

http://en.wikipedia.org/wiki/Interleaved_2_of_5 + is a great reference for Interleaved 2 of 5 information.

+ + kevin.osullivan@sita.aero, SITA Lab. +
+
+ + + Valid ITF lengths. Anything longer than the largest value is also allowed. + + + + + Start/end guard pattern. + + Note: The end pattern is reversed because the row is reversed before + searching for the END_PATTERN + + + + + Patterns of Wide / Narrow lines to indicate each digit + + + + + Attempts to decode a one-dimensional barcode format given a single row of + an image. + + row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode + + + + + + row of black/white values to search + offset of start pattern + The payload end. + to append decoded chars to + + false, if decoding could not complete successfully + + + + + Identify where the start of the middle / payload section starts. + + row of black/white values to search + Array, containing index of start of 'start block' and end of 'start block' + + + + The start & end patterns must be pre/post fixed by a quiet zone. This + zone must be at least 10 times the width of a narrow line. Scan back until + we either get to the start of the barcode or match the necessary number of + quiet zone pixels. + + Note: Its assumed the row is reversed when using this method to find + quiet zone after the end pattern. + + ref: http://www.barcode-1.net/i25code.html + + bit array representing the scanned barcode. + index into row of the start or end pattern. + false, if the quiet zone cannot be found + + + + Skip all whitespace until we get to the first black line. + + row of black/white values to search + index of the first black line or -1 if no black lines are found in the row. + + + + Identify where the end of the middle / payload section ends. + + row of black/white values to search + Array, containing index of start of 'end block' and end of 'end + block' or null, if nothing found + + + + + row of black/white values to search + position to start search + pattern of counts of number of black and white pixels that are being searched for as a pattern + start/end horizontal offset of guard pattern, as an array of two ints + + + + Attempts to decode a sequence of ITF black/white lines into single + digit. + + the counts of runs of observed black/white/black/... values + The decoded digit + + false, if digit cannot be decoded + + + + + This object renders a ITF code as a . + + erik.barbara@gmail.com (Erik Barbara) + + + + + returns supported formats + + + + + Encode the contents to bool array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + a {@code bool[]} of horizontal pixels (false = white, true = black) + + + + + + + Decodes MSI barcodes. + + + + + These represent the encodings of characters, as patterns of wide and narrow bars. + The 9 least-significant bits of each int correspond to the pattern of wide and narrow, + with 1s representing "wide" and 0s representing narrow. + + + + + Creates a reader that assumes all encoded data is data, and does not treat the final + character as a check digit. + + + + + Creates a reader that can be configured to check the last character as a check digit, + + if true, treat the last data character as a check digit, not + data, and verify that the checksum passes. + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + containing encoded string and start/end of barcode +
+ + + This object renders a MSI code as a . + + + + + returns supported formats + + + + + Encode the contents to byte array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + a {@code boolean[]} of horizontal pixels (false = white, true = black) + + + + + + + dswitkin@google.com (Daniel Switkin) + Sean Owen + + + + + Initializes a new instance of the class. + + The hints. + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + +

A reader that can read all available UPC/EAN formats. If a caller wants to try to + read all such formats, it is most efficient to use this implementation rather than invoke + individual readers.

+ Sean Owen +
+
+ + + Initializes a new instance of the class. + + The hints. + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null if an error occurs or barcode cannot be found + +
+ + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + +

Encapsulates functionality and implementation that is common to one-dimensional barcodes.

+ dsbnatut@gmail.com (Kazuki Nishiura) +
+
+ + + returns supported formats + + + + + Encode the contents to boolean array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + + barcode contents to encode + a bool[] of horizontal pixels (false = white, true = black) + + + + Can be overwritten if the encode requires to read the hints map. Otherwise it defaults to {@code encode}. + + barcode contents to encode + encoding hints + a bool[] of horizontal pixels (false = white, true = black) + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + Encode the contents following specified format. + {@code width} and {@code height} are required size. This method may return bigger size + {@code BitMatrix} when specified size is too small. The user can set both {@code width} and + {@code height} to zero to get minimum size barcode. If negative value is set to {@code width} + or {@code height}, {@code IllegalArgumentException} is thrown. + + + + + + a byte array of horizontal pixels (0 = white, 1 = black) + + + + Throw ArgumentException if input contains characters other than digits 0-9. + + string to check for numeric characters + if input contains characters other than digits 0-9. + + + + Appends the given pattern to the target array starting at pos. + + encode black/white pattern into this array + position to start encoding at in target + lengths of black/white runs to encode + starting color - false for white, true for black + the number of elements added to target. + + + + Gets the default margin. + + + + + Calculates the checksum digit modulo10. + + The contents. + + + + + Encapsulates functionality and implementation that is common to all families + of one-dimensional barcodes. + dswitkin@google.com (Daniel Switkin) + Sean Owen + + + + + + + + + + + + + + + Locates and decodes a barcode in some format within an image. + + image of barcode to decode + + String which the barcode encodes + + + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + Note that we don't try rotation without the try harder flag, even if rotation was supported. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + We're going to examine rows from the middle outward, searching alternately above and below the + middle, and farther out each time. rowStep is the number of rows between each successive + attempt above and below the middle. So we'd scan row middle, then middle - rowStep, then + middle + rowStep, then middle - (2 * rowStep), etc. + rowStep is bigger as the image is taller, but is always at least 1. We've somewhat arbitrarily + decided that moving up and down by about 1/16 of the image is pretty good; we try more of the + image if "trying harder". + + The image to decode + Any hints that were requested + The contents of the decoded barcode + + + + Records the size of successive runs of white and black pixels in a row, starting at a given point. + The values are recorded in the given array, and the number of runs recorded is equal to the size + of the array. If the row starts on a white pixel at the given start point, then the first count + recorded is the run of white pixels starting from that point; likewise it is the count of a run + of black pixels if the row begin on a black pixels at that point. + + row to count from + offset into row to start at + array into which to record counts + + + + Records the size of successive runs of white and black pixels in a row, starting at a given point. + The values are recorded in the given array, and the number of runs recorded is equal to the size + of the array. If the row starts on a white pixel at the given start point, then the first count + recorded is the run of white pixels starting from that point; likewise it is the count of a run + of black pixels if the row begin on a black pixels at that point. + + row to count from + offset into row to start at + array into which to record counts + + + + + Records the pattern in reverse. + + The row. + The start. + The counters. + + + + + Determines how closely a set of observed counts of runs of black/white values matches a given + target pattern. This is reported as the ratio of the total variance from the expected pattern + proportions across all pattern elements, to the length of the pattern. + + observed counters + expected pattern + The most any counter can differ before we give up + ratio of total variance between counters and pattern compared to total pattern size, + where the ratio has been multiplied by 256. So, 0 means no variance (perfect match); 256 means + the total variance between counters and patterns equals the pattern length, higher values mean + even more variance + + + + Attempts to decode a one-dimensional barcode format given a single row of + an image. + + row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode + + + + +

Decodes PharmaCode

+ * @author Ruslan Karachun +
+
+ + + + + + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + This object renders a Plessey code as a . + + + + + returns the list of supported formats + + + + + Encode the contents to byte array expression of one-dimensional barcode. + Start code and end code should be included in result, and side margins should not be included. + a {@code boolean[]} of horizontal pixels (false = white, true = black) + + + + + + + Superclass of implementations that read barcodes in the RSS family of formats. + + + + Minimum ratio 10:12 (minus 0.5 for variance), from section 7.2.7 of ISO/IEC 24724:2006. + + + Maximum ratio 12:14 (plus 0.5 for variance), from section 7.2.7 of ISO/IEC 24724:2006. + + + + Initializes a new instance of the class. + + + + + Gets the decode finder counters. + + + + + + Gets the data character counters. + + + + + + Gets the odd rounding errors. + + + + + + Gets the even rounding errors. + + + + + + Gets the odd counts. + + + + + + Gets the even counts. + + + + + + Parses the finder value. + + The counters. + The finder patterns. + The value. + + + + + Counts the specified array. + + The array. + + + + + Increments the specified array. + + The array. + The errors. + + + + Decrements the specified array. + + The array. + The errors. + + + + Determines whether [is finder pattern] [the specified counters]. + + The counters. + + true if [is finder pattern] [the specified counters]; otherwise, false. + + + + + Encapsulates a since character value in an RSS barcode, including its checksum information. + + + + + Gets the value. + + + + + Gets the checksum portion. + + + + + Initializes a new instance of the class. + + The value. + The checksum portion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Gets the information. + + + + + + Parses the information. + + + + + + Creates the decoder. + + The information. + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + + + + + One row of an RSS Expanded Stacked symbol, consisting of 1+ expanded pairs. + + + + + Two rows are equal if they contain the same pairs in the same order. + + + + + Pablo Orduña, University of Deusto (pablo.orduna@deusto.es) + Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es) + + + + Finder pattern element widths, from section 7.2.7 of ISO/IEC 24724:2006. + + + The element weights used in the checksum calculation, from section 7.2.6 of ISO/IEC 24724:2006. + + + The possible finder pattern sequences, from section 7.2.7 of ISO/IEC 24724:2006. + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + Resets this instance. + + + + + Whether the pairs form a valid finder pattern sequence, either complete or a prefix + + + + + + + + Whether the pairs, plus another pair of the specified type, would together + form a valid finder pattern sequence, either complete or partial + + + + + + + + Encapsulates an RSS barcode finder pattern, including its start/end position and row. + + + + + Gets the value. + + + + + Gets the start end. + + + + + Gets the result points. + + + + + Initializes a new instance of the class. + + The value. + The start end. + The start. + The end. + The row number. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Decodes RSS-14, including truncated and stacked variants. See ISO/IEC 24724:2006. + + + + + Initializes a new instance of the class. + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + Resets this instance. + + + + + Adapted from listings in ISO/IEC 24724 Appendix B and Appendix G. + + + + + Gets the RS svalue. + + The widths. + Width of the max. + if set to true [no narrow]. + + + + +

Implements decoding of the UPC-A format.

+ dswitkin@google.com (Daniel Switkin) + Sean Owen +
+
+ + +

Like decodeRow(int, BitArray, java.util.Map), but + allows caller to inform method about where the UPC/EAN start pattern is + found. This allows this to be computed once and reused across many implementations.

+
+ + + + + +
+ + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + + Decodes the specified image. + + The image. + The hints. + + + + + Get the format of this decoder. + The 1D format. + + + + + Subclasses override this to decode the portion of a barcode between the start + and end guard patterns. + + row of black/white values to search + start/end offset of start guard pattern + to append decoded chars to + + horizontal offset of first pixel after the "middle" that was decoded or -1 if decoding could not complete successfully + + + + + This object renders a UPC-A code as a . + qwandor@google.com (Andrew Walbran) + + + + + Gets the default margin. + + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + @see UPCEANExtension5Support + + + + + Parses the extension string. + + raw content of extension + formatted interpretation of raw content as a {@link Map} mapping + + + @see UPCEANExtension2Support + + + + Parses the extension string. + + raw content of extension + formatted interpretation of raw content as a {@link Map} mapping + one {@link ResultMetadataType} to appropriate value, or {@code null} if not known + + + +

Encapsulates functionality and implementation that is common to UPC and EAN families + of one-dimensional barcodes.

+ dswitkin@google.com (Daniel Switkin) + Sean Owen + alasdair@google.com (Alasdair Mackintosh) +
+
+ + + Start/end guard pattern. + + + + + Pattern marking the middle of a UPC/EAN pattern, separating the two halves. + + + + + end guard pattern. + + + + + "Odd", or "L" patterns used to encode UPC/EAN digits. + + + + + As above but also including the "even", or "G" patterns used to encode UPC/EAN digits. + + + + + Initializes a new instance of the class. + + + + +

Attempts to decode a one-dimensional barcode format given a single row of + an image.

+
+ row number from top of the row + the black/white pixel data of the row + decode hints + + containing encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found + +
+ + +

Like , but + allows caller to inform method about where the UPC/EAN start pattern is + found. This allows this to be computed once and reused across many implementations.

+
+ row index into the image + encoding of the row of the barcode image + start/end column where the opening start pattern was found + optional hints that influence decoding + encapsulating the result of decoding a barcode in the row +
+ + + + string of digits to check + see + + + + Computes the UPC/EAN checksum on a string of digits, and reports + whether the checksum is correct or not. + + string of digits to check + true iff string of digits passes the UPC/EAN checksum algorithm + + + + Decodes the end. + + The row. + The end start. + + + + + + row of black/white values to search + position to start search + if true, indicates that the pattern specifies white/black/white/... + pixel counts, otherwise, it is interpreted as black/white/black/... + pattern of counts of number of black and white pixels that are being + searched for as a pattern + array of counters, as long as pattern, to re-use + start/end horizontal offset of guard pattern, as an array of two ints + + + + Attempts to decode a single UPC/EAN-encoded digit. + + row of black/white values to decode + the counts of runs of observed black/white/black/... values + horizontal offset to start decoding from + the set of patterns to use to decode -- sometimes different encodings + for the digits 0-9 are used, and this indicates the encodings for 0 to 9 that should + be used + horizontal offset of first pixel beyond the decoded digit + + + + + Get the format of this decoder. + + The 1D format. + + + + Subclasses override this to decode the portion of a barcode between the start + and end guard patterns. + + row of black/white values to search + start/end offset of start guard pattern + to append decoded chars to + horizontal offset of first pixel after the "middle" that was decoded or -1 if decoding could not complete successfully + + + +

Encapsulates functionality and implementation that is common to UPC and EAN families + of one-dimensional barcodes.

+ aripollak@gmail.com (Ari Pollak) + dsbnatut@gmail.com (Kazuki Nishiura) +
+
+ + + + + + + +

Implements decoding of the UPC-E format.

+

Thisis a great reference for + UPC-E information.

+ Sean Owen +
+
+ + + The pattern that marks the middle, and end, of a UPC-E pattern. + There is no "second half" to a UPC-E barcode. + + + + + See L_AND_G_PATTERNS these values similarly represent patterns of + even-odd parity encodings of digits that imply both the number system (0 or 1) + used, and the check digit. + + + + + Initializes a new instance of the class. + + + + + Decodes the middle. + + The row. + The start range. + The result. + + + + + Decodes the end. + + The row. + The end start. + + + + + see checkStandardUPCEANChecksum(String) + + + + + + + Determines the num sys and check digit. + + The result string. + The lg pattern found. + + + + + Get the format of this decoder. + The 1D format. + + + + + Expands a UPC-E value back into its full, equivalent UPC-A code value. + + UPC-E code as string of digits + equivalent UPC-A code as string of digits + + + + + This object renders an UPC-E code as a {@link BitMatrix}. + @author 0979097955s@gmail.com (RX) + + + + + returns supported formats + + + + + content encoding method + + + + + + + Metadata about a PDF417 Barcode + + Guenther Grau + + + + column count + + + + + error correction level + + + + + row count upper + + + + + row count lower + + + + + row count + + + + + initializing constructor + + + + + + + + + A Barcode Value for the PDF417 barcode. + The scanner will iterate through the bitmatrix, + and given the different methods or iterations + will increment a given barcode value's confidence. + + When done, this will return the values of highest confidence. + + Guenther Grau + + + + Incremenets the Confidence for a given value. (Adds an occurance of a value) + + + Value. + + + + Determines the maximum occurrence of a set value and returns all values which were set with this occurrence. + + an array of int, containing the values with the highest occurrence, or null, if no value was set. + + + + Returns the confience value for a given barcode value + + Barcode value. + + + + A Bounding Box helper class + + Guenther Grau + + + + top left corner of the box + + + + + top right corner of the box + + + + + bottom left corner of the box + + + + + bottom right corner of the box + + + + + min x + + + + + max x + + + + + min y + + + + + max y + + + + + Initializes a new instance of the class. + returns null if the corner points don't match up correctly + + The image. + The top left. + The bottom left. + The top right. + The bottom right. + + + + + Creates the specified box. + + The box. + + + + + Initializes a new instance of the class. + Will throw an exception if the corner points don't match up correctly + + Image. + Top left. + Top right. + Bottom left. + Bottom right. + + + + Merge two Bounding Boxes, getting the left corners of left, and the right corners of right + (Images should be the same) + + Left. + Right. + + + + Adds the missing rows. + + The missing rows. + Missing start rows. + Missing end rows. + If set to true is left. + + + + A Codeword in the PDF417 barcode + + Guenther Grau + + + + Default value for the RowNumber (-1 being an invalid real number) + + + + + start of x coordinates + + + + + end of x coordinates + + + + + bucket + + + + + value + + + + + row number + + + + + Initializes a new instance of the class. + + Start x. + End x. + Bucket. + Value. + + + + Gets the width. + + The width. + + + + Gets a value indicating whether this instance has valid row number. + + true if this instance has valid row number; otherwise, false. + + + + Determines whether this instance is valid row number the specified rowNumber. + + true if this instance is valid row number the specified rowNumber; otherwise, false. + Row number. + + + + Sets the row number as the row's indicator column. + + + + + Returns a that represents the current . + + A that represents the current . + + + +

This class contains the methods for decoding the PDF417 codewords.

+ + SITA Lab (kevin.osullivan@sita.aero) +
+
+ + + Table containing values for the exponent of 900. + This is used in the numeric compaction decode algorithm. + + + + + Text Compaction mode (see 5.4.1.5) permits all printable ASCII characters to be + encoded, i.e. values 32 - 126 inclusive in accordance with ISO/IEC 646 (IRV), as + well as selected control characters. + + The array of codewords (data + error) + The current index into the codeword array. + The decoded data is appended to the result. + The next index into the codeword array. + + + + + The Text Compaction mode includes all the printable ASCII characters + (i.e. values from 32 to 126) and three ASCII control characters: HT or tab + (ASCII value 9), LF or line feed (ASCII value 10), and CR or carriage + return (ASCII value 13). The Text Compaction mode also includes various latch + and shift characters which are used exclusively within the mode. The Text + Compaction mode encodes up to 2 characters per codeword. The compaction rules + for converting data into PDF417 codewords are defined in 5.4.2.2. The sub-mode + switches are defined in 5.4.2.3. + + The text compaction data. + The byte compaction data if there was a mode shift. + The size of the text compaction and byte compaction data. + The decoded data is appended to the result. + The mode in which decoding starts + The mode in which decoding ended + + + + Byte Compaction mode (see 5.4.3) permits all 256 possible 8-bit byte values to be encoded. + This includes all ASCII characters value 0 to 127 inclusive and provides for international + character set support. + + The byte compaction mode i.e. 901 or 924 + The array of codewords (data + error) + The current index into the codeword array. + The decoded data is appended to the result. + The next index into the codeword array. + + + + + Numeric Compaction mode (see 5.4.4) permits efficient encoding of numeric data strings. + + The array of codewords (data + error) + The current index into the codeword array. + The decoded data is appended to the result. + The next index into the codeword array. + + + + + Convert a list of Numeric Compacted codewords from Base 900 to Base 10. + EXAMPLE + Encode the fifteen digit numeric string 000213298174000 + Prefix the numeric string with a 1 and set the initial value of + t = 1 000 213 298 174 000 + Calculate codeword 0 + d0 = 1 000 213 298 174 000 mod 900 = 200 + + t = 1 000 213 298 174 000 div 900 = 1 111 348 109 082 + Calculate codeword 1 + d1 = 1 111 348 109 082 mod 900 = 282 + + t = 1 111 348 109 082 div 900 = 1 234 831 232 + Calculate codeword 2 + d2 = 1 234 831 232 mod 900 = 632 + + t = 1 234 831 232 div 900 = 1 372 034 + Calculate codeword 3 + d3 = 1 372 034 mod 900 = 434 + + t = 1 372 034 div 900 = 1 524 + Calculate codeword 4 + d4 = 1 524 mod 900 = 624 + + t = 1 524 div 900 = 1 + Calculate codeword 5 + d5 = 1 mod 900 = 1 + t = 1 div 900 = 0 + Codeword sequence is: 1, 624, 434, 632, 282, 200 + + Decode the above codewords involves + 1 x 900 power of 5 + 624 x 900 power of 4 + 434 x 900 power of 3 + + 632 x 900 power of 2 + 282 x 900 power of 1 + 200 x 900 power of 0 = 1000213298174000 + + Remove leading 1 => Result is 000213298174000 + The array of codewords + The number of codewords + The decoded string representing the Numeric data. + + + + + + + Guenther Grau + + + + metadata which are found + + + + + result columns + + + + + bounding box of the detected result + + + + + column count + + + + + row count + + + + + error correction level + + + + + initializing constructor + + + + + + + Returns the DetectionResult Columns. This does a fair bit of calculation, so call it sparingly. + + The detection result columns. + + + + Adjusts the indicator column row numbers. + + Detection result column. + + + + return number of codewords which don't have a valid row number. Note that the count is not accurate as codewords . + will be counted several times. It just serves as an indicator to see when we can stop adjusting row numbers + + The row numbers. + + + + Adjusts the row numbers by row. + + The row numbers by row. + + + + Adjusts the row numbers from both Row Indicators + + zero + + + + Adjusts the row numbers from Right Row Indicator. + + The unadjusted row count. + + + + Adjusts the row numbers from Left Row Indicator. + + Unadjusted row Count. + + + + Adjusts the row number if valid. + + The invalid rows + Row indicator row number. + Invalid row counts. + Codeword. + + + + Adjusts the row numbers. + + Barcode column. + Codewords row. + Codewords. + + + + Adjusts the row number. + + true, if row number was adjusted, false otherwise. + Codeword. + Other codeword. + + + + Returns a that represents the current . + + A that represents the current . + + + + Represents a Column in the Detection Result + + Guenther Grau + + + + The maximum distance to search in the codeword array in both the positive and negative directions + + + + + The Bounding Box around the column (in the BitMatrix) + + The box. + + + + The Codewords the Box encodes for, offset by the Box minY. + Remember to Access this ONLY through GetCodeword(imageRow) if you're accessing it in that manner. + + The codewords. + + + + Initializes a new instance of the class. + + The Bounding Box around the column (in the BitMatrix) + + + + Converts the Image's Row to the index in the Codewords array + + The Codeword Index. + Image row. + + + + Converts the Codeword array index into a Row in the Image (BitMatrix) + + The Image Row. + Codeword index. + + + + Gets the codeword for a given row + + The codeword. + Image row. + + + + Gets the codeword closest to the specified row in the image + + Image row. + + + + Sets the codeword for an image row + + Image row. + Codeword. + + + + Returns a that represents the current . + + A that represents the current . + + + + Represents a Column in the Detection Result + + Guenther Grau + + + + Gets or sets a value indicating whether this instance is the left indicator + + true if this instance is left; otherwise, false. + + + + Initializes a new instance of the class. + + Box. + If set to true is left. + + + + Sets the Row Numbers as Inidicator Columns + + + + + TODO implement properly + TODO maybe we should add missing codewords to store the correct row number to make + finding row numbers for other columns easier + use row height count to make detection of invalid row numbers more reliable + + The indicator column row numbers. + Metadata. + + + + Gets the row heights. + + The row heights. + + + + Adjusts the in omplete indicator column row numbers. + + Metadata. + + + + Gets the barcode metadata. + + The barcode metadata. + + + + Prune the codewords which do not match the metadata + TODO Maybe we should keep the incorrect codewords for the start and end positions? + + Codewords. + Metadata. + + + + Returns a that represents the current . + + A that represents the current . + + + +

PDF417 error correction implementation.

+

This example + is quite useful in understanding the algorithm.

+ Sean Owen + +
+
+ + + Initializes a new instance of the class. + + + + + Decodes the specified received. + + received codewords + number of those codewords used for EC + location of erasures + The error locations count. + + + + + Runs the euclidean algorithm (Greatest Common Divisor) until r's degree is less than R/2 + + The euclidean algorithm. + + + + Finds the error locations as a direct application of Chien's search + + The error locations. + Error locator. + + + + Finds the error magnitudes by directly applying Forney's Formula + + The error magnitudes. + Error evaluator. + Error locator. + Error locations. + + + +

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

+ +
+ Sean Owen +
+ + + + + Sean Owen + + + + Gets the coefficients. + + The coefficients. + + + + degree of this polynomial + + + + + Gets a value indicating whether this instance is zero. + + true if this polynomial is the monomial "0" + + + + + coefficient of x^degree term in this polynomial + + The degree. + coefficient of x^degree term in this polynomial + + + + evaluation of this polynomial at a given point + + A. + evaluation of this polynomial at a given point + + + + Adds another Modulus + + Other. + + + + Subtract another Modulus + + Other. + + + + Multiply by another Modulus + + Other. + + + + Returns a Negative version of this instance + + + + + Multiply by a Scalar. + + Scalar. + + + + Multiplies by a Monomial + + The by monomial. + Degree. + Coefficient. + + + + Returns a that represents the current . + + A that represents the current . + + + + + + Guenther Grau + creatale GmbH (christoph.schulz@creatale.de) + + + + The ratios table + + + + + Initializes the class & Pre-computes the symbol ratio table. + + + + + Gets the decoded value. + + The decoded value. + Module bit count. + + + + Samples the bit counts. + + The bit counts. + Module bit count. + + + + Gets the decoded codeword value. + + The decoded codeword value. + Module bit count. + + + + Gets the bit value. + + The bit value. + Module bit count. + + + + Gets the closest decoded value. + + The closest decoded value. + Module bit count. + + + + + + Guenther Grau + + + + Decode the specified image, imageTopLeft, imageBottomLeft, imageTopRight, imageBottomRight, minCodewordWidth + and maxCodewordWidth. + TODO: don't pass in minCodewordWidth and maxCodewordWidth, pass in barcode columns for start and stop pattern + columns. That way width can be deducted from the pattern column. + This approach also allows to detect more details about the barcode, e.g. if a bar type (white or black) is wider + than it should be. This can happen if the scanner used a bad blackpoint. + + Image. + Image top left. + Image bottom left. + Image top right. + Image bottom right. + Minimum codeword width. + Max codeword width. + + + + + Merge the specified leftRowIndicatorColumn and rightRowIndicatorColumn. + + Left row indicator column. + Right row indicator column. + + + + Adjusts the bounding box. + + The bounding box. + Row indicator column. + + + + Gets the barcode metadata. + + The barcode metadata. + Left row indicator column. + Right row indicator column. + + + + Gets the row indicator column. + + The row indicator column. + Image. + Bounding box. + Start point. + If set to true left to right. + Minimum codeword width. + Max codeword width. + + + + Adjusts the codeword count. + + Detection result. + Barcode matrix. + + + + Creates the decoder result. + + The decoder result. + Detection result. + + + + + This method deals with the fact, that the decoding process doesn't always yield a single most likely value. The + current error correction implementation doesn't deal with erasures very well, so it's better to provide a value + for these ambiguous codewords instead of treating it as an erasure. The problem is that we don't know which of + the ambiguous values to choose. We try decode using the first value, and if that fails, we use another of the + ambiguous values and try to decode again. This usually only happens on very hard to read and decode barcodes, + so decoding the normal barcodes is not affected by this. + + The decoder result from ambiguous values. + Ec level. + Codewords. + contains the indexes of erasures. + array with the indexes that have more than one most likely value. + two dimensional array that contains the ambiguous values. The first dimension must + be the same Length as the ambiguousIndexes array. + + + + + Creates the barcode matrix. + + The barcode matrix. + Detection result. + + + + Tests to see if the Barcode Column is Valid + + true, if barcode column is valid, false otherwise. + Detection result. + Barcode column. + + + + Gets the start column. + + The start column. + Detection result. + Barcode column. + Image row. + If set to true left to right. + + + + Detects the codeword. + + The codeword. + Image. + Minimum column. + Max column. + If set to true left to right. + Start column. + Image row. + Minimum codeword width. + Max codeword width. + + + + Gets the module bit count. + + The module bit count. + Image. + Minimum column. + Max column. + If set to true left to right. + Start column. + Image row. + + + + Gets the number of EC code words. + + The number of EC code words. + Barcode EC level. + + + + Adjusts the codeword start column. + + The codeword start column. + Image. + Minimum column. + Max column. + If set to true left to right. + Codeword start column. + Image row. + + + + Checks the codeword for any skew. + + true, if codeword is within the skew, false otherwise. + Codeword size. + Minimum codeword width. + Max codeword width. + + + + Decodes the codewords. + + The codewords. + Codewords. + Ec level. + Erasures. + + + + + Given data and error-correction codewords received, possibly corrupted by errors, attempts to + correct the errors in-place. + + The errors. + data and error correction codewords. + positions of any known erasures. + number of error correction codewords that are available in codewords. + + + + Verifies that all is well with the the codeword array. + + Codewords. + Number EC codewords. + + + + Gets the bit count for codeword. + + The bit count for codeword. + Codeword. + + + + Gets the codeword bucket number. + + The codeword bucket number. + Codeword. + + + + Gets the codeword bucket number. + + The codeword bucket number. + Module bit count. + + + + Returns a that represents the jagged array. + + A that represents the jagged array. + Barcode matrix as a jagged array. + + + +

Encapsulates logic that can detect a PDF417 Code in an image, even if the + PDF417 Code is rotated or skewed, or partially obscured.

+ + SITA Lab (kevin.osullivan@sita.aero) + dswitkin@google.com (Daniel Switkin) + Guenther Grau +
+
+ + + B S B S B S B S Bar/Space pattern + 11111111 0 1 0 1 0 1 000. + + + + + 1111111 0 1 000 1 0 1 00 1 + + + + + if we set the value too low, then we don't detect the correct height of the bar if the start patterns are damaged. + if we set the value too high, then we might detect the start pattern from a neighbor barcode. + + + + + A PDF471 barcode should have at least 3 rows, with each row being >= 3 times the module width. Therefore it should be at least + 9 pixels tall. To be conservative, we use about half the size to ensure we don't miss it. + + + + +

Detects a PDF417 Code in an image. Checks 0, 90, 180, and 270 degree rotations.

+
+ barcode image to decode + optional hints to detector + if true, then the image is searched for multiple codes. If false, then at most one code will be found and returned + + encapsulating results of detecting a PDF417 code + +
+ + + Applies a rotation to the supplied BitMatrix. + + bit matrix to apply rotation to + the degrees of rotation to apply + BitMatrix with applied rotation + + + + Detects PDF417 codes in an image. Only checks 0 degree rotation (so rotate the matrix and check again outside of this method) + + multiple if true, then the image is searched for multiple codes. If false, then at most one code will be found and returned. + bit matrix to detect barcodes in. + List of ResultPoint arrays containing the coordinates of found barcodes + + + + Locate the vertices and the codewords area of a black blob using the Start and Stop patterns as locators. + + Matrix. + Start row. + Start column. + an array containing the vertices: + vertices[0] x, y top left barcode + vertices[1] x, y bottom left barcode + vertices[2] x, y top right barcode + vertices[3] x, y bottom right barcode + vertices[4] x, y top left codeword area + vertices[5] x, y bottom left codeword area + vertices[6] x, y top right codeword area + vertices[7] x, y bottom right codeword area + + + + + Copies the temp data to the final result + + Result. + Temp result. + Destination indexes. + + + + Finds the rows with the given pattern. + + The rows with pattern. + Matrix. + Height. + Width. + Start row. + Start column. + + Pattern. + + + + Finds the guard pattern. Uses System.Linq.Enumerable.Repeat to fill in counters. This might be a performance issue? + + start/end horizontal offset of guard pattern, as an array of two ints. + matrix row of black/white values to search + column x position to start search. + row y position to start search. + width the number of pixels to search on this row. + pattern of counts of number of black and white pixels that are being searched for as a pattern. + counters array of counters, as long as pattern, to re-use . + + + + Determines how closely a set of observed counts of runs of black/white. + values matches a given target pattern. This is reported as the ratio of + the total variance from the expected pattern proportions across all + pattern elements, to the length of the pattern. + + + ratio of total variance between counters and pattern compared to + total pattern size, where the ratio has been multiplied by 256. + So, 0 means no variance (perfect match); 256 means the total + variance between counters and patterns equals the pattern length, + higher values mean even more variance + + observed counters. + expected pattern. + + + + PDF 417 Detector Result class. Skipped private backing stores. + Guenther Grau + + + + + bit matrix of the detected result + + + + + points of the detected result in the image + + + + + + + + + + Initializes a new instance of the class. + + Bits. + Points. + Rotation. + + + + Initializes a new instance of the class. + + Bits. + Points. + + + + defines the aspect ratio of the image + + + + + ratio 1 + + + + + ratio 2 + + + + + ratio 3 + + + + + ratio 4 + + + + + automatic selection + + + + + Holds all of the information for a barcode in a format where it can be easily accessible + + Jacob Haynes + + + + + the height of the matrix (Rows) + the width of the matrix (Cols) + defines if a compact PDF417 should be encoded + + + + + Jacob Haynes + + + + + Creates a Barcode row of the width + + The width. + + + + Sets a specific location in the bar + + The location in the bar + Black if true, white if false; + + + + + Sets a specific location in the bar + + The location in the bar + Black if true, white if false; + + + + + A boolean which is true if the bar black false if it is white + How many spots wide the bar is. + + + + + This function scales the row + + How much you want the image to be scaled, must be greater than or equal to 1. + the scaled row + + + + + Represents possible PDF417 barcode compaction types. + + + + + + + + + + + + + + + + + + + + + + + + + Data object to specify the minimum and maximum number of rows and columns for a PDF417 barcode. + @author qwandor@google.com (Andrew Walbran) + + + + + Initializes a new instance of the class. + + The min cols. + The max cols. + The min rows. + The max rows. + + + + Gets the min cols. + + + + + Gets the max cols. + + + + + Gets the min rows. + + + + + Gets the max rows. + + + + + Top-level class for the logic part of the PDF417 implementation. + + + + + The start pattern (17 bits) + + + + + The stop pattern (18 bits) + + + + + The macro last segment + + + + + The macro segment identifier + + + + + The codeword table from the Annex A of ISO/IEC 15438:2001(E). + + + + + Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E). + + the number of source codewords prior to the additional of the Symbol Length + Descriptor and any pad codewords + the number of error correction codewords + the number of columns in the symbol in the data region (excluding start, stop and + row indicator codewords) + the number of rows in the symbol (r) + + + + Calculates the number of pad codewords as described in 4.9.2 of ISO/IEC 15438:2001(E). + + the number of source codewords prior to the additional of the Symbol Length + Descriptor and any pad codewords + the number of error correction codewords + the number of columns in the symbol in the data region (excluding start, stop and + row indicator codewords) + the number of rows in the symbol + the number of pad codewords + + + + Generates the barcode logic. + + the message to encode + PDF417 error correction level to use + + + + + + + Generates the barcode logic. + + the message to encode + PDF417 error correction level to use + + + + automatically insert ECIs if needed + + + + Gets the macro block. + + System.String. + + The macro segment index must be greater than or equal to 0. + or + The macro segment index must be less than the segment count. + or + The macro segment count must be greater than 0. + + + + + Appends optional macro fields. + + The field. + The value. + The source code word length. + The macro codewords. + + + + Determine optimal nr of columns and rows for the specified number of + codewords. + + number of code words + number of error correction code words + The longest dimension of the barcode, used for columns + The short dimension of the barcode, used for rows + The height of a row, will alter this parameter if aspectRatio>4 (aspectRatio==AUTO) + dimension object containing cols as width and rows as height + + + + Sets the desired aspect ratio for the output image. + + + + + + Sets max/min row/col values + + maximum allowed columns + minimum allowed columns + maximum allowed rows + minimum allowed rows + + + + Sets compaction to values stored in enum + + compaction mode to use + + + + Sets compact to be true or false + + if true, enables compaction + + + + Sets output encoding. + + sets character encoding to use + + + + Sets the disable eci. + + if set to true don't add an ECI segment for different encodings than default. + + + + Sets the meta data. + + The metadata. + + + + PDF417 error correction code following the algorithm described in ISO/IEC 15438:2001(E) in + chapter 4.10. + + + + + Tables of coefficients for calculating error correction words + (see annex F, ISO/IEC 15438:2001(E)) + + + + + Determines the number of error correction codewords for a specified error correction + level. + + the error correction level (0-8) + the number of codewords generated for error correction + + + + Determines the error correction level for AUTO + + The error correction level (0-9) + The number of codewords for AUTO errorCorrectionLevel + the number of codewords generated for error correction + + + + Returns the recommended minimum error correction level as described in annex E of + ISO/IEC 15438:2001(E). + + the number of data codewords + the recommended minimum error correction level + + + + Generates the error correction codewords according to 4.10 in ISO/IEC 15438:2001(E). + + the data codewords + the error correction level (0-8) + the String representing the error correction codewords + + + + defines the level of the error correction / count of error correction codewords + + + + + level 0 + + + + + level 1 + + + + + level 2 + + + + + level 3 + + + + + level 4 + + + + + level 5 + + + + + level 6 + + + + + level 7 + + + + + level 8 + + + + + automatic selection + + + + + PDF417 high-level encoder following the algorithm described in ISO/IEC 15438:2001(E) in + annex P. + + + + + code for Text compaction + + + + + code for Byte compaction + + + + + code for Numeric compaction + + + + + Text compaction submode Alpha + + + + + Text compaction submode Lower + + + + + Text compaction submode Mixed + + + + + Text compaction submode Punctuation + + + + + mode latch to Text Compaction mode + + + + + mode latch to Byte Compaction mode (number of characters NOT a multiple of 6) + + + + + mode latch to Numeric Compaction mode + + + + + mode shift to Byte Compaction mode + + + + + mode latch to Byte Compaction mode (number of characters a multiple of 6) + + + + + identifier for a user defined Extended Channel Interpretation (ECI) + + + + + identifier for a general purpose ECO format + + + + + identifier for an ECI of a character set of code page + + + + + Raw code table for text compaction Mixed sub-mode + + + + + Raw code table for text compaction: Punctuation sub-mode + + + + + Performs high-level encoding of a PDF417 message using the algorithm described in annex P + of ISO/IEC 15438:2001(E). If byte compaction has been selected, then only byte compaction + is used. + + the message + compaction mode to use + character encoding used to encode in default or byte compaction + or null for default / not applicable + if true, don't add an ECI segment for different encodings than default + encode input minimally using multiple ECIs if needed + If autoECI encoding is specified and additionally {@code encoding} is specified, then the encoder + will use the specified {@link Charset} + for any character that can be encoded by it, regardless + if a different encoding would lead to a more compact encoding. When no {@code encoding} is specified + then charsets will be chosen so that the byte representation is minimal. + the encoded message (the char values range from 0 to 928) + + + + Check if input is only made of characters between 0 and the upper limit + + the input + the upper limit for charset + the message to explain the error + exception highlighting the offending character and a suggestion to avoid the error + + + + Encode parts of the message using Text Compaction as described in ISO/IEC 15438:2001(E), + chapter 4.4.2. + + the input + the start position within the message + the number of characters to encode + receives the encoded codewords + should normally be SUBMODE_ALPHA + the text submode in which this method ends + + + + + Encode all of the message using Byte Compaction as described in ISO/IEC 15438:2001(E) + + the input + the start position within the message + the number of bytes to encode + the mode from which this method starts + receives the encoded codewords + + + + Encode parts of the message using Byte Compaction as described in ISO/IEC 15438:2001(E), + chapter 4.4.3. The Unicode characters will be converted to binary using the cp437 + codepage. + + the message converted to a byte array + the start position within the message + the number of bytes to encode + the mode from which this method starts + receives the encoded codewords + + + + + Determines the number of consecutive characters that are encodable using numeric compaction. + + the input + the start position within the message + the requested character count + + + + + Determines the number of consecutive characters that are encodable using text compaction. + + the input + the start position within the message + the requested character count + + + + + Determines the number of consecutive characters that are encodable using binary compaction. + + the input + the start position within the message + + the requested character count + + + + Macro PDF417 optional fields. + + The values are set to their field designator. + + + + The file name. + Field designator: 0 + + + + + The segment count field can contain values from 1 to 99,999. + Field designator: 1 + + + + + The time stamp of the source file expressed in Unix time. + Field designator: 2 + + + + + The sender. + Field designator: 3 + + + + + The addressee. + Field designator: 4 + + + + + The file size in bytes. + Field designator: 5 + + + + + The 16-bit CRC checksum using the CCITT-16 polynomial. + Field designator: 6 + + + + + The class holds the available options for the + + + + + Specifies whether to use compact mode for PDF417 (type ). + + + + + Specifies what compaction mode to use for PDF417 (type + ). + + + + + Specifies the minimum and maximum number of rows and columns for PDF417 (type + ). + + + + + Specifies what degree of error correction to use + + + + + Specifies the aspect ratio of the smallest codeword. + (Width of narrowest bar / Row Height) + + + + + Specifies the desired output image aspect ratio (Width / Height). + The actual aspect ratio is calculated based on the necessary number of codewords. + + + + + Specifies what character encoding to use where applicable (type {@link String}) + + + + + Explicitly disables ECI segment when generating PDF417 Code + That is against the specification but some + readers have problems if the charset is switched from + CP437 (default) to UTF-8 with the necessary ECI segment. + If you set the property to true you can use different encodings + and the ECI segment is omitted. + + + + + SITA Lab (kevin.osullivan@sita.aero) + Guenther Grau + + + + + Maximum Codewords (Data + Error). + + + + + Gets the bit count sum. + + The bit count sum. + Module bit count. + + + + Converts an ICollection<int> to an int[] + Carry-over from Java. Will likely remove and replace with the Generic .ToArray() method. + + The int array. + List. + + + + Translate the symbol into a codeword + + the codeword corresponding to the symbol. + encoded symbol to translate to a codeword + + + + The sorted table of all possible symbols. Extracted from the PDF417 + specification. The index of a symbol in this table corresponds to the + index into the codeword table. + + + + + This table contains to codewords for all symbols. + + + + + PDF417 Macro meta data. + + + + + The Segment ID represents the segment of the whole file distributed over different symbols. + + + + + Is the same for each related PDF417 symbol + + + + + true if it is the last segment + + + + + count of segments, -1 if not set + + + + + sender + + + + + address + + + + + Filename of the encoded file + + + + + filesize in bytes of the encoded file + returns filesize in bytes, -1 if not set + + + + + 16-bit CRC checksum using CCITT-16 + returns crc checksum, -1 if not set + + + + + unix epock timestamp, elapsed seconds since 1970-01-01 + returns elapsed seconds, -1 if not set + + + + + This implementation can detect and decode PDF417 codes in an image. + + SITA Lab (kevin.osullivan@sita.aero) + Guenther Grau + + + + + Locates and decodes a PDF417 code in an image. + + a String representing the content encoded by the PDF417 code + if a PDF417 cannot be decoded + + + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + **Note** this will return the FIRST barcode discovered if there are many. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Locates and decodes Multiple PDF417 codes in an image. + + an array of Strings representing the content encoded by the PDF417 codes + + + + + Locates and decodes multiple barcodes in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcodes encode + + + + + Decode the specified image, with the hints and optionally multiple barcodes. + Based on Owen's Comments in , this method has been modified to continue silently + if a barcode was not decoded where it was detected instead of throwing a new exception object. + + Image. + Hints. + If set to true multiple. + + + + Gets the maximum width of the barcode + + The max width. + P1. + P2. + + + + Gets the minimum width of the barcode + + The minimum width. + P1. + P2. + + + + Gets the maximum width of the codeword. + + The max codeword width. + P. + + + + Gets the minimum width of the codeword. + + The minimum codeword width. + P. + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + PDF 417 result meta data. + Guenther Grau + + + + + default constructor + + + + + The Segment ID represents the segment of the whole file distributed over different symbols. + + + + + Is the same for each related PDF417 symbol + + + + + old optional data format as int array, always null + + + + + true if it is the last segment + + + + + count of segments, -1 if not set + + + + + sender + + + + + address + + + + + Filename of the encoded file + + + + + filesize in bytes of the encoded file + returns filesize in bytes, -1 if not set + + + + + 16-bit CRC checksum using CCITT-16 + returns crc checksum, -1 if not set + + + + + unix epock timestamp, elapsed seconds since 1970-01-01 + returns elapsed seconds, -1 if not set + + + + + string represenation of that instance + + + + + + Jacob Haynes + qwandor@google.com (Andrew Walbran) + + + + + default white space (margin) around the code + + + + + default error correction level + + + + + default aspect ratio + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + Takes encoder, accounts for width/height, and retrieves bit matrix + + + + + This takes an array holding the values of the PDF 417 + + a byte array of information with 0 is black, and 1 is white + border around the barcode + BitMatrix of the input + + + + Takes and rotates the it 90 degrees + + + + + This object extends LuminanceSource around an array of YUV data returned from the camera driver, + with the option to crop to a rectangle within the full data. This can be used to exclude + superfluous pixels around the perimeter and speed up decoding. + It works for any pixel format where the Y channel is planar and appears first, including + YCbCr_420_SP and YCbCr_422_SP. + @author dswitkin@google.com (Daniel Switkin) + + + + + Initializes a new instance of the class. + + The yuv data. + Width of the data. + Height of the data. + The left. + The top. + The width. + The height. + if set to true [reverse horiz]. + + + + Initializes a new instance of the class. + + The luminances. + The width. + The height. + + + + Fetches one row of luminance data from the underlying platform's bitmap. Values range from + 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have + to bitwise and with 0xff for each value. It is preferable for implementations of this method + to only fetch this row rather than the whole image, since no 2D Readers may be installed and + getMatrix() may never be called. + + The row to fetch, 0 <= y < Height. + An optional preallocated array. If null or too small, it will be ignored. + Always use the returned object, and ignore the .length of the array. + + An array containing the luminance data. + + + + + + + + + + + Whether this subclass supports cropping. + + + + Returns a new object with cropped image data. Implementations may keep a reference to the + original data rather than a copy. Only callable if CropSupported is true. + + The left coordinate, 0 <= left < Width. + The top coordinate, 0 <= top <= Height. + The width of the rectangle to crop. + The height of the rectangle to crop. + + A cropped version of this object. + + + + + Renders the cropped greyscale bitmap. + + + + + + width of image from {@link #renderThumbnail()} + + + + + height of image from {@link #renderThumbnail()} + + + + + creates a new instance + + + + + + + + Sean Owen + + + {@link BitMatrix} to parse + ReaderException if dimension is not >= 21 and 1 mod 4 + + +

Reads format information from one of its two locations within the QR Code.

+ +
+ {@link FormatInformation} encapsulating the QR Code's format info + + ReaderException if both format information locations cannot be parsed as + the valid encoding of format information + +
+ +

Reads version information from one of its two locations within the QR Code.

+ +
+ {@link Version} encapsulating the QR Code's version + + ReaderException if both version information locations cannot be parsed as + the valid encoding of version information + +
+ +

Reads the bits in the {@link BitMatrix} representing the finder pattern in the + correct order in order to reconstruct the codewords bytes contained within the + QR Code.

+ +
+ bytes encoded within the QR Code + + ReaderException if the exact number of bytes expected is not read +
+ + Revert the mask removal done while reading the code words. The bit matrix should revert to its original state. + + + Prepare the parser for a mirrored operation. + This flag has effect only on the {@link #readFormatInformation()} and the + {@link #readVersion()}. Before proceeding with {@link #readCodewords()} the + {@link #mirror()} method should be called. + + @param mirror Whether to read version and format information mirrored. + + + Mirror the bit matrix in order to attempt a second reading. + + +

Encapsulates a block of data within a QR Code. QR Codes may split their data into + multiple blocks, each of which is a unit of data and error-correction codewords. Each + is represented by an instance of this class.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ +

When QR Codes use multiple data blocks, they are actually interleaved. + That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This + method will separate the data into original blocks.

+ +
+ bytes as read directly from the QR Code + + version of the QR Code + + error-correction level of the QR Code + + {@link DataBlock}s containing original bytes, "de-interleaved" from representation in the + QR Code + +
+ +

Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations + of this class can un-mask a raw BitMatrix. For simplicity, they will unmask the entire BitMatrix, + including areas used for finder patterns, timing patterns, etc. These areas should be unused + after the point they are unmasked anyway.

+ +

Note that the diagram in section 6.8.1 is misleading since it indicates that i is column position + and j is row position. In fact, as the text says, i is row position and j is column position.

+ +
+ Sean Owen +
+ + See ISO 18004:2006 6.8.1 + + +

Implementations of this method reverse the data masking process applied to a QR Code and + make its bits ready to read.

+
+ + representation of QR Code bits + dimension of QR Code, represented by bits, being unmasked +
+ +

QR Codes can encode text as bits in one of several modes, and can use multiple modes + in one QR Code. This class decodes the bits back into text.

+ +

See ISO 18004:2006, 6.4.3 - 6.4.7

+ Sean Owen +
+
+ + + See ISO 18004:2006, 6.4.4 Table 5 + + + + + See specification GBT 18284-2000 + + The bits. + The result. + The count. + + + + +

The main class which implements QR Code decoding -- as opposed to locating and extracting + the QR Code from an image.

+
+ + Sean Owen + +
+ + + Initializes a new instance of the class. + + + + +

Convenience method that can decode a QR Code represented as a 2D array of booleans. + "true" is taken to mean a black module.

+
+ booleans representing white/black QR Code modules + decoding hints that should be used to influence decoding + + text and bytes encoded within the QR Code + +
+ + +

Decodes a QR Code represented as a {@link BitMatrix}. A 1 or "true" is taken to mean a black module.

+
+ booleans representing white/black QR Code modules + decoding hints that should be used to influence decoding + + text and bytes encoded within the QR Code + +
+ + +

Given data and error-correction codewords received, possibly corrupted by errors, attempts to + correct the errors in-place using Reed-Solomon error correction.

+
+ data and error correction codewords + number of codewords that are data bytes + the number of errors corrected + +
+ + +

See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels + defined by the QR code standard.

+
+ Sean Owen +
+ + L = ~7% correction + + + M = ~15% correction + + + Q = ~25% correction + + + H = ~30% correction + + + + Gets the bits. + + + + + Gets the name. + + + + + Ordinals this instance. + + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Fors the bits. + + int containing the two bits encoding a QR Code's error correction level + + representing the encoded error correction level + + + +

Encapsulates a QR Code's format information, including the data mask used and + error correction level.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + +
+ + See ISO 18004:2006, Annex C, Table C.1 + + + Offset i holds the number of 1 bits in the binary representation of i + + + + Decodes the format information. + + format info indicator, with mask still applied + The masked format info2. + + information about the format it specifies, or null + if doesn't seem to match any known pattern + + + + +

See ISO 18004:2006, 6.4.1, Tables 2 and 3. This enum encapsulates the various modes in which + data can be encoded to bits in the QR code standard.

+
+ Sean Owen +
+ + + Gets the name. + + + + + enumeration for encoding modes + + + + + + + + + + numeric encoding + + + + + alpha-numeric encoding + + + + + structured append + + + + + byte mode encoding + + + + + ECI segment + + + + + Kanji mode + + + + + FNC1 char, first position + + + + + FNC1 char, second position + + + + + Hanzi mode + + + + + Not really a mode... + + + + + + + + + + + + + + + Not supported + + + + + + + + + + character counts don't apply + + + + + + + + + + + + + + + + + + + + See GBT 18284-2000; "Hanzi" is a transliteration of this mode name. + + + + + Fors the bits. + + four bits encoding a QR Code data mode + + encoded by these bits + + if bits do not correspond to a known mode + + + version in question + + number of bits used, in this QR Code symbol {@link Version}, to encode the + count of characters that will follow encoded in this {@link Mode} + + + + + Gets the bits. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Meta-data container for QR Code decoding. Instances of this class may be used to convey information back to the + decoding caller. Callers are expected to process this. + + + + + Initializes a new instance of the class. + + if set to true [mirrored]. + The mask applied to the bit matrix + + + + true if the QR Code was mirrored. + + + + + The mask applied to the QR code + + + + + Apply the result points' order correction due to mirroring. + + Array of points to apply mirror correction to. + + + + See ISO 18004:2006 Annex D + + Sean Owen + + + See ISO 18004:2006 Annex D. + Element i represents the raw version bits that specify version i + 7 + + + + + Gets the version number. + + + + + Gets the alignment pattern centers. + + + + + Gets the total codewords. + + + + + Gets the dimension for version. + + + + + Gets the EC blocks for level. + + The ec level. + + + +

Deduces version information purely from QR Code dimensions.

+ +
+ dimension in modules + + for a QR Code of that dimension or null +
+ + + Gets the version for number. + + The version number. + + + + See ISO 18004:2006 Annex E + + +

Encapsulates a set of error-correction blocks in one symbol version. Most versions will + use blocks of differing sizes within one version, so, this encapsulates the parameters for + each set of blocks. It also holds the number of error-correction codewords per block since it + will be the same across all blocks within one version.

+
+
+ + + Gets the EC codewords per block. + + + + + Gets the num blocks. + + + + + Gets the total EC codewords. + + + + + Gets the EC blocks. + + + + +

Encapsulates the parameters for one error-correction block in one symbol version. + This includes the number of data codewords, and the number of times a block with these + parameters is used consecutively in the QR code version's format.

+
+
+ + + Gets the count. + + + + + Gets the data codewords. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + See ISO 18004:2006 6.5.1 Table 9 + + +

Encapsulates an alignment pattern, which are the smaller square patterns found in + all but the simplest QR Codes.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ +

Determines if this alignment pattern "about equals" an alignment pattern at the stated + position and size -- meaning, it is at nearly the same center with nearly the same size.

+
+
+ + + Combines this object's current estimate of a finder pattern position and module size + with a new estimate. It returns a new {@code FinderPattern} containing an average of the two. + + The i. + The j. + New size of the module. + + + +

This class attempts to find alignment patterns in a QR Code. Alignment patterns look like finder + patterns but are smaller and appear at regular intervals throughout the image.

+ +

At the moment this only looks for the bottom-right alignment pattern.

+ +

This is mostly a simplified copy of {@link FinderPatternFinder}. It is copied, + pasted and stripped down here for maximum performance but does unfortunately duplicate + some code.

+ +

This class is thread-safe but not reentrant. Each thread must allocate its own object.

+ +
+ Sean Owen + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + +
+ +

Creates a finder that will look in a portion of the whole image.

+ +
+ image to search + + left column from which to start searching + + top row from which to start searching + + width of region to search + + height of region to search + + estimated module size so far + + callback function which is called, when a result point is found +
+ +

This method attempts to find the bottom-right alignment pattern in the image. It is a bit messy since + it's pretty performance-critical and so is written to be fast foremost.

+ +
+ if found +
+ + Given a count of black/white/black pixels just seen and an end position, + figures the location of the center of this black/white/black run. + + + + count of black/white/black pixels just read + + true iff the proportions of the counts is close enough to the 1/1/1 ratios + used by alignment patterns to be considered a match + + + + +

After a horizontal scan finds a potential alignment pattern, this method + "cross-checks" by scanning down vertically through the center of the possible + alignment pattern to see if the same proportion is detected.

+
+ row where an alignment pattern was detected + center of the section that appears to cross an alignment pattern + maximum reasonable number of modules that should be + observed in any reading state, based on the results of the horizontal scan + The original state count total. + + vertical center of alignment pattern, or null if not found + +
+ +

This is called when a horizontal scan finds a possible alignment pattern. It will + cross check with a vertical scan, and if successful, will see if this pattern had been + found on a previous horizontal scan. If so, we consider it confirmed and conclude we have + found the alignment pattern.

+ +
+ reading state module counts from horizontal scan + + row where alignment pattern may be found + + end of possible alignment pattern in row + + {@link AlignmentPattern} if we have found the same pattern twice, or null if not + +
+ + +

Encapsulates logic that can detect a QR Code in an image, even if the QR Code + is rotated or skewed, or partially obscured.

+
+ Sean Owen +
+ + + Initializes a new instance of the class. + + The image. + + + + Gets the image. + + + + + Gets the result point callback. + + + + +

Detects a QR Code in an image.

+
+ + encapsulating results of detecting a QR Code + +
+ + +

Detects a QR Code in an image.

+
+ optional hints to detector + + encapsulating results of detecting a QR Code + +
+ + + Processes the finder pattern info. + + The info. + + + +

Computes the dimension (number of modules on a size) of the QR Code based on the position + of the finder patterns and estimated module size.

+
+
+ + +

Computes an average estimated module size based on estimated derived from the positions + of the three finder patterns.

+
+ detected top-left finder pattern center + detected top-right finder pattern center + detected bottom-left finder pattern center + estimated module size +
+ +

Estimates module size based on two finder patterns -- it uses + {@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the + width of each, measuring along the axis between their centers.

+
+
+ + See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of + a finder pattern by looking for a black-white-black run from the center in the direction + of another point (another finder pattern center), and in the opposite direction too. + + + +

This method traces a line from a point in the image, in the direction towards another point. + It begins in a black region, and keeps going until it finds white, then black, then white again. + It reports the distance from the start to this point.

+ +

This is used when figuring out how wide a finder pattern is, when the finder pattern + may be skewed or rotated.

+
+
+ + +

Attempts to locate an alignment pattern in a limited region of the image, which is + guessed to contain it. This method uses {@link AlignmentPattern}.

+
+ estimated module size so far + x coordinate of center of area probably containing alignment pattern + y coordinate of above + number of pixels in all directions to search from the center + + if found, or null otherwise + +
+ + +

Encapsulates a finder pattern, which are the three square patterns found in + the corners of QR Codes. It also encapsulates a count of similar finder patterns, + as a convenience to the finder's bookkeeping.

+
+ Sean Owen +
+ + + Gets the size of the estimated module. + + + The size of the estimated module. + + + +

Determines if this finder pattern "about equals" a finder pattern at the stated + position and size -- meaning, it is at nearly the same center with nearly the same size.

+
+
+ + + Combines this object's current estimate of a finder pattern position and module size + with a new estimate. It returns a new {@code FinderPattern} containing a weighted average + based on count. + + The i. + The j. + New size of the module. + + + + +

This class attempts to find finder patterns in a QR Code. Finder patterns are the square + markers at three corners of a QR Code.

+ +

This class is thread-safe but not reentrant. Each thread must allocate its own object.

+
+ Sean Owen +
+ + + 1 pixel/module times 3 modules/center + + + + + support up to version 20 for mobile clients + + + + +

Creates a finder that will search the image for three finder patterns.

+
+ image to search +
+ + + Initializes a new instance of the class. + + The image. + The result point callback. + + + + Gets the image. + + + + + Gets the possible centers. + + + + Given a count of black/white/black/white/black pixels just seen and an end position, + figures the location of the center of this run. + + + + count of black/white/black/white/black pixels just read + + true iff the proportions of the counts is close enough to the 1/1/3/1/1 ratios + used by finder patterns to be considered a match + + + + + + count of black/white/black/white/black pixels just read + true if the proportions of the counts is close enough to the 1/1/3/1/1 ratios + by finder patterns to be considered a match + + + + sets everything to 0 + + + + + + shifts left by 2 index + + + + + + After a vertical and horizontal scan finds a potential finder pattern, this method + "cross-cross-cross-checks" by scanning down diagonally through the center of the possible + finder pattern to see if the same proportion is detected. + + row where a finder pattern was detected + center of the section that appears to cross a finder pattern + true if proportions are withing expected limits + + + +

After a horizontal scan finds a potential finder pattern, this method + "cross-checks" by scanning down vertically through the center of the possible + finder pattern to see if the same proportion is detected.

+
+ row where a finder pattern was detected + center of the section that appears to cross a finder pattern + maximum reasonable number of modules that should be + observed in any reading state, based on the results of the horizontal scan + The original state count total. + + vertical center of finder pattern, or null if not found + +
+ +

Like {@link #crossCheckVertical(int, int, int, int)}, and in fact is basically identical, + except it reads horizontally instead of vertically. This is used to cross-cross + check a vertical cross check and locate the real center of the alignment pattern.

+
+
+ + + @see #handlePossibleCenter(int[], int, int) + + reading state module counts from horizontal scan + row where finder pattern may be found + end of possible finder pattern in row + ignored + true if a finder pattern candidate was found this time + + + +

This is called when a horizontal scan finds a possible alignment pattern. It will + cross check with a vertical scan, and if successful, will, ah, cross-cross-check + with another horizontal scan. This is needed primarily to locate the real horizontal + center of the pattern in cases of extreme skew. + And then we cross-cross-cross check with another diagonal scan.

+ If that succeeds the finder pattern location is added to a list that tracks + the number of times each location has been nearly-matched as a finder pattern. + Each additional find is more evidence that the location is in fact a finder + pattern center +
+ reading state module counts from horizontal scan + row where finder pattern may be found + end of possible finder pattern in row + + true if a finder pattern candidate was found this time + +
+ + number of rows we could safely skip during scanning, based on the first + two finder patterns that have been located. In some cases their position will + allow us to infer that the third pattern must lie below a certain point farther + down in the image. + + + + true iff we have found at least 3 finder patterns that have been detected + at least {@link #CENTER_QUORUM} times each, and, the estimated module size of the + candidates is "pretty similar" + + + + + Get square of distance between a and b. + + + + + + + the 3 best {@link FinderPattern}s from our list of candidates. The "best" are + those have similar module size and form a shape closer to a isosceles right triangle. + + + + + Orders by {@link FinderPatternFinder#getEstimatedModuleSize()} + + + + +

Encapsulates information about finder patterns in an image, including the location of + the three finder patterns, and their estimated module size.

+
+ Sean Owen +
+ + + Initializes a new instance of the class. + + The pattern centers. + + + + Gets the bottom left. + + + + + Gets the top left. + + + + + Gets the top right. + + + + + JAVAPORT: The original code was a 2D array of ints, but since it only ever gets assigned + 0, 1 and 2 I'm going to use less memory and go with bytes. + + dswitkin@google.com (Daniel Switkin) + + + + Initializes a new instance of the class. + + The width. + The height. + + + + Gets the height. + + + + + Gets the width. + + + + + Gets or sets the with the specified x. + + + + + an internal representation as bytes, in row-major order. array[y][x] represents point (x,y) + + + + + Sets the specified x. + + The x. + The y. + The value. + + + + Sets the specified x. + + The x. + The y. + if set to true [value]. + + + + Clears the specified value. + + The value. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + + Encode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen + internally by chooseMode(). On success, store the result in "qrCode". + We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for + "getECLevel" since our primary use is to show QR code on desktop screens. We don't need very + strong error correction for this purpose. + Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode() + with which clients can specify the encoding mode. For now, we don't need the functionality. + + text to encode + error correction level to use + representing the encoded QR code + + + + Encodes the specified content. + + The content. + The ec level. + The hints. + + + + + Decides the smallest version of QR code that will contain all of the provided data. + + if the data cannot fit in any version + + + + Gets the alphanumeric code. + + The code. + the code point of the table used in alphanumeric mode or + -1 if there is no corresponding code in the table. + + + + Chooses the mode. + + The content. + + + + + Choose the best mode by examining the content. Note that 'encoding' is used as a hint; + if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}. + + The content. + The encoding. + + + + + true if the number of input bits will fit in a code with the specified version and error correction level. + + + + Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24). + + The num data bytes. + The bits. + + + + Get number of data bytes and number of error correction bytes for block id "blockID". Store + the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of + JISX0510:2004 (p.30) + + The num total bytes. + The num data bytes. + The num RS blocks. + The block ID. + The num data bytes in block. + The num EC bytes in block. + + + + Interleave "bits" with corresponding error correction bytes. On success, store the result in + "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details. + + The bits. + The num total bytes. + The num data bytes. + The num RS blocks. + + + + + Append mode info. On success, store the result in "bits". + + The mode. + The bits. + + + + Append length info. On success, store the result in "bits". + + The num letters. + The version. + The mode. + The bits. + + + + Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits". + + The content. + The mode. + The bits. + The encoding. + + + + + + Satoru Takabayashi + Daniel Switkin + Sean Owen + + + + Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and + give penalty to them. Example: 00000 or 11111. + + The matrix. + + + + + Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give + penalty to them. This is actually equivalent to the spec's rule, which is to find MxN blocks and give a + penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block. + + The matrix. + + + + + Apply mask penalty rule 3 and return the penalty. Find consecutive cells of 00001011101 or + 10111010000, and give penalty to them. If we find patterns like 000010111010000, we give + penalties twice (i.e. 40 * 2). + + The matrix. + + + + + Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give + penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance. + + The matrix. + + + + + Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask + pattern conditions. + + The mask pattern. + The x. + The y. + + + + + Helper function for applyMaskPenaltyRule1. We need this for doing this calculation in both + vertical and horizontal orders respectively. + + The matrix. + if set to true [is horizontal]. + + + + + + + + satorux@google.com (Satoru Takabayashi) - creator + + + + + Set all cells to 2. 2 means that the cell is empty (not set yet). + + JAVAPORT: We shouldn't need to do this at all. The code should be rewritten to begin encoding + with the ByteMatrix initialized all to zero. + + The matrix. + + + + Build 2D matrix of QR Code from "dataBits" with "ecLevel", "version" and "getMaskPattern". On + success, store the result in "matrix" and return true. + + The data bits. + The ec level. + The version. + The mask pattern. + The matrix. + + + + Embed basic patterns. On success, modify the matrix and return true. + The basic patterns are: + - Position detection patterns + - Timing patterns + - Dark dot at the left bottom corner + - Position adjustment patterns, if need be + + The version. + The matrix. + + + + Embed type information. On success, modify the matrix. + + The ec level. + The mask pattern. + The matrix. + + + + Embed version information if need be. On success, modify the matrix and return true. + See 8.10 of JISX0510:2004 (p.47) for how to embed version information. + + The version. + The matrix. + + + + Embed "dataBits" using "getMaskPattern". On success, modify the matrix and return true. + For debugging purposes, it skips masking process if "getMaskPattern" is -1. + See 8.7 of JISX0510:2004 (p.38) for how to embed data bits. + + The data bits. + The mask pattern. + The matrix. + + + + Return the position of the most significant bit set (to one) in the "value". The most + significant bit is position 32. If there is no bit set, return 0. Examples: + - findMSBSet(0) => 0 + - findMSBSet(1) => 1 + - findMSBSet(255) => 8 + + The value_ renamed. + + + + + Calculate BCH (Bose-Chaudhuri-Hocquenghem) code for "value" using polynomial "poly". The BCH + code is used for encoding type information and version information. + Example: Calculation of version information of 7. + f(x) is created from 7. + - 7 = 000111 in 6 bits + - f(x) = x^2 + x^2 + x^1 + g(x) is given by the standard (p. 67) + - g(x) = x^12 + x^11 + x^10 + x^9 + x^8 + x^5 + x^2 + 1 + Multiply f(x) by x^(18 - 6) + - f'(x) = f(x) * x^(18 - 6) + - f'(x) = x^14 + x^13 + x^12 + Calculate the remainder of f'(x) / g(x) + x^2 + __________________________________________________ + g(x) )x^14 + x^13 + x^12 + x^14 + x^13 + x^12 + x^11 + x^10 + x^7 + x^4 + x^2 + -------------------------------------------------- + x^11 + x^10 + x^7 + x^4 + x^2 + + The remainder is x^11 + x^10 + x^7 + x^4 + x^2 + Encode it in binary: 110010010100 + The return value is 0xc94 (1100 1001 0100) + + Since all coefficients in the polynomials are 1 or 0, we can do the calculation by bit + operations. We don't care if coefficients are positive or negative. + + The value. + The poly. + + + + + Make bit vector of type information. On success, store the result in "bits" and return true. + Encode error correction level and mask pattern. See 8.9 of + JISX0510:2004 (p.45) for details. + + The ec level. + The mask pattern. + The bits. + + + + Make bit vector of version information. On success, store the result in "bits" and return true. + See 8.10 of JISX0510:2004 (p.45) for details. + + The version. + The bits. + + + + Check if "value" is empty. + + The value. + + true if the specified value is empty; otherwise, false. + + + + + Embed the lonely dark dot at left bottom corner. JISX0510:2004 (p.46) + + The matrix. + + + + + + The x start. + The y start. + The matrix. + + + + Embed position detection patterns and surrounding vertical/horizontal separators. + + The matrix. + + + + Embed position adjustment patterns if need be. + + The version. + The matrix. + + + + * Encoder that encodes minimally + * + * Algorithm: + * + * The eleventh commandment was "Thou Shalt Compute" or "Thou Shalt Not Compute" - I forget which(Alan Perilis). + * + * This implementation computes.As an alternative, the QR-Code specification suggests heuristics like this one: + * + * If initial input data is in the exclusive subset of the Alphanumeric character set AND if there are less than + * [6,7,8] characters followed by data from the remainder of the 8-bit byte character set, THEN select the 8- + * bit byte mode ELSE select Alphanumeric mode; + * + * This is probably right for 99.99% of cases but there is at least this one counter example: The string "AAAAAAa" + * encodes 2 bits smaller as ALPHANUMERIC(AAAAAA), BYTE(a) than by encoding it as BYTE(AAAAAAa). + * Perhaps that is the only counter example but without having proof, it remains unclear. + * + * ECI switching: + * + * In multi language content the algorithm selects the most compact representation using ECI modes. + * For example the most compact representation of the string "\u0150\u015C" (O-double-acute, S-circumflex) is + * ECI(UTF-8), BYTE(\u0150\u015C) while prepending one or more times the same leading character as in + * "\u0150\u0150\u015C", the most compact representation uses two ECIs so that the string is encoded as + * ECI(ISO-8859-2), BYTE(\u0150\u0150), ECI(ISO-8859-3), BYTE(\u015C). + * + * @author Alex Geller + + + + + Creates a MinimalEncoder + + The string to encode + The preferred . When the value of the argument is null, the algorithm + * chooses charsets that leads to a minimal representation.Otherwise the algorithm will use the priority + * charset to encode any character in the input that can be encoded by it if the charset is among the + * supported charsets. + {@code true} if a FNC1 is to be prepended; {@code false} otherwise + The error correction level. + + + + Encodes the string minimally + + The string to encode + The preferred . A minimal version is computed(see + {@link ResultList#getVersion method} when the value of the argument is null + The preferred { @link Charset}. When the value of the argument is null, the algorithm + chooses charsets that leads to a minimal representation.Otherwise the algorithm will use the priority + charset to encode any character in the input that can be encoded by it if the charset is among the + supported charsets. + { @code true} if a FNC1 is to be prepended;{ @code false}otherwise + The error correction level. + An instance of { @code ResultList} + representing the minimal solution. + @see ResultList#getBits + @see ResultList#getVersion + @see ResultList#getSize + + + + returns the size in bits + + + + + appends the bits + + + + + + returns the size in bits + + + + + + returns the length in characters according to the specification (differs from getCharacterLength() in BYTE mode + for multi byte encoded characters) + + + + + + appends the bits + + + + + satorux@google.com (Satoru Takabayashi) - creator + dswitkin@google.com (Daniel Switkin) - ported from C++ + + + + + + + + + Initializes a new instance of the class. + + + + + Gets or sets the mode, not relevant if is selected. + + + The mode. + + + + + Gets or sets the EC level. + + + The EC level. + + + + + Gets or sets the version. + + + The version. + + + + + Gets or sets the mask pattern. + + + The mask pattern. + + + + + Gets or sets the matrix. + + + The matrix. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Check if "mask_pattern" is valid. + + The mask pattern. + + true if [is valid mask pattern] [the specified mask pattern]; otherwise, false. + + + + + The class holds the available options for the QrCodeWriter + + + + + Specifies what degree of error correction to use, for example in QR Codes. + Type depends on the encoder. For example for QR codes it's type + . + + + + + Specifies what character encoding to use where applicable (type ) + + + + + Explicitly disables ECI segment when generating QR Code + That is against the specification of QR Code but some + readers have problems if the charset is switched from + ISO-8859-1 (default) to UTF-8 with the necessary ECI segment. + If you set the property to true you can use UTF-8 encoding + and the ECI segment is omitted. + + + + + Specifies the exact version of QR code to be encoded. An integer, range 1 to 40. If the data specified + cannot fit within the required version, a WriterException will be thrown. + + + + + Specifies whether to use compact mode for QR code (type , or "true" or "false" + Please note that when compaction is performed, the most compact character encoding is chosen + for characters in the input that are not in the ISO-8859-1 character set. Based on experience, + some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can + be forced to UTF-8 by means of the encoding hint. + + + + + Specifies the QR code mask pattern to be used. Allowed values are + 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select + the optimal mask pattern. + + + + + This implementation can detect and decode QR Codes in an image. + Sean Owen + + + + + Gets the decoder. + + + + + + Locates and decodes a QR code in an image. + + a String representing the content encoded by the QR code + + + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + This method detects a code in a "pure" image -- that is, pure monochrome image + which contains only an unrotated, unskewed, image of a code, with some white border + around it. This is a specialized method that works exceptionally fast in this special + case. + + + + + + + This object renders a QR Code as a BitMatrix 2D array of greyscale values. + + dswitkin@google.com (Daniel Switkin) + + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + + Renders the given as a , scaling the + same to be compliant with the provided dimensions. + +

If no scaling is required, both {@code width} and {@code height} + arguments should be non-positive numbers.

+
+ {@code QRCode} to be adapted as a {@code BitMatrix} + desired width for the {@code QRCode} (in pixel units) + desired height for the {@code QRCode} (in pixel units) + the size of the QR quiet zone (in pixel units) + + {@code BitMatrix} instance + if code is null + if code.Matrix is null +
+ + + Implementations of this interface can decode an image of a barcode in some format into + the String it encodes. For example, can + decode a QR code. The decoder may optionally receive hints from the caller which may help + it decode more quickly or accurately. + + See , which attempts to determine what barcode + format is present within the image as well, and then decodes it accordingly. + + Sean Owen + dswitkin@google.com (Daniel Switkin) + + + + Locates and decodes a barcode in some format within an image. + + image of barcode to decode + String which the barcode encodes + + + Locates and decodes a barcode in some format within an image. This method also accepts + hints, each possibly associated to some data, which may help the implementation decode. + + image of barcode to decode + passed as a from + to arbitrary data. The + meaning of the data depends upon the hint type. The implementation may or may not do + anything with these hints. + + String which the barcode encodes + + + + Resets any internal state the implementation has after a decode, to prepare it + for reuse. + + + + + The general exception class throw when something goes wrong during decoding of a barcode. + This includes, but is not limited to, failing checksums / error correction algorithms, being + unable to locate finder timing patterns, and so on. + + Sean Owen + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class. + + The inner exception. + + + + Initializes a new instance of the class. + + The inner exception. + + + + + An alternative that gives a better looking result for + EAN-8, EAN-13, UPC-A and UPC-E barcodes with text. + + + + + This renderer uses smaller font versions for UPC labels. This enum stores info for use of that. + + + + + Use small version of the font + + + + + Use normal version + + + + + For each type of barcode this struct contains all the info on how to split the text content + into blocks and where to print those blocks with respect to the start of the barcode, which + is dynamicly determined while printing the bars. + + A 'real' barcode consists of an start-section, a number of bars of constant width (7 units for + EAN and UPC codes), optionally a middle-section and another number of bars, and and end-section. + Start-section, middle-section and end-section may have different widths. + E.g. an EAN-13 baecode has a 3 units wide start, 6 bars of 7 wide, a 5 wide middle-section + anothers 6 bars of 7 wide and a 3 wide end-section for a total of 95 units. + + + + Required length of text + + + Total width of barcode in units + + + Start of a text block in contents + + + Which font to use for block + + + Index in barcode units for printing. If -1, align before barcode + + + Width of block to clear in barcode units + + + + Static constructor, sets defaults + + + + + Initializes a new instance of the class. + + + + + Overrides the drawing methods for EAN-8, EAN-13, UPC-A and UPC-E barcodes. + For other types it chains to the original renderer. + + The matrix with the pre-rendered data. + The . + The textual description of the code. + The options for rendering. + A Windows Bitmap containing the barcode. + + + + Draws the text part of the barcode bitmap. + + The grapics context to draw on. + Barcode text + Print specifications + The selected font + Position of first a bar in pixels + Last position of a bar in pixels + Top of text in pixels + Height of text in pixels + Success + when no space for required text. + + + + Split content in seperate groups for pretty printing + + The content string + The printing info + One or more content group strings + + + + Renders a to a image + + + + + Gets or sets the foreground color. + + The foreground color. + + + + Gets or sets the background color. + + The background color. + + + + Gets or sets the resolution which should be used to create the bitmap + If nothing is set the current system settings are used + + + + + Gets or sets the resolution which should be used to create the bitmap + If nothing is set the current system settings are used + + + + + Gets or sets the text font. + + + The text font. + + + + + Initializes a new instance of the class. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + The options. + + + + + Interface for a class to convert a BitMatrix to an output image format + + + + + Renders the specified matrix to its graphically representation + + The matrix. + The format. + The encoded content of the barcode which should be included in the image. + That can be the numbers below a 1D barcode or something other. + + + + + Renders the specified matrix to its graphically representation + + The matrix. + The format. + The encoded content of the barcode which should be included in the image. + That can be the numbers below a 1D barcode or something other. + The options. + + + + + represents the generated code as a byte array with pixel data (4 byte per pixel, BGRA) + + + represents the generated code as a byte array with pixel data (4 byte per pixel, BGRA) + + + + + converts the pixel data to a bitmap object + + + + + + the generated code as byte array of BGRA pixels + + + + + the width of the image + + + + + the height of the image + + + + + Renders a to an byte array with pixel data (4 byte per pixel, BGRA) + + + + + Gets or sets the foreground color. + + + The foreground color. + + + + + Gets or sets the background color. + + + The background color. + + + + + Initializes a new instance of the class. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + The options. + + + + Renders a to a + + + + Foreground/filled Char. + + + Background/blank Char. + + + + + + + + + + + + + + + + + + + + + + + get or set the string which should be used for line breaks + + + + + Renders a barcode into a Svg image + + + + + the default font name if nothing else is set (Arial) + + + + + the default font size if nothing else is set (10) + + + + + Gets or sets the foreground color. + + The foreground color. + + + + Gets or sets the background color. + + The background color. + + + + Gets or sets the font family name + + The font family name. + + + + Gets or sets the font size in pixel + + The font size in pixel. + + + + Initializes a new instance of the class. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + + + + + Renders the specified matrix. + + The matrix. + The format. + The content. + The options. + + + + + Represents a barcode as a Svg image + + + + + Gets or sets the content. + + + The content. + + + + + The original height of the bitmatrix for the barcode + + + + + The original width of the bitmatrix for the barcode + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The content. + + + + Gives the XML representation of the SVG image + + + + + Encapsulates the result of decoding a barcode within an image. + + + + raw text encoded by the barcode, if applicable, otherwise null + + + raw bytes encoded by the barcode, if applicable, otherwise null + + + + points related to the barcode in the image. These are typically points + identifying finder patterns or the corners of the barcode. The exact meaning is + specific to the type of barcode that was decoded. + + + + {@link BarcodeFormat} representing the format of the barcode that was decoded + + + + {@link Hashtable} mapping {@link ResultMetadataType} keys to values. May be + null. This contains optional metadata about what was detected about the barcode, + like orientation. + + + + + Gets the timestamp. + + + + + how many bits of are valid; typically 8 times its length + + + + + Initializes a new instance of the class. + + The text. + The raw bytes. + The result points. + The format. + + + + Initializes a new instance of the class. + + The text. + The raw bytes. + + The result points. + The format. + + + + Initializes a new instance of the class. + + The text. + The raw bytes. + The result points. + The format. + The timestamp. + + + + Initializes a new instance of the class. + + The text. + The raw bytes. + + The result points. + The format. + The timestamp. + + + + Adds one metadata to the result + + The type. + The value. + + + + Adds a list of metadata to the result + + The metadata. + + + + Adds the result points. + + The new points. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Represents some type of metadata about the result of the decoding that the decoder + wishes to communicate back to the caller. + + Sean Owen + + + + Unspecified, application-specific metadata. Maps to an unspecified . + + + + + Denotes the likely approximate orientation of the barcode in the image. This value + is given as degrees rotated clockwise from the normal, upright orientation. + For example a 1D barcode which was found by reading top-to-bottom would be + said to have orientation "90". This key maps to an whose + value is in the range [0,360). + + + + +

2D barcode formats typically encode text, but allow for a sort of 'byte mode' + which is sometimes used to encode binary data. While makes available + the complete raw bytes in the barcode for these formats, it does not offer the bytes + from the byte segments alone.

+

This maps to a of byte arrays corresponding to the + raw bytes in the byte segments in the barcode, in order.

+
+
+ + + Error correction level used, if applicable. The value type depends on the + format, but is typically a String. + + + + + The number of errors corrected. If applicable, maps to an of value + greater than or equal to zero. + + + + + The number of erasures corrected. If applicable, maps to an of value + greater than or equal to zero. + + + + + For some periodicals, indicates the issue number as an . + + + + + For some products, indicates the suggested retail price in the barcode as a + formatted . + + + + + For some products, the possible country of manufacture as a denoting the + ISO country code. Some map to multiple possible countries, like "US/CA". + + + + + For some products, the extension text. + + + + + If the code format supports structured append and + the current scanned code is part of one then the + sequence number is given with it. + + + + + If the code format supports structured append and + the current scanned code is part of one then the + parity is given with it. + + + + + PDF417-specific metadata. + + + + + Aztec-specific metadata + + + + + Barcode Symbology Identifier. + Note: According to the GS1 specification the identifier may have to replace a leading FNC1/GS character when prepending to the barcode content. + + + + + The bit mask applied to a QR code + + + + + Encapsulates a point of interest in an image containing a barcode. Typically, this + would be the location of a finder pattern or the corner of the barcode, for example. + + Sean Owen + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The x. + The y. + + + + Gets the X. + + + + + Gets the Y. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Orders an array of three ResultPoints in an order [A,B,C] such that AB is less than AC and + BC is less than AC and the angle between BC and BA is less than 180 degrees. + + array of three to order + + + + calculates the distance between two points + + first pattern + second pattern + + distance between two points + + + + + Returns the z component of the cross product between vectors BC and BA. + + + + Callback which is invoked when a possible result point (significant + point in the barcode image such as a corner) is found. + + + + + + + + Luminance source class which support different formats of images. + + + + + enumeration of supported bitmap format which the RGBLuminanceSource can process + + + + + format of the byte[] isn't known. RGBLuminanceSource tries to determine the best possible value + + + + + grayscale array, the byte array is a luminance array with 1 byte per pixel + + + + + grayscale array, the byte array is a luminance array with 2 bytes per pixel + + + + + 3 bytes per pixel with the channels red, green and blue + + + + + 4 bytes per pixel with the channels red, green and blue + + + + + 4 bytes per pixel with the channels alpha, red, green and blue + + + + + 3 bytes per pixel with the channels blue, green and red + + + + + 4 bytes per pixel with the channels blue, green and red + + + + + 4 bytes per pixel with the channels blue, green, red and alpha + + + + + 2 bytes per pixel, 5 bit red, 6 bits green and 5 bits blue + + + + + 4 bytes per pixel with the channels red, green, blue and alpha + + + + + 4 bytes for two pixels, UYVY formatted + + + + + 4 bytes for two pixels, YUYV formatted + + + + + Initializes a new instance of the class. + + The width. + The height. + + + + Initializes a new instance of the class. + It supports a byte array with 3 bytes per pixel (RGB24). + + The RGB raw bytes. + The width. + The height. + + + + Initializes a new instance of the class. + It supports a byte array with 1 byte per pixel (Gray8). + That means the whole array consists of the luminance values (grayscale). + + The luminance array. + The width. + The height. + if set to true [is8 bit]. + + + + Initializes a new instance of the class. + It supports a byte array with 3 bytes per pixel (RGB24). + + The RGB raw bytes. + The width. + The height. + The bitmap format. + + + + Should create a new luminance source with the right class type. + The method is used in methods crop and rotate. + + The new luminances. + The width. + The height. + + + + + calculates the luminance values for the given byte array and bitmap format + + + + + + + Contains conversion support elements such as classes, interfaces and static methods. + + + + + Copies an array of chars obtained from a String into a specified array of chars + + The String to get the chars from + Position of the String to start getting the chars + Position of the String to end getting the chars + Array to return the chars + Position of the destination array of chars to start storing the chars + An array of chars + + + + Sets the capacity for the specified List + + The List which capacity will be set + The new capacity value + + + + Converts a string-Collection to an array + + The strings. + + + + + Joins all elements to one string. + + + The separator. + The values. + + + + + Fills the specified array. + (can't use extension method because of .Net 2.0 support) + + + The array. + The value. + + + + Fills the specified array. + (can't use extension method because of .Net 2.0 support) + + + The array. + The start index. + The end index. + The value. + + + + + + + + + + + + + + + + + + Savely gets the value of a decoding hint + if hints is null the default is returned + + + The hints. + Type of the hint. + The @default. + + + + The base class for all objects which encode/generate a barcode image. + + + dswitkin@google.com (Daniel Switkin) + + www.Redivivus.in (suraj.supekar@redivivus.in) - Ported from ZXING Java Source + + + + + Encode a barcode using the default settings. + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + The contents to encode in the barcode + The barcode format to generate + The preferred width in pixels + The preferred height in pixels + Additional parameters to supply to the encoder + The generated barcode as a Matrix of unsigned bytes (0 == black, 255 == white) + + + + A base class which covers the range of exceptions which may occur when encoding a barcode using + the Writer framework. + + dswitkin@google.com (Daniel Switkin) + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message. + + + + Initializes a new instance of the class. + + The message. + The inner exc. + + + + Integer inefficiently represented internally using base-10 digits, in order to allow a + visual representation as a base-10 string. Only for internal use. + + + + + 10 numeration base for string representation, very inefficient for computations. + + + + + Maximum size for numbers is up to 10240 binary digits or approximately (safe to use) 3000 decimal digits. + The maximum size is, in fact, double the previously specified amount, in order to accommodate operations' + overflow. + + + + Integer constants + + + + The array of digits of the number. + + + + + The actual number of digits of the number. + + + + + The number sign. + + + + + Sets the number sign. + + + + + Default constructor, intializing the Base10BigInteger with zero. + + + + + Constructor creating a new Base10BigInteger as a conversion of a regular base-10 long. + + The base-10 long to be converted + + + + Constructor creating a new Base10BigInteger as a copy of an existing Base10BigInteger. + + The Base10BigInteger to be copied + + + + Determines whether the specified Base10BigInteger is equal to the current Base10BigInteger. + + The Base10BigInteger to compare with the current Base10BigInteger + True if the specified Base10BigInteger is equal to the current Base10BigInteger, + false otherwise + + + + Determines whether the specified System.Object is equal to the current Base10BigInteger. + + The System.Object to compare with the current Base10BigInteger + True if the specified System.Object is equal to the current Base10BigInteger, + false otherwise + + + + Serves as a hash function for the Base10BigInteger type. + + A hash code for the current Base10BigInteger + + + + String representation of the current Base10BigInteger, converted to its base-10 representation. + + The string representation of the current Base10BigInteger + + + + Base10BigInteger inverse with respect to addition. + + The Base10BigInteger whose opposite is to be computed + The Base10BigInteger inverse with respect to addition + + + + Greater test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a > b, false otherwise + + + + Greater or equal test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a >= b, false otherwise + + + + Smaller test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a < b, false otherwise + + + + Smaller or equal test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a <= b, false otherwise + + + + Computes the absolute value of a Base10BigInteger. + + The Base10BigInteger whose absolute value is to be computed + The absolute value of the given BigInteger + + + + Addition operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the addition + + + + Subtraction operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the subtraction + + + + Multiplication operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the multiplication + + + + Implicit conversion operator from long to Base10BigInteger. + + The long to be converted to a Base10BigInteger + The Base10BigInteger converted from the given long + + + + Equality test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a == b, false otherwise + + + + Inequality test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a != b, false otherwise + + + + Greater test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a > b, false otherwise + + + + Smaller test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a < b, false otherwise + + + + Greater or equal test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a >= b, false otherwise + + + + Smaller or equal test between two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + True if a <= b, false otherwise + + + + Base10BigInteger inverse with respect to addition. + + The Base10BigInteger whose opposite is to be computed + The Base10BigInteger inverse with respect to addition + + + + Addition operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the addition + + + + Subtraction operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the subtraction + + + + Multiplication operation of two Base10BigIntegers. + + The 1st Base10BigInteger + The 2nd Base10BigInteger + The Base10BigInteger result of the multiplication + + + + Incremetation by one operation of a Base10BigInteger. + + The Base10BigInteger to be incremented by one + The Base10BigInteger result of incrementing by one + + + + Decremetation by one operation of a Base10BigInteger. + + The Base10BigInteger to be decremented by one + The Base10BigInteger result of decrementing by one + + + + Adds two BigNumbers a and b, where a >= b, a, b non-negative. + + + + + Subtracts the Base10BigInteger b from the Base10BigInteger a, where a >= b, a, b non-negative. + + + + + Multiplies two Base10BigIntegers. + + + + + .NET 2.0 class for handling of very large integers, up to 10240 binary digits or + approximately (safe to use) 3000 decimal digits. + + + + + 2^16 numeration base for internal computations, in order to benefit the most from the + 32 bit (or 64 bit) integer processor registers. + + + + + Maximum size for numbers is up to 10240 binary digits or approximately (safe to use) 3000 decimal digits. + The maximum size is, in fact, double the previously specified amount, in order to accommodate operations's + overflow. + + + + + Ratio for the convertion of a BigInteger's size to a binary digits size. + + + + Integer constants + + + + The array of digits of the number. + + + + + The actual number of digits of the number. + + + + + The number sign. + + + + + Default constructor, intializing the BigInteger with zero. + + + + + Constructor creating a new BigInteger as a conversion of a regular base-10 long. + + The base-10 long to be converted + + + + Constructor creating a new BigInteger as a copy of an existing BigInteger. + + The BigInteger to be copied + + + + Constructor creating a BigInteger instance out of a base-10 formatted string. + + The base-10 formatted string. + Invalid numeric string exception + + + + Constructor creating a positive BigInteger by extracting it's digits from a given byte array. + + The byte array + The byte array's content exceeds the maximum size of a BigInteger + exception + + + + Constructor deserializing a BigInteger. + + + + + BigInteger serializing method, which should not be called manually. + + Serialization information object + Streaming context object + Public access + + + + Determines whether the specified BigInteger is equal to the current BigInteger. + + The BigInteger to compare with the current BigInteger + True if the specified BigInteger is equal to the current BigInteger, + false otherwise + + + + Determines whether the specified System.Object is equal to the current BigInteger. + + The System.Object to compare with the current BigInteger + True if the specified System.Object is equal to the current BigInteger, + false otherwise + + + + Serves as a hash function for the BigInteger type. + + A hash code for the current BigInteger + + + + String representation of the current BigInteger, converted to its base-10 representation. + + The string representation of the current BigInteger + + + + Parses the number given by a string + + the number as a string + + + + + Compares this instance to a specified BigInteger. + + The BigInteger to compare this instance with + -1 if the current instance is smaller than the given BigInteger, + 0 if the two are equal, 1 otherwise + + + + Compares this instance to a specified object. + + The object to compare this instance with + -1 if the current instance is smaller than the given object, + 0 if the two are equal, 1 otherwise + obj is not a BigInteger exception + + + + Returns a BigInteger's size in binary digits. + + The BigInteger whose size in binary digits is to be determined + The BigInteger's size in binary digits + + + + BigInteger inverse with respect to addition. + + The BigInteger whose opposite is to be computed + The BigInteger inverse with respect to addition + + + + Greater test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a > b, false otherwise + + + + Greater or equal test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a >= b, false otherwise + + + + Smaller test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a < b, false otherwise + + + + Smaller or equal test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a <= b, false otherwise + + + + Computes the absolute value of a BigInteger. + + The BigInteger whose absolute value is to be computed + The absolute value of the given BigInteger + + + + Addition operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the addition + + + + Subtraction operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the subtraction + + + + Multiplication operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the multiplication + + + + Division operation of two BigIntegers a and b, b != 0. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the division + Cannot divide by zero exception + + + + Modulo operation of two BigIntegers a and b, b != 0. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the modulo + Cannot divide by zero exception + + + + Returns the power of a BigInteger base to a non-negative exponent by using the + fast exponentiation algorithm (right to left binary exponentiation). + + The BigInteger base + The non-negative exponent + The power of the BigInteger base to the non-negative exponent + Cannot raise a BigInteger to a negative power exception. + + + + Integer square root of the given BigInteger using Newton's numeric method. + + The BigInteger whose integer square root is to be computed + The integer square root of the given BigInteger + Cannot compute the integer square root of a negative number exception + + + + Euclidean algorithm for computing the greatest common divisor of two non-negative BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The greatest common divisor of the two given BigIntegers + Cannot compute the Gcd of negative BigIntegers exception + + + + Extended Euclidian Gcd algorithm, returning the greatest common divisor of two non-negative BigIntegers, + while also providing u and v, where: a*u + b*v = gcd(a,b). + + The 1st BigInteger + The 2nd BigInteger + Output BigInteger parameter, where a*u + b*v = gcd(a,b) + Output BigInteger parameter, where a*u + b*v = gcd(a,b) + The greatest common divisor of the two given BigIntegers + Cannot compute the Gcd of negative BigIntegers exception + + + + Computes the modular inverse of a given BigInteger. + + The non-zero BigInteger whose inverse is to be computed + The BigInteger modulus, which must be greater than or equal to 2 + The BigInteger equal to a^(-1) mod n + Invalid number or modulus exception + + + + Returns the power of a BigInteger to a non-negative exponent modulo n, by using the + fast exponentiation algorithm (right to left binary exponentiation) and modulo optimizations. + + The BigInteger base + The non-negative exponent + The modulus, which must be greater than or equal to 2 + The power of the BigInteger to the non-negative exponent + Invalid exponent or modulus exception + + + + Implicit conversion operator from long to BigInteger. + + The long to be converted to a BigInteger + The BigInteger converted from the given long + + + + Implicit conversion operator from int to BigInteger. + + The int to be converted to a BigInteger + The BigInteger converted from the given int + + + + Equality test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a == b, false otherwise + + + + Inequality test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a != b, false otherwise + + + + Greater test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a > b, false otherwise + + + + Smaller test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a < b, false otherwise + + + + Greater or equal test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a >= b, false otherwise + + + + Smaller or equal test between two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + True if a <= b, false otherwise + + + + BigInteger inverse with respect to addition. + + The BigInteger whose opposite is to be computed + The BigInteger inverse with respect to addition + + + + Addition operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the addition + + + + Subtraction operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the subtraction + + + + Multiplication operation of two BigIntegers. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the multiplication + + + + Division operation of two BigIntegers a and b, b != 0. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the division + Cannot divide by zero exception + + + + Modulo operation of two BigIntegers a and b, b != 0. + + The 1st BigInteger + The 2nd BigInteger + The BigInteger result of the modulo + Cannot divide by zero exception + + + + Incremetation by one operation of a BigInteger. + + The BigInteger to be incremented by one + The BigInteger result of incrementing by one + + + + Decremetation by one operation of a BigInteger. + + The BigInteger to be decremented by one + The BigInteger result of decrementing by one + + + + Adds two BigNumbers a and b, where a >= b, a, b non-negative. + + + + + Subtracts the BigInteger b from the BigInteger a, where a >= b, a, b non-negative. + + + + + Multiplies two BigIntegers. + + + + + Divides a BigInteger by a one-digit int. + + + + + Divides a BigInteger by another BigInteger. + + + + + DivideByBigNumber auxiliary method. + + + + + DivideByBigNumber auxilary method. + + + + + DivideByBigNumber auxilary method. + + + + + BigInteger-related exception class. + + + + + BigIntegerException constructor. + + The exception message + The inner exception + + + + The number's sign, where Positive also stands for the number zero. + + +
+
diff --git a/Assets/答题.json.meta b/Assets/Plugins/net2.0/zxing.XML.meta similarity index 75% rename from Assets/答题.json.meta rename to Assets/Plugins/net2.0/zxing.XML.meta index 20e6a81..1f9aabb 100644 --- a/Assets/答题.json.meta +++ b/Assets/Plugins/net2.0/zxing.XML.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 683775f18ffad45489f18e47e92d3b3f +guid: 194b916ca7a1a744ea8a07bd61dcf461 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/net2.0/zxing.dll b/Assets/Plugins/net2.0/zxing.dll new file mode 100644 index 0000000..111b84f Binary files /dev/null and b/Assets/Plugins/net2.0/zxing.dll differ diff --git a/Assets/Plugins/net2.0/zxing.dll.meta b/Assets/Plugins/net2.0/zxing.dll.meta new file mode 100644 index 0000000..84db1ba --- /dev/null +++ b/Assets/Plugins/net2.0/zxing.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 663300484feb96d438e2f609415c49b9 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Res/language/language.json b/Assets/Res/language/language.json index 29bcb3c..d2d7554 100644 --- a/Assets/Res/language/language.json +++ b/Assets/Res/language/language.json @@ -398,6 +398,41 @@ "key": "100080", "zh": "定时设置", "en": "Timer Settings" + }, + { + "key": "100081", + "zh": "蓝牙未连接", + "en": "Bluetooth not connected" + }, + { + "key": "100082", + "zh": "请输入WiFi名称", + "en": "Please enter the WiFi name" + }, + { + "key": "100083", + "zh": "WiFi配置失败", + "en": "WiFi configuration failed" + }, + { + "key": "100084", + "zh": "不是可解析的二维码", + "en": "Not a valid QR code" + }, + { + "key": "100085", + "zh": "需要相机权限", + "en": "Camera permission required" + }, + { + "key": "100086", + "zh": "没有可用的相机", + "en": "No available camera found" + }, + { + "key": "100087", + "zh": "绑定设备失败", + "en": "Bind device failed" } ] diff --git a/Assets/Res/ui/connectdevicepage/connectDevicePage.prefab b/Assets/Res/ui/connectdevicepage/connectDevicePage.prefab index 96d9ee7..333f731 100644 --- a/Assets/Res/ui/connectdevicepage/connectDevicePage.prefab +++ b/Assets/Res/ui/connectdevicepage/connectDevicePage.prefab @@ -435,7 +435,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 22.499966, y: 0} + m_AnchoredPosition: {x: 22.49997, y: 0} m_SizeDelta: {x: -224.99992, y: -50} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &5023175048173340824 @@ -643,7 +643,7 @@ GameObject: - component: {fileID: 8699770605319373498} - component: {fileID: 3146394913032290597} m_Layer: 5 - m_Name: "\u8FD4\u56DE" + m_Name: ok m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -750,7 +750,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 8699770605319373498} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: BackToHomePage + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &988057154901937007 GameObject: m_ObjectHideFlags: 0 @@ -1251,10 +1263,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 5409940142953436106} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 79, y: -24} + m_SizeDelta: {x: 48, y: 48} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3344092125837105518 CanvasRenderer: @@ -1428,7 +1440,19 @@ MonoBehaviour: m_Calls: [] m_OnDidEndEdit: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: CheckWifiNameAndPassword + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_OnValueChanged: m_PersistentCalls: m_Calls: [] @@ -1574,7 +1598,19 @@ MonoBehaviour: m_Calls: [] m_OnDidEndEdit: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: CheckWifiNameAndPassword + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_OnValueChanged: m_PersistentCalls: m_Calls: [] @@ -1619,10 +1655,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 5409940142953436106} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 257.5, y: -24} + m_SizeDelta: {x: 253, y: 33} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4250911166335314589 CanvasRenderer: @@ -1792,8 +1828,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 352.17856, y: -0.5} - m_SizeDelta: {x: 654.3571, y: 1} + m_AnchoredPosition: {x: 345, y: -0.5} + m_SizeDelta: {x: 640, y: 1} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3091012864071486640 CanvasRenderer: @@ -1872,7 +1908,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 41} + m_SizeDelta: {x: 0, y: 181} m_Pivot: {x: 0.5, y: 1} --- !u!222 &3494079613403270933 CanvasRenderer: @@ -2147,7 +2183,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 6325069307507327003} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: ShowSuccessPage + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &2513300336666857560 GameObject: m_ObjectHideFlags: 0 @@ -2401,7 +2449,8 @@ GameObject: m_Component: - component: {fileID: 7163027539311665957} - component: {fileID: 3037912135858668214} - - component: {fileID: 6233728829341084841} + - component: {fileID: 7322899035469920849} + - component: {fileID: 595539671003003557} m_Layer: 5 m_Name: Image m_TagString: Untagged @@ -2436,7 +2485,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2945323903071304015} m_CullTransparentMesh: 1 ---- !u!114 &6233728829341084841 +--- !u!114 &7322899035469920849 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -2445,7 +2494,7 @@ MonoBehaviour: m_GameObject: {fileID: 2945323903071304015} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -2456,16 +2505,27 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 + m_Texture: {fileID: 0} + m_UVRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 +--- !u!114 &595539671003003557 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2945323903071304015} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2f6d707cba0376a43bc6d9f0a27ea376, type: 3} + m_Name: + m_EditorClassIdentifier: + cameraPreview: {fileID: 7322899035469920849} + scanInterval: 0.2 --- !u!1 &3002205030434408749 GameObject: m_ObjectHideFlags: 0 @@ -2587,9 +2647,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} - m_TargetAssemblyTypeName: Kill.UI.Pages.SafetylearningPageCtrl, Assembly-CSharp - m_MethodName: ShowTestPage + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: OnWifiConfirmClick m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -2910,6 +2970,7 @@ GameObject: - component: {fileID: 8470092863222596142} - component: {fileID: 2618585265216864651} - component: {fileID: 7563423994747515918} + - component: {fileID: 7594996219059569243} m_Layer: 5 m_Name: connectDevicePage m_TagString: Untagged @@ -2979,6 +3040,39 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &7594996219059569243 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3618082575114099407} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc4db0165ab541a44978ccde28b3bc29, type: 3} + m_Name: + m_EditorClassIdentifier: + sonPages: + - {fileID: 8658000908082698746} + - {fileID: 1611181877072402757} + - {fileID: 3437907824073216706} + - {fileID: 6686558202161898212} + topBar: {fileID: 7798396753565683054} + blueToothNameKeyWord: Photon + backButton: {fileID: 1397406542994158436} + skipButton: {fileID: 3347539392583723740} + titleText: {fileID: 1585603659324209016} + scanningIcon: {fileID: 8864897383993974507} + qrCodePlane: {fileID: 2945323903071304015} + wifiNameInput: {fileID: 5119858561715144003} + wifiPasswordInput: {fileID: 2039610925894288914} + wifiConfirmButtons: + - {fileID: 5767282775733738409} + - {fileID: 3002205030434408749} + deviceObjects: [] + deviceListParent: {fileID: 2145748678941116742} + devicePrefab: {fileID: 9109268087238204734} + deviceListUi: {fileID: 7833149656934373945} --- !u!1 &3773169203690086790 GameObject: m_ObjectHideFlags: 0 @@ -3099,7 +3193,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 8153291896281977173} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: EnterConnectPage + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &3789234655480925417 GameObject: m_ObjectHideFlags: 0 @@ -3740,7 +3846,7 @@ GameObject: - component: {fileID: 7745107914549048796} - component: {fileID: 4608673497435011388} m_Layer: 5 - m_Name: icon + m_Name: "\u72B6\u6001" m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -5876,7 +5982,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 2130092054336787548} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 7594996219059569243} + m_TargetAssemblyTypeName: ConnectDevicePageCtrl, Assembly-CSharp + m_MethodName: ScanQrCode + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &7583618795190144410 GameObject: m_ObjectHideFlags: 0 @@ -6226,13 +6344,14 @@ GameObject: - component: {fileID: 6427568242623183702} - component: {fileID: 4926338476861759006} - component: {fileID: 3397136473555053414} + - component: {fileID: 1099820396088858073} m_Layer: 5 m_Name: "\u84DD\u7259\u626B\u63CF\u5217\u8868" m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &6427568242623183702 RectTransform: m_ObjectHideFlags: 0 @@ -6291,6 +6410,36 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &1099820396088858073 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7833149656934373945} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 1027440964492730408} + m_Horizontal: 0 + m_Vertical: 1 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 6427568242623183702} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 0 + m_VerticalScrollbarVisibility: 0 + m_HorizontalScrollbarSpacing: 0 + m_VerticalScrollbarSpacing: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] --- !u!1 &7872054224272033343 GameObject: m_ObjectHideFlags: 0 @@ -6637,7 +6786,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6952404845597796920 RectTransform: m_ObjectHideFlags: 0 @@ -6696,7 +6845,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: -48.999985, y: 0} + m_AnchoredPosition: {x: -49, y: 0} m_SizeDelta: {x: 48, y: 48} m_Pivot: {x: 1, y: 0.5} --- !u!222 &3914966073945110401 @@ -6971,7 +7120,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &626860580578846986 RectTransform: m_ObjectHideFlags: 0 @@ -6991,8 +7140,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 352.17856, y: -91} - m_SizeDelta: {x: 654.3571, y: 100} + m_AnchoredPosition: {x: 345, y: -91} + m_SizeDelta: {x: 640, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6890668240902078438 CanvasRenderer: diff --git a/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png b/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png new file mode 100644 index 0000000..0b01f98 Binary files /dev/null and b/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png differ diff --git a/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png.meta b/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png.meta new file mode 100644 index 0000000..50a67af --- /dev/null +++ b/Assets/Res/ui/homepage/3.3待机状态(产品图为亮屏状态,区分关机状态;设备实际为息屏) 1.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: d8f2f6e443f107242b048e8eae4700eb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Res/ui/homepage/网格 2.png b/Assets/Res/ui/homepage/网格 2.png new file mode 100644 index 0000000..143f1e3 Binary files /dev/null and b/Assets/Res/ui/homepage/网格 2.png differ diff --git a/Assets/Res/ui/homepage/网格 2.png.meta b/Assets/Res/ui/homepage/网格 2.png.meta new file mode 100644 index 0000000..a04053a --- /dev/null +++ b/Assets/Res/ui/homepage/网格 2.png.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: fd5678c2d7d53a049add20e7f6e34f3d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index 65c05b7..02f077b 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -338,6 +338,8 @@ GameObject: - component: {fileID: 609900190} - component: {fileID: 609900193} - component: {fileID: 609900192} + - component: {fileID: 609900195} + - component: {fileID: 609900194} m_Layer: 0 m_Name: Manager m_TagString: Untagged @@ -454,6 +456,37 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ab2938f4ffde3874dac6f3504af213b1, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &609900194 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 609900186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 91bf0ca06c32c924c82e026dbb6f2ad7, type: 3} + m_Name: + m_EditorClassIdentifier: + AutoConnect: 0 + ConnectionTimeout: 5 +--- !u!114 &609900195 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 609900186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 988c4ecb3723c08459756ef8e35db200, type: 3} + m_Name: + m_EditorClassIdentifier: + ResponseTimeout: 5 + ServiceUUID: 0000ffe0-0000-1000-8000-00805f9b34fb + WriteCharacteristicUUID: 0000ffe1-0000-1000-8000-00805f9b34fb + NotifyCharacteristicUUID: 0000ffe1-0000-1000-8000-00805f9b34fb + AutoInitialize: 1 --- !u!1 &769989590 GameObject: m_ObjectHideFlags: 0 @@ -1053,8 +1086,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 700841237938974310} + m_Children: [] m_Father: {fileID: 1547547273} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -1160,200 +1192,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1996378183} m_CullTransparentMesh: 1 ---- !u!1001 &700841237938974309 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 1896827481} - m_Modifications: - - target: {fileID: 1397406542994158436, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 0} - - target: {fileID: 3618082575114099407, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_Name - value: connectDevicePage - objectReference: {fileID: 0} - - target: {fileID: 3618082575114099407, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.x - value: 253 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.y - value: 33 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.x - value: 257.5 - objectReference: {fileID: 0} - - target: {fileID: 5022358398572850883, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.y - value: -24 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.x - value: 48 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.y - value: 48 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.x - value: 79 - objectReference: {fileID: 0} - - target: {fileID: 8438725810015241756, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.y - value: -24 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7bbd7ee77d6885a448f5da2020aad6d7, type: 3} ---- !u!224 &700841237938974310 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 8470092863222596142, guid: 7bbd7ee77d6885a448f5da2020aad6d7, - type: 3} - m_PrefabInstance: {fileID: 700841237938974309} - m_PrefabAsset: {fileID: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Bluetooth/BLECommunicationManager.cs b/Assets/Scripts/Bluetooth/BLECommunicationManager.cs index dbd56f0..6caafb1 100644 --- a/Assets/Scripts/Bluetooth/BLECommunicationManager.cs +++ b/Assets/Scripts/Bluetooth/BLECommunicationManager.cs @@ -2,6 +2,7 @@ using UnityEngine; using System; using System.Collections.Generic; using Kill.Bluetooth.Protocol; +using Kill.UI.Components; namespace Kill.Bluetooth { @@ -256,7 +257,7 @@ namespace Kill.Bluetooth /// /// 查询设备注册状态 (命令 0x01) /// - public void QueryRegistrationStatus(Action callback = null) + public void QueryRegistrationStatus(Action callback = null) { if (!CheckConnection()) return; @@ -276,13 +277,13 @@ namespace Kill.Bluetooth if (response.IsSuccess && response.Data != null) { var status = DeviceRegistrationStatus.FromBytes(response.Data); - callback?.Invoke(status); + callback?.Invoke(true,status); OnRegistrationStatusReceived?.Invoke(status); } else { LogError($"查询注册状态失败: 状态码={response.Status:X2}"); - callback?.Invoke(new DeviceRegistrationStatus()); + callback?.Invoke(false,new DeviceRegistrationStatus()); } }); } @@ -2309,17 +2310,91 @@ namespace Kill.Bluetooth #region 辅助方法 /// - /// 检查蓝牙连接状态 + /// 检查蓝牙连接状态(带自动初始化) /// private bool CheckConnection() { - if (BluetoothManager.Instance == null) return false; - if (!BluetoothManager.Instance.IsConnected) return false; - if (IsWaitingResponse) return false; + // 检查蓝牙管理器 + if (BluetoothManager.Instance == null) + { + LogError("BluetoothManager.Instance 为 null"); + return false; + } + + // 如果蓝牙未初始化,尝试自动初始化 + if (!BluetoothManager.Instance.IsInitialized) + { + Log("蓝牙未初始化,尝试自动初始化..."); + BluetoothManager.Instance.Initialize(); + return false; + } + + // 如果蓝牙未连接 + if (!BluetoothManager.Instance.IsConnected) + { + LogError("蓝牙未连接"); + ToastUI.Show("100081"); // "请先连接蓝牙设备" + return false; + } + + // 如果正在等待响应 + if (IsWaitingResponse) + { + Log("正在等待上一个响应..."); + return false; + } return true; } + /// + /// 确保蓝牙已初始化并连接(异步) + /// + public void EnsureBluetoothReady(System.Action onReady) + { + if (BluetoothManager.Instance == null) + { + LogError("BluetoothManager.Instance 为 null"); + return; + } + + // 如果已经连接,直接回调 + if (BluetoothManager.Instance.IsConnected) + { + onReady?.Invoke(); + return; + } + + // 如果未初始化,先初始化 + if (!BluetoothManager.Instance.IsInitialized) + { + Log("蓝牙未初始化,开始初始化..."); + BluetoothManager.Instance.Initialize(); + + // 订阅初始化完成事件 + System.Action onInitialized = null; + onInitialized = (success) => + { + BluetoothManager.Instance.OnInitialized -= onInitialized; + if (success) + { + Log("蓝牙初始化成功,可以开始扫描设备"); + onReady?.Invoke(); + } + else + { + LogError("蓝牙初始化失败"); + } + }; + BluetoothManager.Instance.OnInitialized += onInitialized; + } + else + { + // 已初始化但未连接 + onReady?.Invoke(); + } + } + /// /// 获取状态码描述 /// diff --git a/Assets/Scripts/Bluetooth/BluetoothManager.cs b/Assets/Scripts/Bluetooth/BluetoothManager.cs index 9341020..ba37001 100644 --- a/Assets/Scripts/Bluetooth/BluetoothManager.cs +++ b/Assets/Scripts/Bluetooth/BluetoothManager.cs @@ -45,14 +45,10 @@ namespace Kill.Bluetooth public bool IsScanning { get; private set; } public bool IsConnected { get; private set; } public string ConnectedDeviceAddress { get; private set; } - + private string aimMac = ""; // 扫描到的设备列表 public List DiscoveredDevices { get; private set; } = new List(); - // 上一次连接的设备地址 - private const string LAST_DEVICE_ADDRESS_KEY = "LastConnectedDeviceAddress"; - private const string LAST_DEVICE_NAME_KEY = "LastConnectedDeviceName"; - // 是否自动连接 public bool AutoConnect = true; @@ -82,7 +78,10 @@ namespace Kill.Bluetooth Instance = null; } } - + void Start() + { + Initialize(); + } private void Update() { // 检查连接超时 @@ -102,7 +101,7 @@ namespace Kill.Bluetooth } /// - /// 初始化蓝牙 + /// 初始化蓝牙(带自动启用) /// public void Initialize() { @@ -115,20 +114,228 @@ namespace Kill.Bluetooth Log("正在初始化蓝牙..."); + // 先检查蓝牙是否开启,如果没有则尝试启用 + CheckAndEnableBluetooth(() => + { + // 蓝牙已启用,执行初始化 + DoInitialize(); + }); + } + + /// + /// 检查并启用蓝牙 + /// + private void CheckAndEnableBluetooth(System.Action onBluetoothReady) + { +#if UNITY_ANDROID && !UNITY_EDITOR + using (AndroidJavaClass bluetoothAdapterClass = new AndroidJavaClass("android.bluetooth.BluetoothAdapter")) + { + AndroidJavaObject bluetoothAdapter = bluetoothAdapterClass.CallStatic("getDefaultAdapter"); + + if (bluetoothAdapter == null) + { + OnError?.Invoke("设备不支持蓝牙"); + OnInitialized?.Invoke(false); + return; + } + + bool isEnabled = bluetoothAdapter.Call("isEnabled"); + + if (!isEnabled) + { + Log("蓝牙未开启,尝试启用..."); + + // 尝试静默启用蓝牙 + bool enableSuccess = bluetoothAdapter.Call("enable"); + + if (enableSuccess) + { + Log("正在启用蓝牙,等待..."); + // 等待蓝牙启用 + StartCoroutine(WaitForBluetoothEnabled(onBluetoothReady)); + } + else + { + // 静默启用失败,请求用户启用 + RequestUserEnableBluetooth(onBluetoothReady); + } + } + else + { + Log("蓝牙已开启"); + onBluetoothReady?.Invoke(); + } + } +#elif UNITY_IOS && !UNITY_EDITOR + // iOS 检查蓝牙状态 + CheckBluetoothStateIOS(onBluetoothReady); +#else + // 其他平台直接执行初始化 + onBluetoothReady?.Invoke(); +#endif + } + +#if UNITY_IOS && !UNITY_EDITOR + [System.Runtime.InteropServices.DllImport("__Internal")] + private static extern int GetBluetoothStateIOS(); + + [System.Runtime.InteropServices.DllImport("__Internal")] + private static extern void OpenBluetoothSettingsIOS(); + + /// + /// iOS 检查蓝牙状态 + /// 0 = Unknown, 1 = Resetting, 2 = Unsupported, 3 = Unauthorized, 4 = PoweredOff, 5 = PoweredOn + /// + private void CheckBluetoothStateIOS(System.Action onBluetoothReady) + { + int state = GetBluetoothStateIOS(); + Log($"iOS 蓝牙状态: {state}"); + + // 5 = PoweredOn (蓝牙已开启) + if (state == 5) + { + Log("iOS 蓝牙已开启"); + onBluetoothReady?.Invoke(); + } + // 4 = PoweredOff (蓝牙关闭) + else if (state == 4) + { + Log("iOS 蓝牙未开启,提示用户"); + // iOS 不能自动打开蓝牙,只能提示用户去设置中开启 + ShowIOSTurnOnBluetoothPrompt(); + OnError?.Invoke("请在系统设置中开启蓝牙"); + OnInitialized?.Invoke(false); + } + // 3 = Unauthorized (未授权) + else if (state == 3) + { + LogError("iOS 蓝牙未授权"); + OnError?.Invoke("请在设置中允许使用蓝牙"); + OnInitialized?.Invoke(false); + } + // 2 = Unsupported (不支持蓝牙) + else if (state == 2) + { + LogError("设备不支持蓝牙"); + OnError?.Invoke("设备不支持蓝牙"); + OnInitialized?.Invoke(false); + } + // 其他状态 + else + { + Log($"iOS 蓝牙状态未知: {state},尝试继续初始化"); + onBluetoothReady?.Invoke(); + } + } + + /// + /// 显示 iOS 开启蓝牙提示 + /// + private void ShowIOSTurnOnBluetoothPrompt() + { + // 可以在这里显示一个弹窗,引导用户去设置 + // 或者使用原生插件跳转到设置页面 + OpenBluetoothSettingsIOS(); + } +#endif + +#if UNITY_ANDROID && !UNITY_EDITOR + /// + /// 等待蓝牙启用 + /// + private System.Collections.IEnumerator WaitForBluetoothEnabled(System.Action onBluetoothReady) + { + float timeout = 5f; + float timer = 0f; + + while (timer < timeout) + { + using (AndroidJavaClass bluetoothAdapterClass = new AndroidJavaClass("android.bluetooth.BluetoothAdapter")) + { + AndroidJavaObject bluetoothAdapter = bluetoothAdapterClass.CallStatic("getDefaultAdapter"); + if (bluetoothAdapter != null && bluetoothAdapter.Call("isEnabled")) + { + Log("蓝牙已成功启用"); + onBluetoothReady?.Invoke(); + yield break; + } + } + + yield return new WaitForSeconds(0.5f); + timer += 0.5f; + } + + Log("等待蓝牙启用超时"); + OnError?.Invoke("蓝牙启用超时"); + OnInitialized?.Invoke(false); + } + + /// + /// 请求用户启用蓝牙 + /// + private void RequestUserEnableBluetooth(System.Action onBluetoothReady) + { + Log("请求用户启用蓝牙..."); + + using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + using (AndroidJavaObject currentActivity = unityPlayer.GetStatic("currentActivity")) + { + AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent", "android.bluetooth.adapter.action.REQUEST_ENABLE"); + currentActivity.Call("startActivityForResult", intent, 1); + } + + // 等待用户响应 + StartCoroutine(WaitForUserEnableBluetooth(onBluetoothReady)); + } + + /// + /// 等待用户启用蓝牙 + /// + private System.Collections.IEnumerator WaitForUserEnableBluetooth(System.Action onBluetoothReady) + { + float timeout = 30f; + float timer = 0f; + + while (timer < timeout) + { + using (AndroidJavaClass bluetoothAdapterClass = new AndroidJavaClass("android.bluetooth.BluetoothAdapter")) + { + AndroidJavaObject bluetoothAdapter = bluetoothAdapterClass.CallStatic("getDefaultAdapter"); + if (bluetoothAdapter != null && bluetoothAdapter.Call("isEnabled")) + { + Log("用户已启用蓝牙"); + onBluetoothReady?.Invoke(); + yield break; + } + } + + yield return new WaitForSeconds(0.5f); + timer += 0.5f; + } + + Log("用户未启用蓝牙或超时"); + OnError?.Invoke("请启用蓝牙后重试"); + OnInitialized?.Invoke(false); + } +#endif + + /// + /// 执行蓝牙初始化 + /// + // 标记是否已完成初始化 + private bool _isFullyInitialized = false; + + private void DoInitialize() + { + _isFullyInitialized = false; + BluetoothLEHardwareInterface.Initialize(true, false, () => { IsInitialized = true; + _isFullyInitialized = true; Log("蓝牙初始化成功"); OnInitialized?.Invoke(true); - - // 初始化成功后,延迟尝试自动连接上一次设备 - // 延迟是为了让用户有机会先进行手动扫描 - if (AutoConnect) - { - Log("将在3秒后尝试自动连接上一次设备..."); - Invoke(nameof(TryAutoConnectDelayed), 3f); - } }, (error) => { @@ -138,14 +345,14 @@ namespace Kill.Bluetooth Log($"蓝牙初始化警告: {error}"); Log("继续初始化..."); IsInitialized = true; + _isFullyInitialized = true; OnInitialized?.Invoke(true); - - // 初始化成功后,延迟尝试自动连接上一次设备 - if (AutoConnect) - { - Log("将在3秒后尝试自动连接上一次设备..."); - Invoke(nameof(TryAutoConnectDelayed), 3f); - } + } + // 如果已经初始化完成,这是运行时错误,不是初始化错误 + else if (_isFullyInitialized) + { + Log($"蓝牙运行时错误: {error}"); + OnError?.Invoke(error); } else { @@ -153,44 +360,45 @@ namespace Kill.Bluetooth OnError?.Invoke($"初始化失败: {error}"); OnInitialized?.Invoke(false); } - } + }, + needLocation: true ); } - /// - /// 延迟尝试自动连接(用于初始化后) - /// - private void TryAutoConnectDelayed() - { - // 如果用户已经开始扫描或连接,跳过自动连接 - if (IsScanning || IsConnected || _isConnecting) - { - Log("用户正在进行扫描或连接,跳过自动连接"); - return; - } + // /// + // /// 延迟尝试自动连接(用于初始化后) + // /// + // private void TryAutoConnectDelayed() + // { + // // 如果用户已经开始扫描或连接,跳过自动连接 + // if (IsScanning || IsConnected || _isConnecting) + // { + // Log("用户正在进行扫描或连接,跳过自动连接"); + // return; + // } - TryAutoConnect(); - } + // TryAutoConnect(); + // } - /// - /// 尝试自动连接上一次连接的设备 - /// - private void TryAutoConnect() - { - string lastAddress = PlayerPrefs.GetString(LAST_DEVICE_ADDRESS_KEY, ""); - string lastName = PlayerPrefs.GetString(LAST_DEVICE_NAME_KEY, ""); + // /// + // /// 尝试自动连接上一次连接的设备 + // /// + // private void TryAutoConnect() + // { + // string lastAddress = PlayerPrefs.GetString(LAST_DEVICE_ADDRESS_KEY, ""); + // string lastName = PlayerPrefs.GetString(LAST_DEVICE_NAME_KEY, ""); - if (string.IsNullOrEmpty(lastAddress)) - { - Log("没有上一次连接的设备记录"); - return; - } + // if (string.IsNullOrEmpty(lastAddress)) + // { + // Log("没有上一次连接的设备记录"); + // return; + // } - Log($"尝试自动连接上一次设备: {lastName} [{lastAddress}]"); + // Log($"尝试自动连接上一次设备: {lastName} [{lastAddress}]"); - // 先扫描设备,找到后再连接 - StartScanForAutoConnect(lastAddress); - } + // // 先扫描设备,找到后再连接 + // StartScanForAutoConnect(lastAddress); + // } /// /// 为自动连接扫描设备 @@ -263,29 +471,9 @@ namespace Kill.Bluetooth } } - /// - /// 保存连接的设备信息 - /// - private void SaveLastConnectedDevice(string address, string name) - { - // 统一使用大写格式保存,确保地址格式一致 - string normalizedAddress = address.ToUpper(); - PlayerPrefs.SetString(LAST_DEVICE_ADDRESS_KEY, normalizedAddress); - PlayerPrefs.SetString(LAST_DEVICE_NAME_KEY, name); - PlayerPrefs.Save(); - Log($"保存设备连接记录: {name} [{normalizedAddress}]"); - } + - /// - /// 清除设备连接记录 - /// - public void ClearLastConnectedDevice() - { - PlayerPrefs.DeleteKey(LAST_DEVICE_ADDRESS_KEY); - PlayerPrefs.DeleteKey(LAST_DEVICE_NAME_KEY); - PlayerPrefs.Save(); - Log("清除设备连接记录"); - } + /// /// 开始扫描蓝牙设备 @@ -299,9 +487,6 @@ namespace Kill.Bluetooth return; } - // 取消自动连接,避免干扰手动扫描 - CancelInvoke(nameof(TryAutoConnectDelayed)); - if (IsScanning) { Log("已经在扫描中,先停止当前扫描..."); @@ -380,7 +565,6 @@ namespace Kill.Bluetooth // 取消所有扫描相关的Invoke CancelInvoke(nameof(StopScan)); CancelInvoke(nameof(DelayedStartScan)); - CancelInvoke(nameof(TryAutoConnectDelayed)); BluetoothLEHardwareInterface.StopScan(); Log("停止扫描蓝牙设备"); @@ -449,7 +633,7 @@ namespace Kill.Bluetooth // 保存连接的设备信息 var device = DiscoveredDevices.Find(d => d.Address.ToUpper() == address.ToUpper()); string deviceName = device != null ? device.Name : "Unknown"; - SaveLastConnectedDevice(address, deviceName); + //SaveLastConnectedDevice(address, deviceName); OnConnected?.Invoke(address); @@ -592,7 +776,6 @@ namespace Kill.Bluetooth // 取消可能冲突的Invoke CancelInvoke(nameof(StopScan)); CancelInvoke(nameof(DelayedStartScan)); - CancelInvoke(nameof(TryAutoConnectDelayed)); // 清理设备列表,为下次扫描做准备 DiscoveredDevices.Clear(); @@ -608,10 +791,6 @@ namespace Kill.Bluetooth { Log("开始完全重置蓝牙..."); - // 保存上一次连接的设备信息 - string lastAddress = PlayerPrefs.GetString(LAST_DEVICE_ADDRESS_KEY, ""); - string lastName = PlayerPrefs.GetString(LAST_DEVICE_NAME_KEY, ""); - // 停止扫描 if (IsScanning) { @@ -748,6 +927,10 @@ namespace Kill.Bluetooth var newDevice = new BluetoothDevice(address, name, rssi); DiscoveredDevices.Add(newDevice); Log($"发现新设备: {name} [{address}] RSSI: {rssi}"); + if (aimMac.ToUpper() == address.ToUpper()) + { + Connect(address); + } OnDeviceFound?.Invoke(newDevice); } } @@ -769,5 +952,19 @@ namespace Kill.Bluetooth Log("蓝牙连接已就绪,可以开始通信"); OnConnectedSuccess?.Invoke(); } + + public void ChangeAimMac(string mac) + { + aimMac = mac; + if (IsConnected&& mac.ToUpper() != ConnectedDeviceAddress.ToUpper()) + { + Disconnect(); + StartScan(); + } + else + { + StartScan(); + } + } } } diff --git a/Assets/Scripts/Managers/DataBase.cs b/Assets/Scripts/Managers/DataBase.cs index a695b15..730b443 100644 --- a/Assets/Scripts/Managers/DataBase.cs +++ b/Assets/Scripts/Managers/DataBase.cs @@ -214,5 +214,11 @@ namespace Kill.Managers public int totalAnsweredCount; // 总答题序号(累加) } #endregion + [Serializable] + public class BandDeviceRequest + { + public string device_sn; + public string user_id; + } } diff --git a/Assets/Scripts/Managers/DataManager.cs b/Assets/Scripts/Managers/DataManager.cs index a474d3e..2104c9f 100644 --- a/Assets/Scripts/Managers/DataManager.cs +++ b/Assets/Scripts/Managers/DataManager.cs @@ -48,7 +48,7 @@ namespace Kill.Managers PlayerPrefs.DeleteKey("token"); PlayerPrefs.DeleteKey("userData"); } - public async Task TokenLogin() + public async Task TokenLogin() { LoadingUI.Show(); @@ -57,18 +57,23 @@ namespace Kill.Managers // 获取用户详情 var response = await NetworkCtrl.Instance.Post("/api/v1/auth/token-login"); LoadingUI.Hide(); - ResponseCodeHandler.HandleResponse(response, - onSuccess: (data) => - { - SetToken(data.data.token,data.data.user); - } - ); + if(response.Data.code==200) + { + SetToken(response.Data.data.token,response.Data.data.user); + return true; + } + else + { + ClearInfo(); + return false; + } } catch (Exception ex) { LoadingUI.Hide(); Debug.LogError($"TokenLogin 异常: {ex.Message}"); + return false; } } } diff --git a/Assets/Scripts/Network/NetworkCtrl.cs b/Assets/Scripts/Network/NetworkCtrl.cs index 2a27407..4ba0a3c 100644 --- a/Assets/Scripts/Network/NetworkCtrl.cs +++ b/Assets/Scripts/Network/NetworkCtrl.cs @@ -67,6 +67,12 @@ namespace Kill.Network Instance = this; localPath = Application.persistentDataPath; streamingPath = Application.streamingAssetsPath; + // 设置目标帧率为 60 FPS + Application.targetFrameRate = 60; + + // 禁用垂直同步,允许更高帧率 + QualitySettings.vSyncCount = 0; + } async void Start() @@ -521,7 +527,7 @@ namespace Kill.Network } else { - ToastUI.ShowText("资源更新失败"); + ToastUI.ShowText("resource error"); Debug.LogError("资源更新失败"); } } diff --git a/Assets/Scripts/UI/Pages/BluetoothDemoUI.cs b/Assets/Scripts/UI/Pages/BluetoothDemoUI.cs index e0ae03e..dabdbef 100644 --- a/Assets/Scripts/UI/Pages/BluetoothDemoUI.cs +++ b/Assets/Scripts/UI/Pages/BluetoothDemoUI.cs @@ -686,7 +686,7 @@ namespace Kill.UI.Pages UpdateStatus("正在查询设备注册状态..."); Log("发送查询注册状态命令 (0x01)"); - BLECommunicationManager.Instance.QueryRegistrationStatus((status) => + BLECommunicationManager.Instance.QueryRegistrationStatus((success,status) => { Loom.QueueOnMainThread(() => { diff --git a/Assets/Scripts/UI/Pages/ConnectDevice.meta b/Assets/Scripts/UI/Pages/ConnectDevice.meta new file mode 100644 index 0000000..fc1ba1f --- /dev/null +++ b/Assets/Scripts/UI/Pages/ConnectDevice.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: acd23947c4ead6440a0d7f44deb2fc42 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs b/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs new file mode 100644 index 0000000..2eb5c99 --- /dev/null +++ b/Assets/Scripts/UI/Pages/ConnectDevice/ConnectDevicePageCtrl.cs @@ -0,0 +1,494 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using Kill.Bluetooth; +using Kill.Core; +using Kill.Managers; +using Kill.Network; +using Kill.UI; +using Kill.UI.Components; +using Kill.UI.Pages; +using UnityEngine; +using UnityEngine.UI; + +public class ConnectDevicePageCtrl : MonoBehaviour +{ + /// + /// 0连接 1 失败 2 成功 3 选择wifi + /// + public GameObject[] sonPages; + public GameObject topBar; + public string blueToothNameKeyWord; + private List deviceList = new List(); + public Button backButton; + public Button skipButton; + public GameObject titleText; + public GameObject scanningIcon; + void Start() + { + BluetoothManager.Instance.OnDeviceFound += OnDeviceFound; + BluetoothManager.Instance.OnConnectedSuccess += OnDeviceConnected; + BluetoothManager.Instance.OnConnectFailed += OnConnectFailed; + BluetoothManager.Instance.OnDisconnected += OnDeviceDisconnected; + EnterConnectPage(); + } + void OnDestroy() + { + BluetoothManager.Instance.OnDeviceFound -= OnDeviceFound; + BluetoothManager.Instance.OnConnectedSuccess -= OnDeviceConnected; + BluetoothManager.Instance.OnConnectFailed -= OnConnectFailed; + BluetoothManager.Instance.OnDisconnected -= OnDeviceDisconnected; + } + public void EnterConnectPage() + { + OnStopScanClick(); + if(BluetoothManager.Instance.IsConnected) + BluetoothManager.Instance.Disconnect(); + topBar.SetActive(true); + titleText.SetActive(false); + backButton.onClick.RemoveAllListeners(); + backButton.onClick.AddListener(BackToHomePage); + backButton.gameObject.SetActive(true); + skipButton.gameObject.SetActive(false); + foreach(GameObject g in sonPages) + g.gameObject.SetActive(false); + sonPages[0].SetActive(true); + UIManager.Instance.RegisterBackAction(BackToHomePage); + OnScanClick(); + } + public GameObject qrCodePlane; + public void ScanQrCode() + { + qrCodePlane.SetActive(true); + qrCodePlane.GetComponent().OnQRCodeScanned+=GetQrResult; + } + public void GetQrResult(string result) + { + BluetoothManager.Instance.Connect(result); + LoadingUI.Show(); + qrCodePlane.SetActive(false); + nowDeviceMac=result; + } + + string errorTip=""; + private void ShowErrorPage() + { + if(BluetoothManager.Instance.IsConnected) + BluetoothManager.Instance.Disconnect(); + topBar.SetActive(false); + foreach(GameObject g in sonPages) + g.gameObject.SetActive(false); + sonPages[1].SetActive(true); + Text errorText=sonPages[1].transform.Find("提示").GetComponent(); + if(errorTip!="") + { + errorText.text=LanguageManager.Instance.GetLanguage(errorTip); + } + else + { + errorText.text=LanguageManager.Instance.GetLanguage("100069"); + } + UIManager.Instance.RegisterBackAction(EnterConnectPage); + LoadingUI.Hide(); + } + public InputField wifiNameInput; + public InputField wifiPasswordInput; + + public void ShowWifiPage() + { + topBar.SetActive(true); + titleText.SetActive(true); + backButton.gameObject.SetActive(false); + UIManager.Instance.ClearBackAction(); + skipButton.gameObject.SetActive(true); + foreach(GameObject g in sonPages) + g.gameObject.SetActive(false); + sonPages[3].SetActive(true); + + // 获取当前 WiFi 名称 + string wifiName = GetCurrentWiFiName(); + wifiNameInput.text = wifiName ?? ""; + wifiPasswordInput.text=""; + + + } + + /// + /// 确认配置 WiFi + /// + public void OnWifiConfirmClick() + { + string ssid = wifiNameInput.text.Trim(); + string password = wifiPasswordInput.text; + + if (string.IsNullOrEmpty(ssid)) + { + ToastUI.ShowText(LanguageManager.Instance.GetLanguage("100071") ?? "请输入WiFi名称"); + return; + } + + // 创建 WiFi 配置 + var wifiControl = new Kill.Bluetooth.Protocol.WIFIControl + { + Enable = true, + SSID = ssid, + Password = password + }; + + LoadingUI.Show(); + + // 发送 WiFi 配置到设备 + BLECommunicationManager.Instance.WriteWIFIControl(wifiControl, (success) => + { + Loom.QueueOnMainThread(() => + { + LoadingUI.Hide(); + if (success) + { + UnityEngine.Debug.Log("WiFi 配置成功"); + ShowSuccessPage(); + } + else + { + ToastUI.ShowText(LanguageManager.Instance.GetLanguage("100072") ?? "WiFi配置失败"); + } + }); + }); + } + /// + /// 0不可点击 1可点击 + /// + public GameObject[] wifiConfirmButtons; + public void CheckWifiNameAndPassword() + { + string ssid = wifiNameInput.text.Trim(); + string password = wifiPasswordInput.text; + if(string.IsNullOrEmpty(ssid) || string.IsNullOrEmpty(password)) + { + wifiConfirmButtons[0].SetActive(true); + wifiConfirmButtons[1].SetActive(false); + } + else + { + wifiConfirmButtons[0].SetActive(false); + wifiConfirmButtons[1].SetActive(true); + } + } + + /// + /// 获取当前连接的 WiFi 名称 + /// + private string GetCurrentWiFiName() + { +#if UNITY_ANDROID && !UNITY_EDITOR + try + { + using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + using (AndroidJavaObject currentActivity = unityPlayer.GetStatic("currentActivity")) + using (AndroidJavaObject wifiManager = currentActivity.Call("getSystemService", "wifi")) + { + if (wifiManager == null) return null; + + using (AndroidJavaObject wifiInfo = wifiManager.Call("getConnectionInfo")) + { + if (wifiInfo == null) return null; + + string ssid = wifiInfo.Call("getSSID"); + if (!string.IsNullOrEmpty(ssid) && ssid != "") + { + return ssid.Trim('"'); + } + } + } + } + catch (System.Exception ex) + { + Debug.LogError($"获取 WiFi 名称失败: {ex.Message}"); + } + return null; +#elif UNITY_IOS && !UNITY_EDITOR + // iOS 调用原生插件 + return GetWiFiNameIOS(); +#else + return "Editor_WiFi"; // 编辑器返回模拟值 +#endif + } + +#if UNITY_IOS && !UNITY_EDITOR + [System.Runtime.InteropServices.DllImport("__Internal")] + private static extern System.IntPtr GetWiFiSSID(); + + /// + /// iOS 获取 WiFi 名称 + /// + private string GetWiFiNameIOS() + { + try + { + System.IntPtr ptr = GetWiFiSSID(); + if (ptr == System.IntPtr.Zero) + { + return null; + } + string ssid = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ptr); + // 释放内存 + System.Runtime.InteropServices.Marshal.FreeHGlobal(ptr); + return ssid; + } + catch (System.Exception ex) + { + Debug.LogError($"iOS 获取 WiFi 名称失败: {ex.Message}"); + return null; + } + } +#endif + public void ShowSuccessPage() + { + topBar.SetActive(false); + foreach(GameObject g in sonPages) + g.gameObject.SetActive(false); + sonPages[2].SetActive(true); + UIManager.Instance.RegisterBackAction(EnterConnectPage); + } + private void OnDeviceFound(BluetoothDevice device) + { + if(string.IsNullOrEmpty(device.Name)) + return; + AddOneDevice(device); + + } + private void OnDeviceConnected() + { + if (selectedIndex >= 0 && selectedIndex < deviceObjects.Count) + { + deviceObjects[selectedIndex].transform.Find("状态").Find("loading").gameObject.SetActive(false); + deviceObjects[selectedIndex].transform.Find("状态").Find("成功").gameObject.SetActive(true); + } + // 延迟 500ms 再查询,确保 BLE 连接完全就绪 + StartCoroutine(DelayedQueryRegistration()); + isconnecting =false; + } + + /// + /// 延迟查询注册状态 + /// + private System.Collections.IEnumerator DelayedQueryRegistration() + { + yield return new WaitForSeconds(0.5f); + OnQueryRegistrationClick(); + } + + private void OnConnectFailed(string address) + { + if(!isconnecting) + return; + errorTip="100069"; + ShowErrorPage(); + isconnecting=false; + } + + private void OnDeviceDisconnected(string address) + { + // UpdateStatus($"已断开连接: {address}"); + // if (deviceStatusText != null) + // deviceStatusText.text = "未连接"; + } + public List deviceObjects; + /// + /// 开始扫描 + /// + public void OnScanClick() + { + scanningIcon.SetActive(true); + devicePrefab.SetActive(false); + if (BluetoothManager.Instance != null) + { + // 清空列表 + deviceList.Clear(); + if (deviceObjects != null && deviceObjects.Count > 0) + { + foreach (var item in deviceObjects) + { + Destroy(item); + } + deviceObjects.Clear(); + } + deviceObjects = new List(); + BluetoothManager.Instance.StartScan(999f); // 扫描999秒 + } + } + public GameObject deviceListParent; + public GameObject devicePrefab; + public GameObject deviceListUi; + bool isconnecting=false; + public void AddOneDevice(BluetoothDevice device) + { + if (deviceList.Contains(device)) + return; + if(!device.Name.Contains(blueToothNameKeyWord)) + return; + if(!deviceListUi.activeSelf) + deviceListUi.SetActive(true); + deviceList.Add(device); + GameObject deviceObject = Instantiate(devicePrefab, deviceListParent.transform); + deviceObject.transform.Find("name").GetComponent().text=device.Name; + deviceObject.SetActive(true); + deviceObjects.Add(deviceObject); + int index = deviceObjects.Count-1; + deviceObject.GetComponent