|
|
@ -22,15 +22,14 @@ class GeneratedBindings { |
|
|
|
/// Returns the version of the zxing library. |
|
|
|
/// Returns the version of the zxing library. |
|
|
|
/// |
|
|
|
/// |
|
|
|
/// @return The version of the zxing library. |
|
|
|
/// @return The version of the zxing library. |
|
|
|
ffi.Pointer<ffi.Int8> zxingVersion() { |
|
|
|
ffi.Pointer<ffi.Int8> version() { |
|
|
|
return _zxingVersion(); |
|
|
|
return _version(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _zxingVersionPtr = |
|
|
|
late final _versionPtr = |
|
|
|
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Int8> Function()>>( |
|
|
|
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Int8> Function()>>('version'); |
|
|
|
'zxingVersion'); |
|
|
|
late final _version = |
|
|
|
late final _zxingVersion = |
|
|
|
_versionPtr.asFunction<ffi.Pointer<ffi.Int8> Function()>(); |
|
|
|
_zxingVersionPtr.asFunction<ffi.Pointer<ffi.Int8> Function()>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @param bytes Image bytes. |
|
|
|
/// @param bytes Image bytes. |
|
|
@ -41,7 +40,7 @@ class GeneratedBindings { |
|
|
|
/// @param cropHeight Crop height. |
|
|
|
/// @param cropHeight Crop height. |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @return Barcode result. |
|
|
|
/// @return Barcode result. |
|
|
|
CodeResult zxingRead( |
|
|
|
CodeResult readBarcode( |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
int format, |
|
|
|
int format, |
|
|
|
int width, |
|
|
|
int width, |
|
|
@ -50,7 +49,7 @@ class GeneratedBindings { |
|
|
|
int cropHeight, |
|
|
|
int cropHeight, |
|
|
|
int logEnabled, |
|
|
|
int logEnabled, |
|
|
|
) { |
|
|
|
) { |
|
|
|
return _zxingRead( |
|
|
|
return _readBarcode( |
|
|
|
bytes, |
|
|
|
bytes, |
|
|
|
format, |
|
|
|
format, |
|
|
|
width, |
|
|
|
width, |
|
|
@ -61,14 +60,57 @@ class GeneratedBindings { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _zxingReadPtr = _lookup< |
|
|
|
late final _readBarcodePtr = _lookup< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.NativeFunction< |
|
|
|
CodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
CodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('zxingRead'); |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('readBarcode'); |
|
|
|
late final _zxingRead = _zxingReadPtr.asFunction< |
|
|
|
late final _readBarcode = _readBarcodePtr.asFunction< |
|
|
|
CodeResult Function( |
|
|
|
CodeResult Function( |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @brief Reads barcodes from image. |
|
|
|
|
|
|
|
/// @param bytes Image bytes. |
|
|
|
|
|
|
|
/// @param format The format of the barcode |
|
|
|
|
|
|
|
/// @param width Image width. |
|
|
|
|
|
|
|
/// @param height Image height. |
|
|
|
|
|
|
|
/// @param cropWidth Crop width. |
|
|
|
|
|
|
|
/// @param cropHeight Crop height. |
|
|
|
|
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
|
|
|
|
/// @return Barcode results. |
|
|
|
|
|
|
|
ffi.Pointer<CodeResult> readBarcodes( |
|
|
|
|
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
|
|
|
|
int format, |
|
|
|
|
|
|
|
int width, |
|
|
|
|
|
|
|
int height, |
|
|
|
|
|
|
|
int cropWidth, |
|
|
|
|
|
|
|
int cropHeight, |
|
|
|
|
|
|
|
int logEnabled, |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
return _readBarcodes( |
|
|
|
|
|
|
|
bytes, |
|
|
|
|
|
|
|
format, |
|
|
|
|
|
|
|
width, |
|
|
|
|
|
|
|
height, |
|
|
|
|
|
|
|
cropWidth, |
|
|
|
|
|
|
|
cropHeight, |
|
|
|
|
|
|
|
logEnabled, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
late final _readBarcodesPtr = _lookup< |
|
|
|
|
|
|
|
ffi.NativeFunction< |
|
|
|
|
|
|
|
ffi.Pointer<CodeResult> Function( |
|
|
|
|
|
|
|
ffi.Pointer<ffi.Int8>, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32)>>('readBarcodes'); |
|
|
|
|
|
|
|
late final _readBarcodes = _readBarcodesPtr.asFunction< |
|
|
|
|
|
|
|
ffi.Pointer<CodeResult> Function( |
|
|
|
|
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
|
|
|
|
|
|
|
|
/// @brief Encode a string into a barcode |
|
|
|
/// @brief Encode a string into a barcode |
|
|
|
/// @param contents The string to encode |
|
|
|
/// @param contents The string to encode |
|
|
|
/// @param width The width of the barcode |
|
|
|
/// @param width The width of the barcode |
|
|
@ -78,7 +120,7 @@ class GeneratedBindings { |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @param eccLevel The error correction level of the barcode. Used for Aztec, PDF417, and QRCode only, [0-8]. |
|
|
|
/// @param eccLevel The error correction level of the barcode. Used for Aztec, PDF417, and QRCode only, [0-8]. |
|
|
|
/// @return The barcode data |
|
|
|
/// @return The barcode data |
|
|
|
EncodeResult zxingEncode( |
|
|
|
EncodeResult encodeBarcode( |
|
|
|
ffi.Pointer<ffi.Int8> contents, |
|
|
|
ffi.Pointer<ffi.Int8> contents, |
|
|
|
int width, |
|
|
|
int width, |
|
|
|
int height, |
|
|
|
int height, |
|
|
@ -87,7 +129,7 @@ class GeneratedBindings { |
|
|
|
int eccLevel, |
|
|
|
int eccLevel, |
|
|
|
int logEnabled, |
|
|
|
int logEnabled, |
|
|
|
) { |
|
|
|
) { |
|
|
|
return _zxingEncode( |
|
|
|
return _encodeBarcode( |
|
|
|
contents, |
|
|
|
contents, |
|
|
|
width, |
|
|
|
width, |
|
|
|
height, |
|
|
|
height, |
|
|
@ -98,11 +140,11 @@ class GeneratedBindings { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _zxingEncodePtr = _lookup< |
|
|
|
late final _encodeBarcodePtr = _lookup< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.NativeFunction< |
|
|
|
EncodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
EncodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('zxingEncode'); |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('encodeBarcode'); |
|
|
|
late final _zxingEncode = _zxingEncodePtr.asFunction< |
|
|
|
late final _encodeBarcode = _encodeBarcodePtr.asFunction< |
|
|
|
EncodeResult Function( |
|
|
|
EncodeResult Function( |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
} |
|
|
|
} |
|
|
|