ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Functions
surface.c File Reference
#include <ARX/AR/ar.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ARX/AR2/coord.h>
#include <ARX/AR2/featureSet.h>
#include <ARX/AR2/template.h>
#include <ARX/AR2/tracking.h>
#include <ARX/AR2/util.h>
Include dependency graph for surface.c:

Functions

AR2SurfaceSetTar2ReadSurfaceSet (const char *filename, const char *ext, ARPattHandle *pattHandle)
 
int ar2FreeSurfaceSet (AR2SurfaceSetT **surfaceSet)
 
int ar2SetInitTrans (AR2SurfaceSetT *surfaceSet, float trans[3][4])
 

Function Documentation

◆ ar2FreeSurfaceSet()

int ar2FreeSurfaceSet ( AR2SurfaceSetT **  surfaceSet)

Finalise and dispose of an NFT texture tracking surface set. Once a surface set (read by ar2ReadSurfaceSet()) is no longer required, it should be disposed of by calling ar2FreeSurfaceSet().

Parameters
surfaceSetPointer to a location pointing to an AR2SurfaceSetT. On return, this pointer will be set to NULL.
Returns
0 if successful, -1 otherwise.
See also
ar2ReadSurfaceSet ar2ReadSurfaceSet
Here is the call graph for this function:

◆ ar2ReadSurfaceSet()

AR2SurfaceSetT * ar2ReadSurfaceSet ( const char *  filename,
const char *  ext,
ARPattHandle pattHandle 
)

Read an NFT texture tracking surface set from file. Allocates, initialises and reads the contents of a surface set from storage. The surface set is usually generated by the genTexData utility, or equivalent.

Once the surface set is no longer required, it should be disposed of by calling ar2FreeSurfaceSet().

Parameters
filenamePathname of the surface set to be loaded, less any filename extension.
extFilename extension of the surface set to be loaded. Ususally this will be "fset".
pattHandleIf the surface set includes, template markers, a valid ARPattHandle is required to be passed in this parameter. Otherwise, NULL may be passed.
Returns
A pointer to the loaded AR2SurfaceSetT, or NULL in case of error.
See also
ar2FreeSurfaceSet ar2FreeSurfaceSet
Here is the call graph for this function:

◆ ar2SetInitTrans()

int ar2SetInitTrans ( AR2SurfaceSetT surfaceSet,
float  trans[3][4] 
)

Sets initial transform for subsequent NFT texture tracking. Before the first call to ar2Tracking(), this function must be called to set the initial tracking transform. The initial transform may be obtained from NFT KPM tracking, or via a fiducial marker embedded in the NFT image. The initial transform must also be set after each loss of tracking (i.e. after each instance when ar2Tracking() does not return 0.

Parameters
surfaceSet
transPointer to a float[3][4] array from which the initial transform will be copied.
Returns
0 if successful, or -1 in case of error.
See also
ar2Tracking ar2Tracking