Functions for managing Worker objects. More...
Functions | |
VL_SDK_API vlWorker_t *VL_CALLINGCONVENTION | vlNew_Worker (vlAbstractApplicationWrapper_t *aap) |
Creates a Worker object. More... | |
VL_SDK_API vlWorker_t *VL_CALLINGCONVENTION | vlNew_SyncWorker (vlAbstractApplicationWrapper_t *aap) |
Creates a synchronous Worker object. More... | |
VL_SDK_API void VL_CALLINGCONVENTION | vlDelete_Worker (vlWorker_t *worker) |
Deletes a Worker object. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_Start (vlWorker_t *worker) |
Starts the tracking thread. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_Stop (vlWorker_t *worker) |
Stops the tracking thread. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RunOnceSync (vlWorker_t *worker) |
Processes the enqueued commands and the tracking once. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_ProcessJsonCommandSync (vlWorker_t *worker, const char jsonString[], vlCallbackJsonString callback, void *clientData) |
Processes the passed command. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_ProcessJsonAndBinaryCommandSync (vlWorker_t *worker, const char jsonString[], const char data[], unsigned int size, vlCallbackJsonAndBinaryString callback, void *clientData) |
Processes the passed json command along with binary data for the visionLib. More... | |
VL_SDK_API vlImageWrapper_t *VL_CALLINGCONVENTION | vlWorker_GetImageSync (vlWorker_t *worker) |
Returns a pointer to the camera image. More... | |
VL_SDK_API vlImageWrapper_t *VL_CALLINGCONVENTION | vlWorker_GetImageByNameSync (vlWorker_t *worker, const char *image_name) |
Returns a pointer to the camera image with the given name. More... | |
VL_SDK_API vlImageWrapper_t *VL_CALLINGCONVENTION | vlWorker_GetNodeImageSync (vlWorker_t *worker, const char node[], const char key[]) |
Returns a pointer to the image with the given name from a given node. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_SetNodeImageSync (vlWorker_t *worker, vlImageWrapper_t *image, const char node[], const char key[]) |
Sets the given image in the given input of the given node. More... | |
VL_SDK_API vlExtrinsicDataWrapper_t *VL_CALLINGCONVENTION | vlWorker_GetNodeExtrinsicDataSync (vlWorker_t *worker, const char node[], const char key[]) |
Returns a pointer to extrinsicdata with the given name from a given node. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_SetNodeExtrinsicDataSync (vlWorker_t *worker, vlExtrinsicDataWrapper_t *extrinsicData, const char node[], const char key[]) |
Sets the given extrinsicData in the given input of the given node. More... | |
VL_SDK_API vlIntrinsicDataWrapper_t *VL_CALLINGCONVENTION | vlWorker_GetNodeIntrinsicDataSync (vlWorker_t *worker, const char node[], const char key[]) |
Returns a pointer to IntrinsicData with the given name from a given node. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_SetNodeIntrinsicDataSync (vlWorker_t *worker, vlIntrinsicDataWrapper_t *intrinsicData, const char node[], const char key[]) |
Sets the given IntrinsicData in the given input of the given node. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_IsRunning (vlWorker_t *worker) |
Returns whether the thread is currently running or not. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_PushJsonCommand (vlWorker_t *worker, const char jsonString[], vlCallbackJsonString callback, void *clientData) |
Enqueues a command for the tracking thread as zero terminated JSON string. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_PushJsonAndBinaryCommand (vlWorker_t *worker, const char jsonString[], const char data[], unsigned int size, vlCallbackJsonAndBinaryString callback, void *clientData) |
Enqueues a json command along with binary data for the visionLib. More... | |
VL_SDK_API void VL_CALLINGCONVENTION | vlReleaseBinaryBuffer (const char data[]) |
Helper function for releasing a binary memory block. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_ProcessCallbacks (vlWorker_t *worker) |
Executes all enqueued callbacks. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddImageListener (vlWorker_t *worker, vlCallbackImageWrapper listener, void *clientData) |
Registers a listener for image events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveImageListener (vlWorker_t *worker, vlCallbackImageWrapper listener, void *clientData) |
Unregisters a listener from image events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddDebugImageListener (vlWorker_t *worker, vlCallbackImageWrapper listener, void *clientData) |
Register a listener for debug image events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveDebugImageListener (vlWorker_t *worker, vlCallbackImageWrapper listener, void *clientData) |
Unregisters a listener from debug image events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddExtrinsicDataListener (vlWorker_t *worker, vlCallbackExtrinsicDataWrapper listener, void *clientData) |
Registers a listener for ExtrinsicData events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveExtrinsicDataListener (vlWorker_t *worker, vlCallbackExtrinsicDataWrapper listener, void *clientData) |
Unregisters a listener from ExtrinsicData events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddIntrinsicDataListener (vlWorker_t *worker, vlCallbackIntrinsicDataWrapper listener, void *clientData) |
Registers a listener for IntrinsicData events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveIntrinsicDataListener (vlWorker_t *worker, vlCallbackIntrinsicDataWrapper listener, void *clientData) |
Unregisters a listener from IntrinsicData events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddTrackingStateListener (vlWorker_t *worker, vlCallbackZString listener, void *clientData) |
Registers a listener for tracking state events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveTrackingStateListener (vlWorker_t *worker, vlCallbackZString listener, void *clientData) |
Unregisters a listener from tracking state events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddPerformanceInfoListener (vlWorker_t *worker, vlCallbackZString listener, void *clientData) |
Registers a listener for performance information events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemovePerformanceInfoListener (vlWorker_t *worker, vlCallbackZString listener, void *clientData) |
Unregisters a listener from performance info events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_AddAnchorToWorldTransformListener (vlWorker_t *worker, const char anchorName[], vlCallbackExtrinsicDataWrapper listener, void *clientData) |
Register a listener for anchor to world transform events (ExtrinsicData events) produced by a certain anchor. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_RemoveAnchorToWorldTransformListener (vlWorker_t *worker, const char anchorName[], vlCallbackExtrinsicDataWrapper listener, void *clientData) |
Unregister a listener from anchor to world transform events (ExtrinsicData events) produced by a certain anchor. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_ClearListeners (vlWorker_t *worker) |
Removes all listeners. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_PollEvents (vlWorker_t *worker) |
Calls the registered listeners for the enqueued events. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_WaitEvents (vlWorker_t *worker, unsigned int timeout) |
Waits for enqueued events and calls the registered listeners. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_Lock (vlWorker_t *worker) |
For testing purposed. Don't use! More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlWorker_Unlock (vlWorker_t *worker) |
For testing purposed. Don't use! More... | |
Functions for managing Worker objects.
A Worker object controls the tracking thread.
VL_SDK_API void VL_CALLINGCONVENTION vlDelete_Worker | ( | vlWorker_t * | worker | ) |
Deletes a Worker object.
worker | Pointer to a Worker object. |
VL_SDK_API vlWorker_t* VL_CALLINGCONVENTION vlNew_SyncWorker | ( | vlAbstractApplicationWrapper_t * | aap | ) |
Creates a synchronous Worker object.
A synchronous Worker object doesn't create a new thread. Instead one has to explicitly tell the Worker when to do his work by calling the vlWorker_RunOnceSync function. This has the advantage, that we know exactly when the tracking is running, when it's finished and when we can get the results.
If you want to call vlWorker_RunOnceSync from a different thread, then you must call vlAbstractApplicationWrapper_RegisterThread first.
Use vlDelete_Worker after usage to avoid memory leaks.
aap | Pointer to an AbstractApplicationWrapper object. |
VL_SDK_API vlWorker_t* VL_CALLINGCONVENTION vlNew_Worker | ( | vlAbstractApplicationWrapper_t * | aap | ) |
Creates a Worker object.
Use vlDelete_Worker after usage to avoid memory leaks.
aap | Pointer to an AbstractApplicationWrapper object. |
VL_SDK_API void VL_CALLINGCONVENTION vlReleaseBinaryBuffer | ( | const char | data[] | ) |
Helper function for releasing a binary memory block.
When an vlCallbackJsonAndBinaryString is issued, a memory block passed should be removed after using.
Currently this command is used internally and will be documented in future versions. Thus it is considered as BETA!
data | Pointer to a binary object. |
VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddAnchorToWorldTransformListener | ( | vlWorker_t * | worker, |
const char | anchorName[], | ||
vlCallbackExtrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Register a listener for anchor to world transform events (ExtrinsicData events) produced by a certain anchor.
worker | Pointer to a Worker object. |
anchorName | Name of the anchor to be addressed. |
listener | Listener function which will be notified during the event processing, if an event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddDebugImageListener | ( | vlWorker_t * | worker, |
vlCallbackImageWrapper | listener, | ||
void * | clientData | ||
) |
Register a listener for debug image events.
worker | Pointer to a Worker object. |
p | Listener function which will be notified during the event processing, if a debug image event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddExtrinsicDataListener | ( | vlWorker_t * | worker, |
vlCallbackExtrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Registers a listener for ExtrinsicData events.
worker | Pointer to a Worker object. |
listener | Listener function which will be notified during the event processing, if an ExtrinsicData event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddImageListener | ( | vlWorker_t * | worker, |
vlCallbackImageWrapper | listener, | ||
void * | clientData | ||
) |
Registers a listener for image events.
worker | Pointer to a Worker object. |
p | Listener function which will be notified during the event processing, if an image event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddIntrinsicDataListener | ( | vlWorker_t * | worker, |
vlCallbackIntrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Registers a listener for IntrinsicData events.
worker | Pointer to a Worker object. |
listener | Listener function which will be notified during the event processing, if an IntrinsicData event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddPerformanceInfoListener | ( | vlWorker_t * | worker, |
vlCallbackZString | listener, | ||
void * | clientData | ||
) |
Registers a listener for performance information events.
worker | Pointer to a Worker object. |
listener | Listener function which will be notified during the event processing, if a performance information event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_AddTrackingStateListener | ( | vlWorker_t * | worker, |
vlCallbackZString | listener, | ||
void * | clientData | ||
) |
Registers a listener for tracking state events.
worker | Pointer to a Worker object. |
listener | Listener function which will be notified during the event processing, if a tracking state event occurred. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_ClearListeners | ( | vlWorker_t * | worker | ) |
Removes all listeners.
worker | Pointer to a Worker object. |
true
, on success; false
otherwise. VL_SDK_API vlImageWrapper_t* VL_CALLINGCONVENTION vlWorker_GetImageByNameSync | ( | vlWorker_t * | worker, |
const char * | image_name | ||
) |
Returns a pointer to the camera image with the given name.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
The worker is the owner of the image. Therefore you should not call vlDelete_ImageWrapper with the returned image as parameter.
NOTICE: This functions is experimental and might get removed in future.
worker | Pointer to a Worker object. |
image_name | name of the image to get |
NULL
otherwise. VL_SDK_API vlImageWrapper_t* VL_CALLINGCONVENTION vlWorker_GetImageSync | ( | vlWorker_t * | worker | ) |
Returns a pointer to the camera image.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
The worker is the owner of the image. Therefore you should not call vlDelete_ImageWrapper with the returned image as parameter.
NOTICE: This functions is experimental and might get removed in future.
worker | Pointer to a Worker object. |
NULL
otherwise. VL_SDK_API vlExtrinsicDataWrapper_t* VL_CALLINGCONVENTION vlWorker_GetNodeExtrinsicDataSync | ( | vlWorker_t * | worker, |
const char | node[], | ||
const char | key[] | ||
) |
Returns a pointer to extrinsicdata with the given name from a given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
The returned ExtrinsicData has to be freed using vlDelete_ExtrinsicDataWrapper.
NOTICE: This function is experimental and might get removed in future.
worker | Pointer to a Worker object. |
node | The name of the node. |
key | The name of the exposed ExtrinsicData. |
NULL
otherwise. VL_SDK_API vlImageWrapper_t* VL_CALLINGCONVENTION vlWorker_GetNodeImageSync | ( | vlWorker_t * | worker, |
const char | node[], | ||
const char | key[] | ||
) |
Returns a pointer to the image with the given name from a given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
The returned image has to be freed using vlDelete_ImageWrapper.
NOTICE: This functions is experimental and might get removed in future.
worker | Pointer to a Worker object. |
node | name of the node |
key | Name of the exposed image |
NULL
otherwise. VL_SDK_API vlIntrinsicDataWrapper_t* VL_CALLINGCONVENTION vlWorker_GetNodeIntrinsicDataSync | ( | vlWorker_t * | worker, |
const char | node[], | ||
const char | key[] | ||
) |
Returns a pointer to IntrinsicData with the given name from a given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
The returned IntrinsicData has to be freed using vlDelete_IntrinsicDataWrapper
NOTICE: This function is experimental and might get removed in future.
worker | Pointer to a Worker object. |
node | The name of the node. |
key | The name of the exposed IntrinsicData. |
NULL
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_IsRunning | ( | vlWorker_t * | worker | ) |
Returns whether the thread is currently running or not.
worker | Pointer to a Worker object. |
true
, if the thread is running; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_Lock | ( | vlWorker_t * | worker | ) |
For testing purposed. Don't use!
VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_PollEvents | ( | vlWorker_t * | worker | ) |
Calls the registered listeners for the enqueued events.
Listeners aren't called immediately from the tracking thread in order to avoid synchronisation problems. Instead this method should be called regularly from the main thread.
worker | Pointer to a Worker object. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_ProcessCallbacks | ( | vlWorker_t * | worker | ) |
Executes all enqueued callbacks.
Callbacks aren't called immediately from the tracking thread in order to avoid synchronisation problems. Instead this method should be called regularly from the main thread.
worker | Pointer to a Worker object. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_ProcessJsonAndBinaryCommandSync | ( | vlWorker_t * | worker, |
const char | jsonString[], | ||
const char | data[], | ||
unsigned int | size, | ||
vlCallbackJsonAndBinaryString | callback, | ||
void * | clientData | ||
) |
Processes the passed json command along with binary data for the visionLib.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
Currently this command is used internally and will be documented in future versions. Thus it is considered as BETA!
worker | Pointer to a Worker object. |
jsonString | Command as zero terminated JSON string. |
data | Binary data pointer. The lifetime of the memory should be maintaned until the answer has been received. (might be 0) |
size | The size of the content passed. |
callback | Callback function, which will be called synchronously |
clientData | The callback function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, if the command is supported; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_ProcessJsonCommandSync | ( | vlWorker_t * | worker, |
const char | jsonString[], | ||
vlCallbackJsonString | callback, | ||
void * | clientData | ||
) |
Processes the passed command.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
worker | Pointer to a Worker object. |
jsonString | Command as zero terminated JSON string. |
callback | Callback function, which will be called after the command was processed. |
clientData | The callback function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, if the command is supported; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_PushJsonAndBinaryCommand | ( | vlWorker_t * | worker, |
const char | jsonString[], | ||
const char | data[], | ||
unsigned int | size, | ||
vlCallbackJsonAndBinaryString | callback, | ||
void * | clientData | ||
) |
Enqueues a json command along with binary data for the visionLib.
The command gets processed asynchronously by the tracking thread and a callback will called once after the processing has finished.
Currently this command is used internally and will be documented in future versions. Thus it is considered as BETA!
worker | Pointer to a Worker object. |
jsonString | Command as zero terminated JSON string. |
data | Binary data pointer. The lifetime of the memory should be maintaned until the answer has been received. (might be 0) |
size | The size of the content passed. |
callback | Callback function, which will be called inside vlWorker_ProcessCallbacks after the command was processed. |
clientData | The callback function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, if the command was enqueue successfully; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_PushJsonCommand | ( | vlWorker_t * | worker, |
const char | jsonString[], | ||
vlCallbackJsonString | callback, | ||
void * | clientData | ||
) |
Enqueues a command for the tracking thread as zero terminated JSON string.
The command gets processed asynchronously by the tracking thread and a callback will called once after the processing has finished.
The following tracking independent commands exist:
The following commands exist for the model tracker:
worker | Pointer to a Worker object. |
jsonString | Command as zero terminated JSON string. |
callback | Callback function, which will be called inside vlWorker_ProcessCallbacks after the command was processed. |
clientData | The callback function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, if the command was enqueue successfully; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveAnchorToWorldTransformListener | ( | vlWorker_t * | worker, |
const char | anchorName[], | ||
vlCallbackExtrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Unregister a listener from anchor to world transform events (ExtrinsicData events) produced by a certain anchor.
worker | Pointer to a Worker object. |
anchorName | Name of the anchor to be addressed. |
listener | Listener function which should be unregistered. |
clientData | The listener function will be called with the given pointer value as parameter. This can be used to invoke a member function. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveDebugImageListener | ( | vlWorker_t * | worker, |
vlCallbackImageWrapper | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from debug image events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveExtrinsicDataListener | ( | vlWorker_t * | worker, |
vlCallbackExtrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from ExtrinsicData events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveImageListener | ( | vlWorker_t * | worker, |
vlCallbackImageWrapper | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from image events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveIntrinsicDataListener | ( | vlWorker_t * | worker, |
vlCallbackIntrinsicDataWrapper | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from IntrinsicData events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemovePerformanceInfoListener | ( | vlWorker_t * | worker, |
vlCallbackZString | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from performance info events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RemoveTrackingStateListener | ( | vlWorker_t * | worker, |
vlCallbackZString | listener, | ||
void * | clientData | ||
) |
Unregisters a listener from tracking state events.
worker | Pointer to a Worker object. |
listener | Listener function which should be unregistered. |
clientData | Pointer value used as parameter during the registration of the listener. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_RunOnceSync | ( | vlWorker_t * | worker | ) |
Processes the enqueued commands and the tracking once.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker). The target number of FPS will get ignored. After calling this function you should call vlWorker_ProcessEvents and vlWorker_PollEvents to invoke callbacks and registered listeners.
worker | Pointer to a Worker object. |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_SetNodeExtrinsicDataSync | ( | vlWorker_t * | worker, |
vlExtrinsicDataWrapper_t * | extrinsicData, | ||
const char | node[], | ||
const char | key[] | ||
) |
Sets the given extrinsicData in the given input of the given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
NOTICE: This function is experimental and might get removed in future.
worker | Pointer to a Worker object. |
extrinsicData | Pointer to an ExtrinsicData object. |
node | The name of the node. |
key | The name of the ExtrinsicData to set. |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_SetNodeImageSync | ( | vlWorker_t * | worker, |
vlImageWrapper_t * | image, | ||
const char | node[], | ||
const char | key[] | ||
) |
Sets the given image in the given input of the given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
NOTICE: This function is experimental and might get removed in future.
worker | Pointer to a Worker object. |
image | Pointer to an Image object |
node | name of the node |
key | Name of the image to set |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_SetNodeIntrinsicDataSync | ( | vlWorker_t * | worker, |
vlIntrinsicDataWrapper_t * | intrinsicData, | ||
const char | node[], | ||
const char | key[] | ||
) |
Sets the given IntrinsicData in the given input of the given node.
This function only works, if the Worker was created as synchronous instance (vlNew_SyncWorker).
NOTICE: This function is experimental and might get removed in future.
worker | Pointer to a Worker object. |
intrinsicData | Pointer to an IntrinsicData object |
node | The name of the node. |
key | The name of the IntrinsicData to set. |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_Start | ( | vlWorker_t * | worker | ) |
Starts the tracking thread.
worker | Pointer to a Worker object. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_Stop | ( | vlWorker_t * | worker | ) |
Stops the tracking thread.
worker | Pointer to a Worker object. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_Unlock | ( | vlWorker_t * | worker | ) |
For testing purposed. Don't use!
VL_SDK_API bool VL_CALLINGCONVENTION vlWorker_WaitEvents | ( | vlWorker_t * | worker, |
unsigned int | timeout | ||
) |
Waits for enqueued events and calls the registered listeners.
Listeners aren't called immediately from the tracking thread in order to avoid synchronisation problems. Instead this method should be called regularly from the main thread.
worker | Pointer to a Worker object. |
timeout | Number of milliseconds before stopping to wait. Under normal circumstances this shouldn't happen, but in case something went wrong, we don't want to wait indefinitely. |
true
, on success or false
, if there was an error while waiting for events. false
is also returned, if the tracking is enabled, but timeout elapsed without an event arriving.