|
|
@ -34,30 +34,40 @@ class GeneratedBindings { |
|
|
|
|
|
|
|
|
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @brief Reads barcode from image. |
|
|
|
/// @param bytes Image bytes. |
|
|
|
/// @param bytes Image bytes. |
|
|
|
|
|
|
|
/// @param format The format of the barcode |
|
|
|
/// @param width Image width. |
|
|
|
/// @param width Image width. |
|
|
|
/// @param height Image height. |
|
|
|
/// @param height Image height. |
|
|
|
/// @param cropSize Crop size. |
|
|
|
/// @param cropWidth Crop width. |
|
|
|
|
|
|
|
/// @param cropHeight Crop height. |
|
|
|
|
|
|
|
/// @param logEnabled Log enabled. |
|
|
|
/// @return Barcode result. |
|
|
|
/// @return Barcode result. |
|
|
|
CodeResult zxingRead( |
|
|
|
CodeResult zxingRead( |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
ffi.Pointer<ffi.Int8> bytes, |
|
|
|
|
|
|
|
int format, |
|
|
|
int width, |
|
|
|
int width, |
|
|
|
int height, |
|
|
|
int height, |
|
|
|
int cropSize, |
|
|
|
int cropWidth, |
|
|
|
|
|
|
|
int cropHeight, |
|
|
|
|
|
|
|
int logEnabled, |
|
|
|
) { |
|
|
|
) { |
|
|
|
return _zxingRead( |
|
|
|
return _zxingRead( |
|
|
|
bytes, |
|
|
|
bytes, |
|
|
|
|
|
|
|
format, |
|
|
|
width, |
|
|
|
width, |
|
|
|
height, |
|
|
|
height, |
|
|
|
cropSize, |
|
|
|
cropWidth, |
|
|
|
|
|
|
|
cropHeight, |
|
|
|
|
|
|
|
logEnabled, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _zxingReadPtr = _lookup< |
|
|
|
late final _zxingReadPtr = _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)>>('zxingRead'); |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('zxingRead'); |
|
|
|
late final _zxingRead = _zxingReadPtr |
|
|
|
late final _zxingRead = _zxingReadPtr.asFunction< |
|
|
|
.asFunction<CodeResult Function(ffi.Pointer<ffi.Int8>, int, int, int)>(); |
|
|
|
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 |
|
|
@ -65,6 +75,7 @@ class GeneratedBindings { |
|
|
|
/// @param height The height of the barcode |
|
|
|
/// @param height The height of the barcode |
|
|
|
/// @param format The format of the barcode |
|
|
|
/// @param format The format of the barcode |
|
|
|
/// @param margin The margin of the barcode |
|
|
|
/// @param margin The margin of the barcode |
|
|
|
|
|
|
|
/// @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 zxingEncode( |
|
|
@ -74,6 +85,7 @@ class GeneratedBindings { |
|
|
|
int format, |
|
|
|
int format, |
|
|
|
int margin, |
|
|
|
int margin, |
|
|
|
int eccLevel, |
|
|
|
int eccLevel, |
|
|
|
|
|
|
|
int logEnabled, |
|
|
|
) { |
|
|
|
) { |
|
|
|
return _zxingEncode( |
|
|
|
return _zxingEncode( |
|
|
|
contents, |
|
|
|
contents, |
|
|
@ -82,15 +94,17 @@ class GeneratedBindings { |
|
|
|
format, |
|
|
|
format, |
|
|
|
margin, |
|
|
|
margin, |
|
|
|
eccLevel, |
|
|
|
eccLevel, |
|
|
|
|
|
|
|
logEnabled, |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
late final _zxingEncodePtr = _lookup< |
|
|
|
late final _zxingEncodePtr = _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)>>('zxingEncode'); |
|
|
|
ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>('zxingEncode'); |
|
|
|
late final _zxingEncode = _zxingEncodePtr.asFunction< |
|
|
|
late final _zxingEncode = _zxingEncodePtr.asFunction< |
|
|
|
EncodeResult Function(ffi.Pointer<ffi.Int8>, int, int, int, int, int)>(); |
|
|
|
EncodeResult Function( |
|
|
|
|
|
|
|
ffi.Pointer<ffi.Int8>, int, int, int, int, int, int)>(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
abstract class Format { |
|
|
|
abstract class Format { |
|
|
|