Functions for general purpose and supporting your app. More...
Functions | |
VL_SDK_API char *VL_CALLINGCONVENTION | vlSDKUtil_get (const char *uri, unsigned long *size, const char *options=0) |
Retrieves a file and its data from a given URI. More... | |
VL_SDK_API char *VL_CALLINGCONVENTION | vlSDKUtil_getCameraPositionsFromGeometry (const char *geometryJson, unsigned long *size) |
Transforms a workspace geometry into a list of points. More... | |
VL_SDK_API char *VL_CALLINGCONVENTION | vlSDKUtil_getCameraPositionsFromWorkspaceDefinition (const char *workspaceJson, unsigned long *size) |
Transforms a workspace definition into a list of points. More... | |
VL_SDK_API char *VL_CALLINGCONVENTION | vlSDKUtil_getCameraTransformsFromWorkspaceDefinition (const char *workspaceJson, unsigned long *size) |
Transforms a workspace definition into a list of poses. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_getModelHash (const char modelURI[], char modelHash[], unsigned int maxSize) |
Creates the model hash of the given model into a buffer. More... | |
VL_SDK_API char *VL_CALLINGCONVENTION | vlSDKUtil_getOriginTransformFromSimpleWorkspaceDefinition (const char *workspaceJson, unsigned long *size) |
Computes the origin transform of a given simple workspace definition. More... | |
VL_SDK_API double VL_CALLINGCONVENTION | vlSDKUtil_getPosterQuality (vlImageWrapper_t *imageWrapper) |
Estimates the quality of a given image as a PosterTracker reference. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_getTempFilename (const char *prefName, char *newName, unsigned int maxSize) |
Generate a temporary file URI. More... | |
VL_SDK_API const char *VL_CALLINGCONVENTION | vlSDKUtil_loadModel (const char *uri, const char **json, unsigned long *size) |
Loads the model for the given uri and returns it in a serialized form. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_registerScheme (const char *name, const char *uri) |
Creates an internal file scheme relative to the given uri. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_retrievePhysicalPath (const char uri[], char physicalPath[], unsigned int maxSize) |
Resolves the given URI. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_set (const char *uri, const void *data, unsigned long size, const char *options=0) |
Posts or writes data to given URI. More... | |
VL_SDK_API bool VL_CALLINGCONVENTION | vlSDKUtil_systemHasExternalSLAM () |
Returns wether or not the system supports external SLAM (ARKit, ARCore, HoloLens). More... | |
Functions for general purpose and supporting your app.
Functions allowing to support your implementation with the visionlibSDK.
VL_SDK_API char *VL_CALLINGCONVENTION vlSDKUtil_get | ( | const char * | uri, |
unsigned long * | size, | ||
const char * | options = 0 |
||
) |
Retrieves a file and its data from a given URI.
This function tries to retrieve a file synchronously from a given source URI. An AbstractApplication instance has to be created before calling this function. The URI can point to a file on disk (file:///path) or even to a file on a web server (http://192.0.0.1/file). VisionLib schemes (e.g. project-dir:filename) and custom schemes are also supported.
uri | A zero terminated string containing the URI. |
size | A pointer to an unsigned long integer, which will be used to store the size of the retrieved file. |
options | An optional pointer (can be NULL), which describes some options for download (not used yet). |
NULL
if an error occurred. VL_SDK_API char *VL_CALLINGCONVENTION vlSDKUtil_getCameraPositionsFromGeometry | ( | const char * | geometryJson, |
unsigned long * | size | ||
) |
Transforms a workspace geometry into a list of points.
This function parses a workspace defined in json and transforms it into an array of positions (3 float values).
geometryJson | A zero terminated string containing the geometry definition as json. |
size | A pointer to an unsigned long integer, which will be used to store the number of retrieved positions. |
NULL
if an error occurred. VL_SDK_API char *VL_CALLINGCONVENTION vlSDKUtil_getCameraPositionsFromWorkspaceDefinition | ( | const char * | workspaceJson, |
unsigned long * | size | ||
) |
Transforms a workspace definition into a list of points.
This function parses a workspace defined in json and transforms it into an array of positions (3 float values).
workspaceJson | A zero terminated string containing the workspace definition as json. |
size | A pointer to an unsigned long integer, which will be used to store the number of retrieved positions. |
NULL
if an error occurred. VL_SDK_API char *VL_CALLINGCONVENTION vlSDKUtil_getCameraTransformsFromWorkspaceDefinition | ( | const char * | workspaceJson, |
unsigned long * | size | ||
) |
Transforms a workspace definition into a list of poses.
This function parses a workspace defined in json and transforms it into an array of camera transformations (7 float values tx, ty, tz, rx, ry, rz, rw).
geometryJson | A zero terminated string containing the geometry definition as json. |
size | A pointer to an unsigned long integer, which will be used to store the size of the retrieved file. |
NULL
if an error occurred. VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_getModelHash | ( | const char | modelURI[], |
char | modelHash[], | ||
unsigned int | maxSize | ||
) |
Creates the model hash of the given model into a buffer.
uri | A zero terminated string containing the URI of the model. |
physicalPath | Buffer for storing the hash code of the model. |
maxSize | The size of the buffer. |
true
, on success; false
otherwise. VL_SDK_API char *VL_CALLINGCONVENTION vlSDKUtil_getOriginTransformFromSimpleWorkspaceDefinition | ( | const char * | workspaceJson, |
unsigned long * | size | ||
) |
Computes the origin transform of a given simple workspace definition.
This function parses a workspace defined in json and computes the transform that will be applied to the origin of the simple workspace.
workspaceJson | A zero terminated string containing the simple workspace definition as json. |
size | A pointer to an unsigned long integer, which will contain 1 on success and zero otherwise. |
NULL
if an error occurred. VL_SDK_API double VL_CALLINGCONVENTION vlSDKUtil_getPosterQuality | ( | vlImageWrapper_t * | imageWrapper | ) |
Estimates the quality of a given image as a PosterTracker reference.
imageWrapper | The image in any image format. |
VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_getTempFilename | ( | const char * | prefName, |
char * | newName, | ||
unsigned int | maxSize | ||
) |
Generate a temporary file URI.
This function creates a filename that can be written to on the local file system of the device. A hint can be given, which will get incorporated into the filename.
prefName | A zero terminated string containing the preferred name, which can also be NULL. |
newName | Buffer for storing the filename as zero terminated string. |
maxSize | Size of the buffer. |
true
, on success; false
, otherwise. VL_SDK_API const char *VL_CALLINGCONVENTION vlSDKUtil_loadModel | ( | const char * | uri, |
const char ** | json, | ||
unsigned long * | size | ||
) |
Loads the model for the given uri and returns it in a serialized form.
Both the binary part and the json part have to be released by the client using vlReleaseBinaryBuffer.
uri | A zero terminated string containing the URI of the model. |
json | The json part of the loaded model will be written to the address provided. |
size | The size of the binary part of the loaded model will be written to the address provided. |
VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_registerScheme | ( | const char * | name, |
const char * | uri | ||
) |
Creates an internal file scheme relative to the given uri.
This function tries to create a new scheme relative to a given URI with the given name. The URI can be an absolute path or contain another scheme (e.g. http://192.0.0.1/some/sub/directory). If a scheme with this name already exists, this command will overwrite the old scheme.
name | A zero terminated string containing the scheme name. |
uri | A zero terminated string containing the scheme URI. |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_retrievePhysicalPath | ( | const char | uri[], |
char | physicalPath[], | ||
unsigned int | maxSize | ||
) |
Resolves the given URI.
This function tries to resolve the given URI. The URI can point to a file on disk (file:///path) or even to a file on a web server (http://192.0.0.1/file). VisionLib schemes and custom schemes are also supported. The result is the physical path of the given URI and will be written into the provided buffer, if it is large enough.
uri | A zero terminated string containing the URI. |
physicalPath | Buffer for storing the physical path. |
maxSize | The size of the buffer. |
true
, on success; false
otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_set | ( | const char * | uri, |
const void * | data, | ||
unsigned long | size, | ||
const char * | options = 0 |
||
) |
Posts or writes data to given URI.
This function tries to write a file synchronously to a given URI. An AbstractApplication instance has to be created before calling this function. The URI can point to a file on disk (file:///path) or even to a file on a web server (http://192.0.0.1/file). VisionLib schemes (e.g. data_dir:filename) and custom schemes are also supported.
uri | A zero terminated string containing the URI. |
data | A pointer to the data to be written. |
size | Number of bytes to be written. |
options | An optional pointer (can be NULL), which describes some options for download (not used yet) |
true
, on success; false
, otherwise. VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_systemHasExternalSLAM | ( | ) |
Returns wether or not the system supports external SLAM (ARKit, ARCore, HoloLens).