fromFile static method
- String? path
Imports the face object from a file.
param path Path to the file to import the face object from. return The newly created detected face. throws FaceException An error has occurred during Face Library execution.
Implementation
static DetectedFace fromFile(String? path) {
DetectedFace detectedFace = DetectedFace();
Pointer<Char>? pPath = path?.toNativeUtf8().cast<Char>();
try {
var err = faceSDK.id3DetectedFace_FromFile(detectedFace.handle, pPath ?? nullptr);
if (err != FaceError.success.value) {
detectedFace.dispose();
throw FaceException(err);
}
return detectedFace;
} finally {
if (pPath != null) {
calloc.free(pPath);
}
}
}