getRocCurvePointByFar method Null safety

MatchResult getRocCurvePointByFar(
  1. double far_threshold
)

Implementation

MatchResult getRocCurvePointByFar(double far_threshold) {
  final get_roc_curve =
      _dll_handle.lookupFunction<_Recognizer_get_roc_curve_c, _Recognizer_get_roc_curve_dart>(_c_namespace + 'Recognizer_getROCCurvePointByFAR_v2');

  Pointer<Double> result_distance = malloc.allocate(sizeOf<Double>());
  Pointer<Double> result_far = malloc.allocate(sizeOf<Double>());
  Pointer<Double> result_frr = malloc.allocate(sizeOf<Double>());
  Pointer<Double> result_score = malloc.allocate(sizeOf<Double>());

  final exception = _getException();
  get_roc_curve(_impl, far_threshold, result_distance, result_far, result_frr, result_score, exception);
  checkException(exception, _dll_handle);

  final result = MatchResult(result_distance.value, result_far.value, result_frr.value, result_score.value);

  malloc.free(result_distance);
  malloc.free(result_far);
  malloc.free(result_frr);
  malloc.free(result_score);

  return result;
}