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_getCameraTransformsFromWorkspaceDefinition (const char *workspaceJson, unsigned long *size)
 Transforms a workspace definition into a list of poses. 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 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...
 

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