|
|
@ -22,14 +22,14 @@ class GeneratedBindings { |
|
|
|
/// Returns the version of the zxing-cpp library. |
|
|
|
/// Returns the version of the zxing-cpp library. |
|
|
|
/// |
|
|
|
/// |
|
|
|
/// @return The version of the zxing-cpp library. |
|
|
|
/// @return The version of the zxing-cpp library. |
|
|
|
ffi.Pointer<ffi.Int8> version() { |
|
|
|
ffi.Pointer<ffi.Char> version() { |
|
|
|
return _version(); |
|
|
|
return _version(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _versionPtr = |
|
|
|
late final _versionPtr = |
|
|
|
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Int8> Function()>>('version'); |
|
|
|
_lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>('version'); |
|
|
|
late final _version = |
|
|
|
late final _version = |
|
|
|
_versionPtr.asFunction<ffi.Pointer<ffi.Int8> Function()>(); |
|
|
|
_versionPtr.asFunction<ffi.Pointer<ffi.Char> Function()>(); |
|
|
|
|
|
|
|
|
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @param bytes Image bytes. |
|
|
|
/// @param bytes Image bytes. |
|
|
@ -41,7 +41,7 @@ class GeneratedBindings { |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @return Barcode result. |
|
|
|
/// @return Barcode result. |
|
|
|
CodeResult readBarcode( |
|
|
|
CodeResult readBarcode( |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
ffi.Pointer<ffi.Char> bytes, |
|
|
|
int format, |
|
|
|
int format, |
|
|
|
int width, |
|
|
|
int width, |
|
|
|
int height, |
|
|
|
int height, |
|
|
@ -62,11 +62,11 @@ class GeneratedBindings { |
|
|
|
|
|
|
|
|
|
|
|
late final _readBarcodePtr = _lookup< |
|
|
|
late final _readBarcodePtr = _lookup< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.NativeFunction< |
|
|
|
CodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
CodeResult Function(ffi.Pointer<ffi.Char>, ffi.Int, ffi.Int, ffi.Int, |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('readBarcode'); |
|
|
|
ffi.Int, ffi.Int, ffi.Int)>>('readBarcode'); |
|
|
|
late final _readBarcode = _readBarcodePtr.asFunction< |
|
|
|
late final _readBarcode = _readBarcodePtr.asFunction< |
|
|
|
CodeResult Function( |
|
|
|
CodeResult Function( |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
ffi.Pointer<ffi.Char>, int, int, int, int, int, int)>(); |
|
|
|
|
|
|
|
|
|
|
|
/// @brief Reads barcodes from image. |
|
|
|
/// @brief Reads barcodes from image. |
|
|
|
/// @param bytes Image bytes. |
|
|
|
/// @param bytes Image bytes. |
|
|
@ -78,7 +78,7 @@ class GeneratedBindings { |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @return Barcode results. |
|
|
|
/// @return Barcode results. |
|
|
|
ffi.Pointer<CodeResult> readBarcodes( |
|
|
|
ffi.Pointer<CodeResult> readBarcodes( |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
ffi.Pointer<ffi.Char> bytes, |
|
|
|
int format, |
|
|
|
int format, |
|
|
|
int width, |
|
|
|
int width, |
|
|
|
int height, |
|
|
|
int height, |
|
|
@ -99,17 +99,11 @@ class GeneratedBindings { |
|
|
|
|
|
|
|
|
|
|
|
late final _readBarcodesPtr = _lookup< |
|
|
|
late final _readBarcodesPtr = _lookup< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.Pointer<CodeResult> Function( |
|
|
|
ffi.Pointer<CodeResult> Function(ffi.Pointer<ffi.Char>, ffi.Int, |
|
|
|
ffi.Pointer<ffi.Int8>, |
|
|
|
ffi.Int, ffi.Int, ffi.Int, ffi.Int, ffi.Int)>>('readBarcodes'); |
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32, |
|
|
|
|
|
|
|
ffi.Int32)>>('readBarcodes'); |
|
|
|
|
|
|
|
late final _readBarcodes = _readBarcodesPtr.asFunction< |
|
|
|
late final _readBarcodes = _readBarcodesPtr.asFunction< |
|
|
|
ffi.Pointer<CodeResult> Function( |
|
|
|
ffi.Pointer<CodeResult> Function( |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
ffi.Pointer<ffi.Char>, 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 |
|
|
@ -121,7 +115,7 @@ class GeneratedBindings { |
|
|
|
/// @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 encodeBarcode( |
|
|
|
EncodeResult encodeBarcode( |
|
|
|
ffi.Pointer<ffi.Int8> contents, |
|
|
|
ffi.Pointer<ffi.Char> contents, |
|
|
|
int width, |
|
|
|
int width, |
|
|
|
int height, |
|
|
|
int height, |
|
|
|
int format, |
|
|
|
int format, |
|
|
@ -142,11 +136,11 @@ class GeneratedBindings { |
|
|
|
|
|
|
|
|
|
|
|
late final _encodeBarcodePtr = _lookup< |
|
|
|
late final _encodeBarcodePtr = _lookup< |
|
|
|
ffi.NativeFunction< |
|
|
|
ffi.NativeFunction< |
|
|
|
EncodeResult Function(ffi.Pointer<ffi.Int8>, ffi.Int32, ffi.Int32, |
|
|
|
EncodeResult Function(ffi.Pointer<ffi.Char>, ffi.Int, ffi.Int, |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('encodeBarcode'); |
|
|
|
ffi.Int, ffi.Int, ffi.Int, ffi.Int)>>('encodeBarcode'); |
|
|
|
late final _encodeBarcode = _encodeBarcodePtr.asFunction< |
|
|
|
late final _encodeBarcode = _encodeBarcodePtr.asFunction< |
|
|
|
EncodeResult Function( |
|
|
|
EncodeResult Function( |
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
ffi.Pointer<ffi.Char>, int, int, int, int, int, int)>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
abstract class Format { |
|
|
|
abstract class Format { |
|
|
@ -206,28 +200,28 @@ abstract class Format { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class CodeResult extends ffi.Struct { |
|
|
|
class CodeResult extends ffi.Struct { |
|
|
|
@ffi.Int32() |
|
|
|
@ffi.Int() |
|
|
|
external int isValid; |
|
|
|
external int isValid; |
|
|
|
|
|
|
|
|
|
|
|
external ffi.Pointer<ffi.Int8> text; |
|
|
|
external ffi.Pointer<ffi.Char> text; |
|
|
|
|
|
|
|
|
|
|
|
@ffi.Int32() |
|
|
|
@ffi.Int32() |
|
|
|
external int format; |
|
|
|
external int format; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class EncodeResult extends ffi.Struct { |
|
|
|
class EncodeResult extends ffi.Struct { |
|
|
|
@ffi.Int32() |
|
|
|
@ffi.Int() |
|
|
|
external int isValid; |
|
|
|
external int isValid; |
|
|
|
|
|
|
|
|
|
|
|
external ffi.Pointer<ffi.Int8> text; |
|
|
|
external ffi.Pointer<ffi.Char> text; |
|
|
|
|
|
|
|
|
|
|
|
@ffi.Int32() |
|
|
|
@ffi.Int32() |
|
|
|
external int format; |
|
|
|
external int format; |
|
|
|
|
|
|
|
|
|
|
|
external ffi.Pointer<ffi.Uint32> data; |
|
|
|
external ffi.Pointer<ffi.UnsignedInt> data; |
|
|
|
|
|
|
|
|
|
|
|
@ffi.Int32() |
|
|
|
@ffi.Int() |
|
|
|
external int length; |
|
|
|
external int length; |
|
|
|
|
|
|
|
|
|
|
|
external ffi.Pointer<ffi.Int8> error; |
|
|
|
external ffi.Pointer<ffi.Char> error; |
|
|
|
} |
|
|
|
} |
|
|
|