shirne / zxing-dart Goto Github PK
View Code? Open in Web Editor NEWzxing-dart is a Dart port of zxing.
License: Apache License 2.0
zxing-dart is a Dart port of zxing.
License: Apache License 2.0
如题,Android的YUV420能正常解析二维码,而iOS的YUV420不行
In camera module we have an option to get stream of frames
_controller.startImageStream( CameraImgae image => { } )
How can I decode it from that CameraImage object?
In your example you decode it from Xpic file, but I prefer to decode it with stream because it should be more efficient for live decode
In addition, when I get the results, does it possible to get the positions of each result? like we can in flutter_zxing
lib.
Hello, I'm trying to encode data matrix format.
try {
var dataMatrixWriter = MultiFormatWriter();
var encode = dataMatrixWriter.encode(
'FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7',
BarcodeFormat.DATA_MATRIX,
48,
48, {EncodeHintType.DATA_MATRIX_SHAPE : SymbolShapeHint.FORCE_SQUARE, EncodeHintType.MIN_SIZE: Dimension(48,48)});
var scale = 15;
var image = img.Image((encode.width + 2) * scale, (encode.height + 2) * scale);
img.fill(image, Colors.white.value);
for (var x = 0; x < encode.width; x++) {
for (var y = 0; y < encode.height; y++) {
if (encode.get(x, y)) {
img.fillRect(image, (x + 1) * scale, (y + 1) * scale, (x + 1) * scale + scale,
(y + 1) * scale + scale, Colors.black.value);
}
}
}
var pngBytes = img.encodePng(image);
final File generatedImg = MemoryFileSystem().file('test_' + getRandomString(15));
generatedImg.writeAsBytesSync(pngBytes);
setState(() {
_generatedImg = generatedImg;
});
} catch (e, s) {
print(s);
print(e);
}
There are two errors:
The first pixel must be black, the 2nd one white, the 3rd black, etc...
Same thing for the second module, it starts with white instead of black.
try {
var encode = dataMatrixWriter.encode(
'FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7FR03AV011E7F1E7',
BarcodeFormat.DATA_MATRIX,
52,
52, {EncodeHintType.DATA_MATRIX_SHAPE : SymbolShapeHint.FORCE_SQUARE, EncodeHintType.MIN_SIZE: Dimension(52,52)});
} catch (e, s) {
print(s);
print(e);
}
I/flutter ( 6641): #0 _StringBase.substring (dart:core-patch/string_patch.dart:399:7)
I/flutter ( 6641): #1 StringBuilder.replace (package:zxing_lib/src/common/string_builder.dart:39:39)
I/flutter ( 6641): #2 StringBuilder.setCharAt (package:zxing_lib/src/common/string_builder.dart:28:5)
I/flutter ( 6641): #3 ErrorCorrection.encodeECC200 (package:zxing_lib/src/datamatrix/encoder/error_correction.dart:119:14)
I/flutter ( 6641): #4 DataMatrixWriter.encode (package:zxing_lib/src/datamatrix/data_matrix_writer.dart:84:40)
I/flutter ( 6641): #5 MultiFormatWriter.encode (package:zxing_lib/src/multi_format_writer.dart:87:19)
I/flutter ( 6641): #6 _FullScreenCertState.initState.<anonymous closure> (package:pass_sanitaire/main.dart:650:39)
I/flutter ( 6641): #7 _FullScreenCertState.initState.<anonymous closure> (package:pass_sanitaire/main.dart:647:34)
I/flutter ( 6641): #8 _rootRunUnary (dart:async/zone.dart:1436:47)
I/flutter ( 6641): #9 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
I/flutter ( 6641): <asynchronous suspension>
I/flutter ( 6641): RangeError: Value not in range: 206
Would you be able to make this work for Flutter Web, I've been trying to read PDF417 codes using a webcam and haven't had any luck with my own ports or using system channels with / js workarounds.
Is your feature request related to a problem? Please describe.
如题,我对比了 flutter_zxing(ffi)和 zxing_lib(dart)
Describe the solution you'd like
优化 zxing_lib 在无二维码/条形时的实时识别效率
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
Package installed through flutter pub add does not have same amount of files that git repo has.
To Reproduce
Steps to reproduce the behavior:
flutter pub add zxing_lib
commandlib/models/decoder.dart:188:17: Error: Couldn't find constructor 'DecodeHint'.
in the debug consoleTried reinstalling and updating package, no effect.
Expected behavior
No errors
Screenshots
Attached screenshot with missing decode_hint.dart (and others) file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.