@@ -41,13 +41,13 @@ @interface ZXIBarcodeReader()
41
41
@implementation ZXIBarcodeReader
42
42
43
43
- (instancetype )init {
44
- return [self initWithHints : [[ZXIDecodeHints alloc ] init ]];
44
+ return [self initWithOptions : [[ZXIReaderOptions alloc ] init ]];
45
45
}
46
46
47
- - (instancetype )initWithHints : (ZXIDecodeHints*) hints {
47
+ - (instancetype )initWithOptions : (ZXIReaderOptions*) options {
48
48
self = [super init ];
49
49
self.ciContext = [[CIContext alloc ] initWithOptions: @{kCIContextWorkingColorSpace : [NSNull new ]}];
50
- self.hints = hints ;
50
+ self.options = options ;
51
51
return self;
52
52
}
53
53
@@ -117,29 +117,28 @@ - (instancetype)initWithHints:(ZXIDecodeHints*)hints{
117
117
return [self readImageView: imageView error: error];
118
118
}
119
119
120
- + (DecodeHints)DecodeHintsFromZXIOptions : (ZXIDecodeHints*) hints {
120
+ + (DecodeHints)DecodeHintsFromZXIReaderOptions : (ZXIReaderOptions*) options {
121
121
BarcodeFormats formats;
122
- for (NSNumber * flag in hints .formats ) {
122
+ for (NSNumber * flag in options .formats ) {
123
123
formats.setFlag (BarcodeFormatFromZXIFormat ((ZXIFormat)flag.integerValue ));
124
124
}
125
125
DecodeHints resultingHints = DecodeHints ()
126
- .setTryRotate (hints.tryRotate )
127
- .setTryHarder (hints.tryHarder )
128
- .setTryInvert (hints.tryInvert )
129
- .setTryDownscale (hints.tryDownscale )
130
- .setTryCode39ExtendedMode (hints.tryCode39ExtendedMode )
131
- .setValidateCode39CheckSum (hints.validateCode39CheckSum )
132
- .setValidateITFCheckSum (hints.validateITFCheckSum )
133
-
134
126
.setFormats (formats)
135
- .setMaxNumberOfSymbols (hints.maxNumberOfSymbols );
127
+ .setTryRotate (options.tryRotate )
128
+ .setTryHarder (options.tryHarder )
129
+ .setTryInvert (options.tryInvert )
130
+ .setTryDownscale (options.tryDownscale )
131
+ .setTryCode39ExtendedMode (options.tryCode39ExtendedMode )
132
+ .setValidateCode39CheckSum (options.validateCode39CheckSum )
133
+ .setValidateITFCheckSum (options.validateITFCheckSum )
134
+ .setMaxNumberOfSymbols (options.maxNumberOfSymbols );
136
135
return resultingHints;
137
136
}
138
137
139
138
- (NSArray <ZXIResult*> *)readImageView : (ImageView)imageView
140
139
error : (NSError *__autoreleasing _Nullable *)error {
141
140
try {
142
- Results results = ReadBarcodes (imageView, [ZXIBarcodeReader DecodeHintsFromZXIOptions :self .hints ]);
141
+ Results results = ReadBarcodes (imageView, [ZXIBarcodeReader DecodeHintsFromZXIReaderOptions :self .options ]);
143
142
NSMutableArray * zxiResults = [NSMutableArray array ];
144
143
for (auto result: results) {
145
144
[zxiResults addObject:
0 commit comments