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 tracked face. throws FaceException An error has occurred during Face Library execution.
Implementation
static TrackedFace fromFile(String? path) {
TrackedFace trackedFace = TrackedFace();
Pointer<Char>? pPath = path?.toNativeUtf8().cast<Char>();
try {
var err = faceSDK.id3TrackedFace_FromFile(trackedFace.handle, pPath ?? nullptr);
if (err != FaceError.success.value) {
trackedFace.dispose();
throw FaceException(err);
}
return trackedFace;
} finally {
if (pPath != null) {
calloc.free(pPath);
}
}
}