documentation

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...
 

Detailed Description

Functions for general purpose and supporting your app.

Functions allowing to support your implementation with the visionlibSDK.

Function Documentation

◆ vlSDKUtil_get()

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.

Parameters
uriA zero terminated string containing the URI.
sizeA pointer to an unsigned long integer, which will be used to store the size of the retrieved file.
optionsAn optional pointer (can be NULL), which describes some options for download (not used yet).
Returns
A valid pointer to the memory which MUST be freed using vlReleaseBinaryBuffer(), on success. Returns NULL if an error occurred.

◆ vlSDKUtil_getCameraPositionsFromGeometry()

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).

Parameters
geometryJsonA zero terminated string containing the geometry definition as json.
sizeA pointer to an unsigned long integer, which will be used to store the number of retrieved positions.
Returns
A valid pointer to the memory which MUST be freed using vlReleaseBinaryBuffer(), on success. Returns NULL if an error occurred.

◆ vlSDKUtil_getCameraPositionsFromWorkspaceDefinition()

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).

Parameters
workspaceJsonA zero terminated string containing the workspace definition as json.
sizeA pointer to an unsigned long integer, which will be used to store the number of retrieved positions.
Returns
A valid pointer to the memory which MUST be freed using vlReleaseBinaryBuffer(), on success. Returns NULL if an error occurred.

◆ vlSDKUtil_getCameraTransformsFromWorkspaceDefinition()

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).

Parameters
geometryJsonA zero terminated string containing the geometry definition as json.
sizeA pointer to an unsigned long integer, which will be used to store the size of the retrieved file.
Returns
A valid pointer to the memory which MUST be freed using vlReleaseBinaryBuffer(), on success. Returns NULL if an error occurred.

◆ vlSDKUtil_getModelHash()

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.

Parameters
uriA zero terminated string containing the URI of the model.
physicalPathBuffer for storing the hash code of the model.
maxSizeThe size of the buffer.
Returns
true, on success; false otherwise.

◆ vlSDKUtil_getOriginTransformFromSimpleWorkspaceDefinition()

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.

Parameters
workspaceJsonA zero terminated string containing the simple workspace definition as json.
sizeA pointer to an unsigned long integer, which will contain 1 on success and zero otherwise.
Returns
A valid pointer to the memory containing 7 float values tx, ty, tz, rx, ry, rz, rw on success. It MUST be freed using vlReleaseBinaryBuffer(). Returns NULL if an error occurred.

◆ vlSDKUtil_getPosterQuality()

VL_SDK_API double VL_CALLINGCONVENTION vlSDKUtil_getPosterQuality ( vlImageWrapper_t imageWrapper)

Estimates the quality of a given image as a PosterTracker reference.

Parameters
imageWrapperThe image in any image format.
Returns
The quality between 0 (bad) and 1 (good).

◆ vlSDKUtil_getTempFilename()

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.

Parameters
prefNameA zero terminated string containing the preferred name, which can also be NULL.
newNameBuffer for storing the filename as zero terminated string.
maxSizeSize of the buffer.
Returns
true, on success; false, otherwise.

◆ vlSDKUtil_loadModel()

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.

Parameters
uriA zero terminated string containing the URI of the model.
jsonThe json part of the loaded model will be written to the address provided.
sizeThe size of the binary part of the loaded model will be written to the address provided.
Returns
A pointer to the binary part of the loaded model.

◆ vlSDKUtil_registerScheme()

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.

Parameters
nameA zero terminated string containing the scheme name.
uriA zero terminated string containing the scheme URI.
Returns
true, on success; false, otherwise.

◆ vlSDKUtil_retrievePhysicalPath()

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.

Parameters
uriA zero terminated string containing the URI.
physicalPathBuffer for storing the physical path.
maxSizeThe size of the buffer.
Returns
true, on success; false otherwise.

◆ vlSDKUtil_set()

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.

Parameters
uriA zero terminated string containing the URI.
dataA pointer to the data to be written.
sizeNumber of bytes to be written.
optionsAn optional pointer (can be NULL), which describes some options for download (not used yet)
Returns
true, on success; false, otherwise.

◆ vlSDKUtil_systemHasExternalSLAM()

VL_SDK_API bool VL_CALLINGCONVENTION vlSDKUtil_systemHasExternalSLAM ( )

Returns wether or not the system supports external SLAM (ARKit, ARCore, HoloLens).

Returns
True if and only if external SLAM is supported.