barkoder-nativescript 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/barkoder-nativescript.android.ts +58 -4
- package/barkoder-nativescript.common.ts +6 -2
- package/barkoder-nativescript.ios.ts +64 -3
- package/package.json +1 -1
- package/platforms/android/barkoder.aar +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Headers/iBarkoder.h +12 -2
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/Info.plist +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/default.metallib +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/metadata.json +3 -3
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_512x384.mlmodelc/model.mil +1 -1
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/{ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc → ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc}/metadata.json +38 -38
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/model/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.net +5929 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.shape +1915 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.weights +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/int8_384x256_small2.mlmodelc/neural_network_optionals/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Barkoder +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Headers/iBarkoder.h +12 -2
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/Info.plist +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/_CodeSignature/CodeResources +78 -45
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/default.metallib +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/metadata.json +3 -3
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_512x384.mlmodelc/model.mil +1 -1
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/{ios-arm64/Barkoder.framework/float16_384x256.mlmodelc → ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc}/metadata.json +38 -38
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/model/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.net +5929 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.shape +1915 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/model.espresso.weights +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/int8_384x256_small2.mlmodelc/neural_network_optionals/coremldata.bin +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +13 -13
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.abi.json +338 -76
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64/BarkoderSDK.framework/templates.json +13 -7
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/BarkoderSDK +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Headers/BarkoderSDK-Swift.h +26 -26
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Info.plist +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +338 -76
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +338 -76
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/Modules/BarkoderSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -4
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/_CodeSignature/CodeResources +25 -25
- package/platforms/ios/BarkoderSDK.xcframework/ios-arm64_x86_64-simulator/BarkoderSDK.framework/templates.json +13 -7
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64/Barkoder.framework/float16_384x256.mlmodelc/weights/weight.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/analytics/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/coremldata.bin +0 -0
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/model.mil +0 -753
- package/platforms/ios/Barkoder.xcframework/ios-arm64_x86_64-simulator/Barkoder.framework/float16_384x256.mlmodelc/weights/weight.bin +0 -0
|
@@ -35,6 +35,9 @@ export class BarkoderViewAndroid extends View {
|
|
|
35
35
|
this.nativeView = this.bkdView;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
38
41
|
/**
|
|
39
42
|
* Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed
|
|
40
43
|
*/
|
|
@@ -44,16 +47,32 @@ export class BarkoderViewAndroid extends View {
|
|
|
44
47
|
const resultCallback = new com.barkoder.interfaces.BarkoderResultCallback({
|
|
45
48
|
scanningFinished: (
|
|
46
49
|
results: any[],
|
|
47
|
-
thumbnails: any
|
|
50
|
+
thumbnails: any, // not a true JS array!
|
|
48
51
|
resultImage: any
|
|
49
52
|
) => {
|
|
53
|
+
// Convert native array to JS array first
|
|
54
|
+
const jsThumbnails = [];
|
|
55
|
+
for (let i = 0; i < thumbnails.length; i++) {
|
|
56
|
+
jsThumbnails.push(thumbnails[i]);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const convertedThumbnails = jsThumbnails.map((bitmap) => {
|
|
60
|
+
const imgSrc = new ImageSource();
|
|
61
|
+
imgSrc.setNativeSource(bitmap);
|
|
62
|
+
return imgSrc;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const convertedResultImage = new ImageSource();
|
|
66
|
+
convertedResultImage.setNativeSource(resultImage);
|
|
67
|
+
|
|
50
68
|
BarkoderResultCallback.scanningFinished(
|
|
51
69
|
results,
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
convertedThumbnails,
|
|
71
|
+
convertedResultImage
|
|
54
72
|
);
|
|
55
73
|
},
|
|
56
74
|
});
|
|
75
|
+
|
|
57
76
|
this.bkdView.startScanning(resultCallback);
|
|
58
77
|
}
|
|
59
78
|
|
|
@@ -478,7 +497,11 @@ export class BarkoderViewAndroid extends View {
|
|
|
478
497
|
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Normal) {
|
|
479
498
|
this.bkdView.config.getDecoderConfig().decodingSpeed =
|
|
480
499
|
com.barkoder.Barkoder.DecodingSpeed.Normal;
|
|
481
|
-
} else {
|
|
500
|
+
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Rigorous) {
|
|
501
|
+
this.bkdView.config.getDecoderConfig().decodingSpeed =
|
|
502
|
+
com.barkoder.Barkoder.DecodingSpeed.Rigorous;
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
482
505
|
console.log("Not avilbilable Decoding Speed");
|
|
483
506
|
}
|
|
484
507
|
}
|
|
@@ -662,6 +685,8 @@ export class BarkoderViewAndroid extends View {
|
|
|
662
685
|
return this.bkdView.config.getDecoderConfig().KIX.enabled;
|
|
663
686
|
case BarkoderConstants.DecoderType.JapanesePost:
|
|
664
687
|
return this.bkdView.config.getDecoderConfig().JapanesePost.enabled;
|
|
688
|
+
case BarkoderConstants.DecoderType.MaxiCode:
|
|
689
|
+
return this.bkdView.config.getDecoderConfig().MaxiCode.enabled;
|
|
665
690
|
}
|
|
666
691
|
}
|
|
667
692
|
|
|
@@ -707,6 +732,7 @@ export class BarkoderViewAndroid extends View {
|
|
|
707
732
|
this.bkdView.config.getDecoderConfig().RoyalMail.enabled = false;
|
|
708
733
|
this.bkdView.config.getDecoderConfig().KIX.enabled = false;
|
|
709
734
|
this.bkdView.config.getDecoderConfig().JapanesePost.enabled = false;
|
|
735
|
+
this.bkdView.config.getDecoderConfig().MaxiCode.enabled = false;
|
|
710
736
|
decoders.forEach((dt: BarkoderConstants.DecoderType) => {
|
|
711
737
|
switch (dt) {
|
|
712
738
|
case BarkoderConstants.DecoderType.Aztec:
|
|
@@ -823,6 +849,9 @@ export class BarkoderViewAndroid extends View {
|
|
|
823
849
|
case BarkoderConstants.DecoderType.JapanesePost:
|
|
824
850
|
this.bkdView.config.getDecoderConfig().JapanesePost.enabled = true;
|
|
825
851
|
break;
|
|
852
|
+
case BarkoderConstants.DecoderType.MaxiCode:
|
|
853
|
+
this.bkdView.config.getDecoderConfig().MaxiCode.enabled = true;
|
|
854
|
+
break;
|
|
826
855
|
default:
|
|
827
856
|
break;
|
|
828
857
|
}
|
|
@@ -1107,6 +1136,26 @@ export class BarkoderViewAndroid extends View {
|
|
|
1107
1136
|
return this.bkdView.config.getDecoderConfig().duplicatesDelayMs;
|
|
1108
1137
|
}
|
|
1109
1138
|
|
|
1139
|
+
setARImageResultEnabled(enabled: boolean): void {
|
|
1140
|
+
this.bkdView.config.arConfig.imageResultEnabled = enabled
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
setARBarcodeThumbnailOnResultEnabled(enabled: boolean): void {
|
|
1144
|
+
this.bkdView.config.arConfig.barcodeThumbnailOnResult = enabled
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
isARImageResultEnabled(): any {
|
|
1148
|
+
return this.bkdView.config.arConfig.imageResultEnabled
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
isARBarcodeThumbnailOnResultEnabled(): any {
|
|
1152
|
+
return this.bkdView.config.arConfig.barcodeThumbnailOnResult
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
getCurrentZoomFactor(): any {
|
|
1156
|
+
return this.bkdView.getCurrentZoomFactor()
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1110
1159
|
/**
|
|
1111
1160
|
* Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
|
|
1112
1161
|
*/
|
|
@@ -1522,3 +1571,8 @@ export class BarkoderViewAndroid extends View {
|
|
|
1522
1571
|
}
|
|
1523
1572
|
}
|
|
1524
1573
|
}
|
|
1574
|
+
function bitmapToImageSource(bitmap: android.graphics.Bitmap): ImageSource {
|
|
1575
|
+
const imageSource = new ImageSource();
|
|
1576
|
+
imageSource.setNativeSource(bitmap); // This is the key method
|
|
1577
|
+
return imageSource;
|
|
1578
|
+
}
|
|
@@ -59,7 +59,8 @@ export enum DecoderType {
|
|
|
59
59
|
AustralianPost = 35,
|
|
60
60
|
RoyalMail = 36,
|
|
61
61
|
KIX = 37,
|
|
62
|
-
JapanesePost = 38
|
|
62
|
+
JapanesePost = 38,
|
|
63
|
+
MaxiCode = 39
|
|
63
64
|
|
|
64
65
|
}
|
|
65
66
|
|
|
@@ -73,7 +74,8 @@ export enum FormattingType {
|
|
|
73
74
|
export enum DecodingSpeed {
|
|
74
75
|
Fast = 0,
|
|
75
76
|
Normal = 1,
|
|
76
|
-
Slow = 2
|
|
77
|
+
Slow = 2,
|
|
78
|
+
Rigorous = 3
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
export enum BarkoderResolution {
|
|
@@ -235,6 +237,7 @@ export class DekoderConfig {
|
|
|
235
237
|
royalMail?: BarcodeConfig;
|
|
236
238
|
kix?: BarcodeConfig;
|
|
237
239
|
japanasePost?: BarcodeConfig;
|
|
240
|
+
maxicode?: BarcodeConfig;
|
|
238
241
|
general?: GeneralSettings;
|
|
239
242
|
|
|
240
243
|
constructor(config: Partial<DekoderConfig>) {
|
|
@@ -282,6 +285,7 @@ export class DekoderConfig {
|
|
|
282
285
|
'Royal Mail': this.royalMail?.toMap(),
|
|
283
286
|
'KIX': this.kix?.toMap(),
|
|
284
287
|
'Japanase Post': this.japanasePost?.toMap(),
|
|
288
|
+
'MaxiCode': this.maxicode?.toMap(),
|
|
285
289
|
'general': this.general?.toMap()
|
|
286
290
|
}
|
|
287
291
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BarkoderConstants } from "./barkoder-nativescript.common";
|
|
2
2
|
import { View } from "@nativescript/core";
|
|
3
3
|
import { ios } from "@nativescript/core/application";
|
|
4
|
+
import { ImageSource } from '@nativescript/core';
|
|
4
5
|
|
|
5
6
|
export class BarkoderViewIOS extends View {
|
|
6
7
|
public bkdView: any;
|
|
@@ -442,6 +443,8 @@ export class BarkoderViewIOS extends View {
|
|
|
442
443
|
this.bkdView.config.decoderConfig.decodingSpeed = 1;
|
|
443
444
|
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Slow) {
|
|
444
445
|
this.bkdView.config.decoderConfig.decodingSpeed = 2;
|
|
446
|
+
} else if (decodingSpeed == BarkoderConstants.DecodingSpeed.Rigorous) {
|
|
447
|
+
this.bkdView.config.decoderConfig.decodingSpeed = 3;
|
|
445
448
|
}
|
|
446
449
|
}
|
|
447
450
|
|
|
@@ -608,6 +611,8 @@ export class BarkoderViewIOS extends View {
|
|
|
608
611
|
return this.bkdView.config.decoderConfig.kix.enabled;
|
|
609
612
|
case BarkoderConstants.DecoderType.JapanesePost:
|
|
610
613
|
return this.bkdView.config.decoderConfig.japanasePost.enabled;
|
|
614
|
+
case BarkoderConstants.DecoderType.MaxiCode:
|
|
615
|
+
return this.bkdView.config.decoderConfig.maxiCode.enabled;
|
|
611
616
|
}
|
|
612
617
|
}
|
|
613
618
|
|
|
@@ -654,6 +659,7 @@ export class BarkoderViewIOS extends View {
|
|
|
654
659
|
this.bkdView.config.decoderConfig.royalMail.enabled = false;
|
|
655
660
|
this.bkdView.config.decoderConfig.kix.enabled = false;
|
|
656
661
|
this.bkdView.config.decoderConfig.japanesePost.enabled = false;
|
|
662
|
+
this.bkdView.config.decoderConfig.maxiCode.enabled = false;
|
|
657
663
|
decoders.forEach((dt: BarkoderConstants.DecoderType) => {
|
|
658
664
|
switch (dt) {
|
|
659
665
|
case BarkoderConstants.DecoderType.Aztec:
|
|
@@ -770,6 +776,9 @@ export class BarkoderViewIOS extends View {
|
|
|
770
776
|
case BarkoderConstants.DecoderType.JapanesePost:
|
|
771
777
|
this.bkdView.config.decoderConfig.japanesePost.enabled = true;
|
|
772
778
|
break;
|
|
779
|
+
case BarkoderConstants.DecoderType.MaxiCode:
|
|
780
|
+
this.bkdView.config.decoderConfig.maxiCode.enabled = true;
|
|
781
|
+
break;
|
|
773
782
|
default:
|
|
774
783
|
break;
|
|
775
784
|
}
|
|
@@ -1141,6 +1150,26 @@ export class BarkoderViewIOS extends View {
|
|
|
1141
1150
|
return this.bkdView.config.decoderConfig.maximumResultsCount;
|
|
1142
1151
|
}
|
|
1143
1152
|
|
|
1153
|
+
setARImageResultEnabled(enabled: boolean): void {
|
|
1154
|
+
this.bkdView.config.arConfig.imageResultEnabled = enabled
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
setARBarcodeThumbnailOnResultEnabled(enabled: boolean): void {
|
|
1158
|
+
this.bkdView.config.arConfig.barcodeThumbnailOnResult = enabled
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
isARImageResultEnabled(): any {
|
|
1162
|
+
return this.bkdView.config.arConfig.imageResultEnabled
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
isARBarcodeThumbnailOnResultEnabled(): any {
|
|
1166
|
+
return this.bkdView.config.arConfig.barcodeThumbnailOnResult
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
getCurrentZoomFactor(): any {
|
|
1170
|
+
return this.bkdView.getCurrentZoomFactor()
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1144
1173
|
/**
|
|
1145
1174
|
* Sets whether the deblurring feature for UPC/EAN barcodes is enabled
|
|
1146
1175
|
*/
|
|
@@ -1544,10 +1573,42 @@ export class BarkoderViewWraper extends UIResponder
|
|
|
1544
1573
|
|
|
1545
1574
|
scanningFinishedThumbnailsImage(
|
|
1546
1575
|
decoderResults: NSArray<DecoderResult> | DecoderResult[],
|
|
1547
|
-
thumbnails: NSArray<UIImage> | UIImage[],
|
|
1548
|
-
image: UIImage
|
|
1576
|
+
thumbnails: NSArray<UIImage> | UIImage[] | null,
|
|
1577
|
+
image: UIImage | null
|
|
1549
1578
|
): void {
|
|
1550
|
-
|
|
1579
|
+
const jsThumbnails: ImageSource[] = [];
|
|
1580
|
+
|
|
1581
|
+
// Convert thumbnails
|
|
1582
|
+
if (thumbnails instanceof NSArray) {
|
|
1583
|
+
for (let i = 0; i < thumbnails.count; i++) {
|
|
1584
|
+
const uiImage = thumbnails.objectAtIndex(i);
|
|
1585
|
+
const imgSrc = new ImageSource();
|
|
1586
|
+
imgSrc.setNativeSource(uiImage);
|
|
1587
|
+
jsThumbnails.push(imgSrc);
|
|
1588
|
+
}
|
|
1589
|
+
} else if (Array.isArray(thumbnails)) {
|
|
1590
|
+
for (const uiImage of thumbnails) {
|
|
1591
|
+
const imgSrc = new ImageSource();
|
|
1592
|
+
imgSrc.setNativeSource(uiImage);
|
|
1593
|
+
jsThumbnails.push(imgSrc);
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
// Convert result image to ImageSource if not null
|
|
1598
|
+
let convertedImage: ImageSource | null = null;
|
|
1599
|
+
|
|
1600
|
+
if (image) {
|
|
1601
|
+
convertedImage = new ImageSource();
|
|
1602
|
+
convertedImage.setNativeSource(image);
|
|
1603
|
+
} else if (jsThumbnails.length > 0) {
|
|
1604
|
+
console.warn('⚠️ resultImage is null, using first thumbnail as fallback.');
|
|
1605
|
+
convertedImage = jsThumbnails[0];
|
|
1606
|
+
} else {
|
|
1607
|
+
console.warn('⚠️ resultImage and thumbnails are both missing.');
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1610
|
+
// Call JS callback with safe image fallback
|
|
1611
|
+
this.callback.scanningFinished(decoderResults, jsThumbnails, convertedImage);
|
|
1551
1612
|
}
|
|
1552
1613
|
|
|
1553
1614
|
static new(): BarkoderViewWraper {
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -73,7 +73,8 @@ typedef enum {
|
|
|
73
73
|
AustralianPost,
|
|
74
74
|
RoyalMail,
|
|
75
75
|
KIX,
|
|
76
|
-
JapanesePost
|
|
76
|
+
JapanesePost,
|
|
77
|
+
MaxiCode
|
|
77
78
|
|
|
78
79
|
} DecoderType;
|
|
79
80
|
|
|
@@ -308,6 +309,13 @@ typedef enum {
|
|
|
308
309
|
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
309
310
|
@end
|
|
310
311
|
|
|
312
|
+
//==========================================================================
|
|
313
|
+
// MaxiCode Config
|
|
314
|
+
//==========================================================================
|
|
315
|
+
@interface MaxiCodeConfig : SpecificConfig
|
|
316
|
+
- (id)initWithDecoderType:(DecoderType)decoderType;
|
|
317
|
+
@end
|
|
318
|
+
|
|
311
319
|
//==========================================================================
|
|
312
320
|
// Datamatrix Config
|
|
313
321
|
//==========================================================================
|
|
@@ -519,6 +527,7 @@ typedef enum {
|
|
|
519
527
|
@property (nonatomic, readonly, retain) RoyalMailConfig* _Nonnull royalMail;
|
|
520
528
|
@property (nonatomic, readonly, retain) JapanesePostConfig* _Nonnull japanesePost;
|
|
521
529
|
@property (nonatomic, readonly, retain) KIXConfig* _Nonnull kix;
|
|
530
|
+
@property (nonatomic, readonly, retain) MaxiCodeConfig* _Nonnull maxiCode;
|
|
522
531
|
|
|
523
532
|
@property (nonatomic, readonly, retain) IDDocumentConfig* _Nonnull idDocument;
|
|
524
533
|
|
|
@@ -592,7 +601,8 @@ typedef enum {
|
|
|
592
601
|
BT_AustralianPost,
|
|
593
602
|
BT_RoyalMail,
|
|
594
603
|
BT_KIX,
|
|
595
|
-
BT_JapanesePost
|
|
604
|
+
BT_JapanesePost,
|
|
605
|
+
BT_MaxiCode
|
|
596
606
|
|
|
597
607
|
} BarcodeType;
|
|
598
608
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
73
|
"userDefinedMetadata" : {
|
|
74
|
-
"com.github.apple.coremltools.version" : "7.2",
|
|
75
74
|
"com.github.apple.coremltools.source" : "torch==2.3.1+cu121",
|
|
75
|
+
"stride" : "32",
|
|
76
76
|
"com.github.apple.coremltools.source_dialect" : "TorchScript",
|
|
77
77
|
"docs" : "https:\/\/docs.ultralytics.com",
|
|
78
78
|
"task" : "obb",
|
|
79
|
-
"
|
|
80
|
-
"date" : "2024-08-01T17:19:19.267647",
|
|
79
|
+
"com.github.apple.coremltools.version" : "7.2",
|
|
81
80
|
"imgsz" : "[384, 512]",
|
|
81
|
+
"date" : "2024-08-01T17:19:19.267647",
|
|
82
82
|
"batch" : "1",
|
|
83
83
|
"names" : "{0: 'id_mrz_image', 1: 'mrz_2', 2: 'mrz_3', 3: 'id_mrz', 4: 'id_image', 5: 'face', 6: 'vin', 7: 'signature'}"
|
|
84
84
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
program(1.0)
|
|
2
|
-
[buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "
|
|
2
|
+
[buildInfo = dict<tensor<string, []>, tensor<string, []>>({{"coremlc-component-MIL", "3405.2.1"}, {"coremlc-version", "3404.23.1"}, {"coremltools-component-torch", "2.3.1+cu121"}, {"coremltools-source-dialect", "TorchScript"}, {"coremltools-version", "7.2"}})]
|
|
3
3
|
{
|
|
4
4
|
func main<ios15>(tensor<fp32, [1, 3, 384, 512]> image) {
|
|
5
5
|
tensor<fp32, []> image__scaled___y_0 = const()[name = tensor<string, []>("image__scaled___y_0"), val = tensor<fp32, []>(0x1.010102p-8)];
|
|
Binary file
|
|
Binary file
|
|
@@ -1,60 +1,42 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"shortDescription" : "Ultralytics
|
|
3
|
+
"shortDescription" : "Ultralytics YOLOv8-gray-tiny2 model trained on dataset_id.yaml",
|
|
4
4
|
"metadataOutputVersion" : "3.0",
|
|
5
5
|
"outputSchema" : [
|
|
6
6
|
{
|
|
7
7
|
"hasShapeFlexibility" : "0",
|
|
8
8
|
"isOptional" : "0",
|
|
9
9
|
"dataType" : "Float32",
|
|
10
|
-
"formattedType" : "MultiArray (Float32
|
|
10
|
+
"formattedType" : "MultiArray (Float32)",
|
|
11
11
|
"shortDescription" : "",
|
|
12
|
-
"shape" : "[
|
|
13
|
-
"name" : "
|
|
12
|
+
"shape" : "[]",
|
|
13
|
+
"name" : "var_985",
|
|
14
14
|
"type" : "MultiArray"
|
|
15
15
|
}
|
|
16
16
|
],
|
|
17
|
-
"version" : "8.2.
|
|
17
|
+
"version" : "8.2.93",
|
|
18
18
|
"modelParameters" : [
|
|
19
19
|
|
|
20
20
|
],
|
|
21
21
|
"author" : "Ultralytics",
|
|
22
|
-
"specificationVersion" :
|
|
23
|
-
"storagePrecision" : "
|
|
22
|
+
"specificationVersion" : 4,
|
|
23
|
+
"storagePrecision" : "Mixed (Float32, Int8)",
|
|
24
24
|
"license" : "AGPL-3.0 License (https:\/\/ultralytics.com\/license)",
|
|
25
|
-
"
|
|
26
|
-
"Concat" : 21,
|
|
27
|
-
"Silu" : 63,
|
|
28
|
-
"Sin" : 1,
|
|
29
|
-
"Sub" : 3,
|
|
30
|
-
"Transpose" : 1,
|
|
31
|
-
"Cos" : 1,
|
|
32
|
-
"UpsampleNearestNeighbor" : 2,
|
|
33
|
-
"Softmax" : 1,
|
|
34
|
-
"Mul" : 8,
|
|
35
|
-
"Cast" : 2,
|
|
36
|
-
"Sigmoid" : 2,
|
|
37
|
-
"Add" : 9,
|
|
38
|
-
"Reshape" : 8,
|
|
39
|
-
"MaxPool" : 3,
|
|
40
|
-
"Split" : 11,
|
|
41
|
-
"Conv" : 73
|
|
42
|
-
},
|
|
43
|
-
"computePrecision" : "Mixed (Float16, Float32, Int32)",
|
|
25
|
+
"computePrecision" : "Float16",
|
|
44
26
|
"stateSchema" : [
|
|
45
27
|
|
|
46
28
|
],
|
|
47
29
|
"isUpdatable" : "0",
|
|
48
30
|
"availability" : {
|
|
49
|
-
"macOS" : "
|
|
50
|
-
"tvOS" : "
|
|
31
|
+
"macOS" : "10.15",
|
|
32
|
+
"tvOS" : "13.0",
|
|
51
33
|
"visionOS" : "1.0",
|
|
52
|
-
"watchOS" : "
|
|
53
|
-
"iOS" : "
|
|
54
|
-
"macCatalyst" : "
|
|
34
|
+
"watchOS" : "6.0",
|
|
35
|
+
"iOS" : "13.0",
|
|
36
|
+
"macCatalyst" : "13.0"
|
|
55
37
|
},
|
|
56
38
|
"modelType" : {
|
|
57
|
-
"name" : "
|
|
39
|
+
"name" : "MLModelType_neuralNetwork"
|
|
58
40
|
},
|
|
59
41
|
"inputSchema" : [
|
|
60
42
|
{
|
|
@@ -71,18 +53,36 @@
|
|
|
71
53
|
}
|
|
72
54
|
],
|
|
73
55
|
"userDefinedMetadata" : {
|
|
56
|
+
"com.github.apple.coremltools.source" : "torch==2.4.1+cu121",
|
|
74
57
|
"stride" : "32",
|
|
75
|
-
"com.github.apple.coremltools.version" : "
|
|
76
|
-
"com.github.apple.coremltools.source" : "torch==2.3.1+cu121",
|
|
77
|
-
"com.github.apple.coremltools.source_dialect" : "TorchScript",
|
|
78
|
-
"task" : "obb",
|
|
58
|
+
"com.github.apple.coremltools.version" : "6.2",
|
|
79
59
|
"docs" : "https:\/\/docs.ultralytics.com",
|
|
60
|
+
"task" : "obb",
|
|
80
61
|
"imgsz" : "[256, 384]",
|
|
81
|
-
"date" : "
|
|
62
|
+
"date" : "2025-01-17T18:36:21.708468",
|
|
82
63
|
"batch" : "1",
|
|
83
64
|
"names" : "{0: 'id_mrz_image', 1: 'mrz_2', 2: 'mrz_3', 3: 'id_mrz', 4: 'id_image', 5: 'face', 6: 'vin', 7: 'signature'}"
|
|
84
65
|
},
|
|
85
|
-
"generatedClassName" : "
|
|
66
|
+
"generatedClassName" : "int8_384x256_small2",
|
|
67
|
+
"neuralNetworkLayerTypeHistogram" : {
|
|
68
|
+
"Concat" : 16,
|
|
69
|
+
"Convolution" : 69,
|
|
70
|
+
"Sin" : 1,
|
|
71
|
+
"PoolingINVALID" : 3,
|
|
72
|
+
"UpsampleINVALID" : 2,
|
|
73
|
+
"ReshapeStatic" : 8,
|
|
74
|
+
"LoadConstantND" : 3,
|
|
75
|
+
"ActivationSigmoid" : 61,
|
|
76
|
+
"Transpose" : 1,
|
|
77
|
+
"Cos" : 1,
|
|
78
|
+
"SplitND" : 11,
|
|
79
|
+
"Softmax" : 1,
|
|
80
|
+
"MultiplyBroadcastable" : 1,
|
|
81
|
+
"Multiply" : 65,
|
|
82
|
+
"Add" : 10,
|
|
83
|
+
"ConcatND" : 5,
|
|
84
|
+
"ActivationLinear" : 3
|
|
85
|
+
},
|
|
86
86
|
"method" : "predict"
|
|
87
87
|
}
|
|
88
88
|
]
|