native_structs library
Google's MediaPipe C structs that more than one family binds, from the
release core pins for every family (family_runtimes.dart), and the
helpers that fill and copy them. For the family packages' FFI bindings,
whose ABI tests check every size and field offset against Google's wheel;
not for applications.
Classes
- MpBaseOptions
-
MpBaseOptions: the model, delegate and host every task's options embed. - MpCategory
-
MpCategory: one class and its score. - MpClassificationResult
-
MpClassificationResult: every head, with a timestamp. - MpClassifications
-
MpClassifications: one classifier head's categories. - MpClassifierOptions
-
MpClassifierOptions: the classifiers' result filtering. - MpEmbedding
-
MpEmbedding: one head's vector, as floats or quantized bytes. - MpEmbeddingResult
-
MpEmbeddingResult: every head, with a timestamp.
Functions
-
checkNativeStatus(
int call(Pointer< Pointer< error), void errorFree(Pointer<Char> >Char> message), {Object failure(String message, int status)?}) → void -
Runs
call, one of Google's C functions that report a failure through an error out-parameter, and throws a failure as a TaskException with Google's message and status, or as whatfailuremakes of them.errorFreeis the calling family'sMpErrorFree, since each family loads its own library; it frees Google's message on every path. -
copyClassifications(
MpClassificationResult result) → List< Classifications> -
Copies every head of Google's
resultbefore Google frees it. -
fillBaseOptions(
MpBaseOptions target, Arena arena, {String? modelPath, Uint8List? modelBytes, Delegate delegate = Delegate.cpu}) → void -
Fills Google's base options for
delegate, the CPU unless a task has proved its GPU path, with the model atmodelPathor inmodelBytes(or none, for a task such as Semantic Retriever that loads no model), and the host as Flutter on this OS, withmpHostVersion, which Google's usage log records (it records neither while the environment is unknown), and the app asmpAppIdandmpAppVersion, where there are any. Bytes and strings are copied intoarena, which may free them once the task exists: Google copies them when it creates the task. -
fillClassifierOptions(
MpClassifierOptions target, Arena arena, ClassifierSettings settings) → void -
Fills Google's classifier options from
settings, every string inarena. -
nativeString(
Pointer< Char> value, {bool emptyIsNull = false}) → String? -
Copies Google's C string, or null for a null pointer. With
emptyIsNull, an empty string is null too, as Google's Python reads optional strings. -
nativeStrings(
Arena arena, List< String> values) → Pointer<Pointer< Char> > -
Copies
valuesinto a C string array inarena, or null when there are none.