View source on GitHub
|
Stores the ctypes signature for a status-returning C function.
Inherits From: CFunction
mp.tasks.vision.drawing_styles.face_landmarker.mediapipe_c_utils.CStatusFunction(
func_name: str, core_argtypes
)
The functions is required to take an error message argument as the last argument and return an `MpStatus' integer code.
Args | |
|---|---|
func_name
|
The name of the C function. |
core_argtypes
|
The ctypes types for the function arguments excluding the error message argument. |
Attributes | |
|---|---|
func_name
|
Dataclass field |
argtypes
|
Dataclass field |
restype
|
Dataclass field |
Methods
create_python_wrapper
create_python_wrapper(
lib: ctypes.CDLL, executor: concurrent.futures.Executor
) -> Callable[..., None]
Creates a callable wrapper that executes the C function on the executor.
This function raises a Python exception based on the MpStatus code returned by the C API function and the error message argument.
| Args | |
|---|---|
lib
|
The ctypes shared library. |
executor
|
The executor to use for the C function. |
| Returns | |
|---|---|
| A callable that executes the C function on the executor. |
__eq__
__eq__(
other
)
View source on GitHub