decode method
- Uint8List? data
Attempts to decode a barcode from the provided raw image data.
param data An array of bytes representing the raw image data that contains the barcode to be decoded. return A boolean output that indicates the success of the decoding process. It is set to 'true' if the barcode is successfully decoded, otherwise 'false'. throws BiosealException An error has occurred during Bioseal Library execution.
Implementation
bool decode(Uint8List? data) {
Pointer<UnsignedChar>? pData;
if (data != null) {
pData = calloc.allocate<UnsignedChar>(data.length);
pData.cast<Uint8>().asTypedList(data.length).setAll(0, data);
}
Pointer<Bool> pResult = calloc();
try {
var err = biosealSDK.id3BiosealBarcodeReader_Decode(_pHandle.value, pData ?? nullptr, data?.length ?? 0, pResult);
if (err != BiosealError.success.value) {
throw BiosealException(err);
}
final vResult = pResult.value;
return vResult;
} finally {
if (pData != null) {
calloc.free(pData);
}
calloc.free(pResult);
}
}