ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
ARX_c.h File Reference
#include <ARX/Platform.h>
#include <ARX/Error.h>
#include <stdint.h>
Include dependency graph for ARX_c.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ARWTrackableStatus
 

Enumerations

enum  { ARW_H_ALIGN_LEFT , ARW_H_ALIGN_CENTRE , ARW_H_ALIGN_RIGHT }
 Specifies desired horizontal alignment of video frames in drawing graphics context. More...
 
enum  { ARW_V_ALIGN_TOP , ARW_V_ALIGN_CENTRE , ARW_V_ALIGN_BOTTOM }
 Specifies desired vertical alignment of video frames in drawing graphics context. More...
 
enum  { ARW_SCALE_MODE_FIT , ARW_SCALE_MODE_FILL , ARW_SCALE_MODE_STRETCH , ARW_SCALE_MODE_1_TO_1 }
 Specifies desired scaling of video frames to drawing graphics context. More...
 
enum  {
  ARW_TRACKER_OPTION_NFT_MULTIMODE = 0 , ARW_TRACKER_OPTION_SQUARE_THRESHOLD = 1 , ARW_TRACKER_OPTION_SQUARE_THRESHOLD_MODE = 2 , ARW_TRACKER_OPTION_SQUARE_LABELING_MODE = 3 ,
  ARW_TRACKER_OPTION_SQUARE_PATTERN_DETECTION_MODE = 4 , ARW_TRACKER_OPTION_SQUARE_BORDER_SIZE = 5 , ARW_TRACKER_OPTION_SQUARE_MATRIX_CODE_TYPE = 6 , ARW_TRACKER_OPTION_SQUARE_IMAGE_PROC_MODE = 7 ,
  ARW_TRACKER_OPTION_SQUARE_DEBUG_MODE = 8 , ARW_TRACKER_OPTION_SQUARE_PATTERN_SIZE = 9 , ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX = 10 , ARW_TRACKER_OPTION_2D_TRACKER_FEATURE_TYPE = 11
}
 Constants for use with tracker option setters/getters. More...
 
enum  {
  ARW_TRACKABLE_OPTION_FILTERED = 1 , ARW_TRACKABLE_OPTION_FILTER_SAMPLE_RATE = 2 , ARW_TRACKABLE_OPTION_FILTER_CUTOFF_FREQ = 3 , ARW_TRACKABLE_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION = 4 ,
  ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE = 5 , ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE_CUTOFF = 6 , ARW_TRACKABLE_OPTION_NFT_SCALE = 7 , ARW_TRACKABLE_OPTION_MULTI_MIN_SUBMARKERS = 8 ,
  ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_MATRIX = 9 , ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_PATTERN = 10 , ARW_TRACKABLE_OPTION_MULTI_MIN_INLIER_PROB = 11
}
 Constants for use with trackable option setters/getters. More...
 

Functions

ARX_EXTERN void arwRegisterLogCallback (PFN_LOGCALLBACK callback)
 Registers a callback function to use when a message is logged. More...
 
ARX_EXTERN void arwSetLogLevel (const int logLevel)
 
ARX_EXTERN bool arwInitialiseAR ()
 Initialises the artoolkitX. More...
 
ARX_EXTERN bool arwGetARToolKitVersion (char *buffer, int length)
 Gets the artoolkitX version as a string, such as "10.0.0". More...
 
ARX_EXTERN int arwGetError ()
 Return error information Returns the value of the error flag. More...
 
ARX_EXTERN bool arwChangeToResourcesDir (const char *resourcesDirectoryPath)
 Changes the working directory to the resources directory used by artoolkitX. More...
 
ARX_EXTERN bool arwStartRunning (const char *vconf, const char *cparaName)
 Initialises and starts video capture. More...
 
ARX_EXTERN bool arwStartRunningB (const char *vconf, const char *cparaBuff, const int cparaBuffLen)
 Initialises and starts video capture. More...
 
ARX_EXTERN bool arwStartRunningStereo (const char *vconfL, const char *cparaNameL, const char *vconfR, const char *cparaNameR, const char *transL2RName)
 
ARX_EXTERN bool arwStartRunningStereoB (const char *vconfL, const char *cparaBuffL, const int cparaBuffLenL, const char *vconfR, const char *cparaBuffR, int cparaBuffLenR, const char *transL2RBuff, const int transL2RBuffLen)
 
ARX_EXTERN bool arwIsRunning ()
 Returns true if artoolkitX is running, i.e. More...
 
ARX_EXTERN bool arwIsInited ()
 Returns true if artoolkitX is initialized and read for adding trackables. More...
 
ARX_EXTERN bool arwStopRunning ()
 Stops video capture and frees video capture resources. More...
 
ARX_EXTERN bool arwShutdownAR ()
 Shuts down the artoolkitX and frees all resources. More...
 
ARX_EXTERN bool arwGetProjectionMatrix (const float nearPlane, const float farPlane, float p[16])
 Populates the given float array with the projection matrix computed from camera parameters for the video source. More...
 
ARX_EXTERN bool arwGetProjectionMatrixStereo (const float nearPlane, const float farPlane, float pL[16], float pR[16])
 Populates the given float arrays with the projection matrices computed from camera parameters for each of the stereo video sources. More...
 
ARX_EXTERN bool arwGetVideoParams (int *width, int *height, int *pixelSize, char *pixelFormatStringBuffer, int pixelFormatStringBufferLen)
 Returns the parameters of the video source frame. More...
 
ARX_EXTERN bool arwGetVideoParamsStereo (int *widthL, int *heightL, int *pixelSizeL, char *pixelFormatStringBufferL, int pixelFormatStringBufferLenL, int *widthR, int *heightR, int *pixelSizeR, char *pixelFormatStringBufferR, int pixelFormatStringBufferLenR)
 Returns the parameters of the video source frames. More...
 
ARX_EXTERN bool arwCapture ()
 Captures a newest frame from the video source. More...
 
ARX_EXTERN bool arwUpdateAR ()
 Performs tracking and trackable updates. More...
 
ARX_EXTERN bool arwUpdateTexture32 (uint32_t *buffer)
 Asks the video source to push the most recent frame into the passed-in buffer. More...
 
ARX_EXTERN bool arwUpdateTexture32Stereo (uint32_t *bufferL, uint32_t *bufferR)
 Asks the video source to push the most recent stereo frame into the passed-in buffer. More...
 
ARX_EXTERN bool arwDrawVideoInit (const int videoSourceIndex)
 Initialise drawing of video frames in a graphics context. More...
 
ARX_EXTERN bool arwDrawVideoSettings (int videoSourceIndex, int width, int height, bool rotate90, bool flipH, bool flipV, int hAlign, int vAlign, int scalingMode, int32_t viewport[4])
 Specify the layout of the graphics context in which drawing of video frames will occur. More...
 
ARX_EXTERN bool arwDrawVideo (const int videoSourceIndex)
 Draws the latest frame from the video source in the active graphics context. More...
 
ARX_EXTERN bool arwDrawVideoFinal (const int videoSourceIndex)
 Finalise drawing of video frames in a graphics context. More...
 
ARX_EXTERN void arwSetTrackerOptionBool (int option, bool value)
 Set boolean options associated with a tracker. More...
 
ARX_EXTERN void arwSetTrackerOptionInt (int option, int value)
 Set integer options associated with a tracker. More...
 
ARX_EXTERN void arwSetTrackerOptionFloat (int option, float value)
 Set floating-point options associated with a tracker. More...
 
ARX_EXTERN bool arwGetTrackerOptionBool (int option)
 Get boolean options associated with a tracker. More...
 
ARX_EXTERN int arwGetTrackerOptionInt (int option)
 Get integer options associated with a tracker. More...
 
ARX_EXTERN float arwGetTrackerOptionFloat (int option)
 Get floating-point options associated with a tracker. More...
 
ARX_EXTERN int arwAddTrackable (const char *cfg)
 Adds a trackable as specified in the given configuration string. More...
 
ARX_EXTERN bool arwGetTrackables (int *count_p, ARWTrackableStatus **statuses_p)
 Gets all current trackables and their status. More...
 
ARX_EXTERN bool arwRemoveTrackable (int trackableUID)
 Removes the trackable with the given unique identifier (UID). More...
 
ARX_EXTERN int arwRemoveAllTrackables ()
 Clears the collection of trackables. More...
 
ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformation (int trackableUID, float matrix[16])
 Returns the visibility and pose of the specified trackable. More...
 
ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformationStereo (int trackableUID, float matrixL[16], float matrixR[16])
 Returns the visibility and stereo pose of the specified trackable. More...
 
ARX_EXTERN int arwGetTrackablePatternCount (int trackableUID)
 Returns the number of pattern images associated with the specified trackable. More...
 
ARX_EXTERN bool arwGetTrackablePatternConfig (int trackableUID, int patternID, float matrix[16], float *width, float *height, int *imageSizeX, int *imageSizeY)
 Gets configuration of a pattern associated with a trackable. More...
 
ARX_EXTERN bool arwGetTrackablePatternImage (int trackableUID, int patternID, uint32_t *buffer)
 Gets a pattern image associated with a trackable. More...
 
ARX_EXTERN void arwSetTrackableOptionBool (int trackableUID, int option, bool value)
 Set boolean options associated with a trackable. More...
 
ARX_EXTERN void arwSetTrackableOptionInt (int trackableUID, int option, int value)
 Set integer options associated with a trackable. More...
 
ARX_EXTERN void arwSetTrackableOptionFloat (int trackableUID, int option, float value)
 Set floating-point options associated with a trackable. More...
 
ARX_EXTERN bool arwGetTrackableOptionBool (int trackableUID, int option)
 Get boolean options associated with a trackable. More...
 
ARX_EXTERN int arwGetTrackableOptionInt (int trackableUID, int option)
 Get integer options associated with a trackable. More...
 
ARX_EXTERN float arwGetTrackableOptionFloat (int trackableUID, int option)
 Get floating-point options associated with a trackable. More...
 
ARX_EXTERN bool arwLoadOpticalParams (const char *optical_param_name, const char *optical_param_buff, const int optical_param_buffLen, const float projectionNearPlane, const float projectionFarPlane, float *fovy_p, float *aspect_p, float m[16], float p[16])
 Loads an optical parameters structure from file or from buffer. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Specifies desired horizontal alignment of video frames in drawing graphics context.

Enumerator
ARW_H_ALIGN_LEFT 

Align the left edge of the video frame with the left edge of the context.

ARW_H_ALIGN_CENTRE 

Align the centre of the video frame with the centre of the context.

ARW_H_ALIGN_RIGHT 

Align the right edge of the video frame with the right edge of the context.

◆ anonymous enum

anonymous enum

Specifies desired vertical alignment of video frames in drawing graphics context.

Enumerator
ARW_V_ALIGN_TOP 

Align the top edge of the video frame with the top edge of the context.

ARW_V_ALIGN_CENTRE 

Align the centre of the video frame with the centre of the context.

ARW_V_ALIGN_BOTTOM 

Align the bottom edge of the video frame with the bottom edge of the context.

◆ anonymous enum

anonymous enum

Specifies desired scaling of video frames to drawing graphics context.

Enumerator
ARW_SCALE_MODE_FIT 

Scale the video frame proportionally up or down so that it fits visible in its entirety in the graphics context. When the graphics context is wider than the frame, it will be pillarboxed. When the graphics context is taller than the frame, it will be letterboxed.

ARW_SCALE_MODE_FILL 

Scale the video frame proportionally up or down so that it fills the entire in the graphics context. When the graphics context is wider than the frame, the frame will be cropped top and/or bottom. When the graphics context is taller than the frame, the frame will be cropped left and/or right.

ARW_SCALE_MODE_STRETCH 

Scale the video frame non-proportionally up or down so that it matches exactly the size of the graphics context. If the frame and the context have different aspect ratios, the frame will appear stretched or squashed.

ARW_SCALE_MODE_1_TO_1 

Do not scale the video frame. One pixel of the video frame will be represented by one pixel of the graphics context.

◆ anonymous enum

anonymous enum

Constants for use with tracker option setters/getters.

Enumerator
ARW_TRACKER_OPTION_NFT_MULTIMODE 

int.

ARW_TRACKER_OPTION_SQUARE_THRESHOLD 

Threshold value used for image binarization. int in range [0-255].

ARW_TRACKER_OPTION_SQUARE_THRESHOLD_MODE 

Threshold mode used for image binarization. int.

ARW_TRACKER_OPTION_SQUARE_LABELING_MODE 

int.

ARW_TRACKER_OPTION_SQUARE_PATTERN_DETECTION_MODE 

int.

ARW_TRACKER_OPTION_SQUARE_BORDER_SIZE 

float in range (0-0.5).

ARW_TRACKER_OPTION_SQUARE_MATRIX_CODE_TYPE 

int.

ARW_TRACKER_OPTION_SQUARE_IMAGE_PROC_MODE 

int.

ARW_TRACKER_OPTION_SQUARE_DEBUG_MODE 

Enables or disable state of debug mode in the tracker. When enabled, a black and white debug image is generated during marker detection. The debug image is useful for visualising the binarization process and choosing a threshold value. bool.

ARW_TRACKER_OPTION_SQUARE_PATTERN_SIZE 

Number of rows and columns in square template (pattern) markers. Defaults to AR_PATT_SIZE1, which is 16 in all versions of ARToolKit prior to 5.3. int.

ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX 

Maximum number of square template (pattern) markers that may be loaded at once. Defaults to AR_PATT_NUM_MAX, which is at least 25 in all versions of ARToolKit prior to 5.3. int.

ARW_TRACKER_OPTION_2D_TRACKER_FEATURE_TYPE 

Feature detector type used in the 2d Tracker - 0 AKAZE, 1 ORB, 2 BRISK, 3 KAZE.

◆ anonymous enum

anonymous enum

Constants for use with trackable option setters/getters.

Enumerator
ARW_TRACKABLE_OPTION_FILTERED 

bool, true for filtering enabled.

ARW_TRACKABLE_OPTION_FILTER_SAMPLE_RATE 

float, sample rate for filter calculations.

ARW_TRACKABLE_OPTION_FILTER_CUTOFF_FREQ 

float, cutoff frequency of filter.

ARW_TRACKABLE_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION 

bool, true to use continuous pose estimate.

ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE 

float, confidence value of most recent marker match

ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE_CUTOFF 

float, minimum allowable confidence value used in marker matching.

ARW_TRACKABLE_OPTION_NFT_SCALE 

float, scale factor applied to NFT marker size.

ARW_TRACKABLE_OPTION_MULTI_MIN_SUBMARKERS 

int, minimum number of submarkers for tracking to be valid.

ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_MATRIX 

float, minimum confidence value for submarker matrix tracking to be valid.

ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_PATTERN 

float, minimum confidence value for submarker pattern tracking to be valid.

ARW_TRACKABLE_OPTION_MULTI_MIN_INLIER_PROB 

float, minimum inlier probability value for robust multimarker pose estimation (range 1.0 - 0.0).

Function Documentation

◆ arwAddTrackable()

ARX_EXTERN int arwAddTrackable ( const char *  cfg)

Adds a trackable as specified in the given configuration string.

The format of the string can be one of:

  • Square marker from pattern file: "single;pattern_file;pattern_width", e.g. "single;data/hiro.patt;80"
  • Square marker from pattern passed in config: "single_buffer;pattern_width;buffer=[]", e.g. "single_buffer;80;buffer=234 221 237..."
  • Square barcode marker: "single_barcode;barcode_id;pattern_width", e.g. "single_barcode;0;80"
  • Multi-square marker: "multi;config_file", e.g. "multi;data/multi/marker.dat"
  • Multi-square auto marker: "multi;origin_barcode_id;pattern_width", e.g. "multi;0;80.0"
  • NFT marker: "nft;nft_dataset_pathname", e.g. "nft;gibraltar"
    Parameters
    cfgThe configuration string
    Returns
    The unique identifier (UID) of the trackable instantiated based on the configuration string, or -1 if an error occurred

◆ arwCapture()

ARX_EXTERN bool arwCapture ( )

Captures a newest frame from the video source.

Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwChangeToResourcesDir()

ARX_EXTERN bool arwChangeToResourcesDir ( const char *  resourcesDirectoryPath)

Changes the working directory to the resources directory used by artoolkitX.

Normally, this would be called immediately after arwInitialiseAR()

Returns
true if successful, false if an error occurred
See also
arwInitialiseAR()
Here is the call graph for this function:

◆ arwDrawVideo()

ARX_EXTERN bool arwDrawVideo ( const int  videoSourceIndex)

Draws the latest frame from the video source in the active graphics context.

This function performs actual drawing of the latest video frame.

This function must only be called with a graphics context active (typically from the rendering thread) and only while arwIsRunning is true and only between calls to arwDrawVideoInit and arwDrawVideoFinal, and after at least one call to arwDrawVideoSettings.

Parameters
videoSourceIndexThe 0-based index of the video source which is supplying frames for drawing.
Returns
true if successful, false if an error occurred.
See also
arwIsRunning
arwDrawVideoInit
arwDrawVideoFinal
arwDrawVideoSettings
Here is the call graph for this function:

◆ arwDrawVideoFinal()

ARX_EXTERN bool arwDrawVideoFinal ( const int  videoSourceIndex)

Finalise drawing of video frames in a graphics context.

When drawing of video frames is no longer required, this function must be called to clean up structures allocated by the call to arwDrawVideoInit.

This function must only be called with a graphics context active (typically from the rendering thread).

Parameters
videoSourceIndexThe 0-based index of the video source which supplied frames for drawing.
Returns
true if successful, false if an error occurred.
See also
arwDrawVideoInit
Here is the call graph for this function:

◆ arwDrawVideoInit()

ARX_EXTERN bool arwDrawVideoInit ( const int  videoSourceIndex)

Initialise drawing of video frames in a graphics context.

If drawing of video frames into a graphics context is desired, this function must be called from the rendering thread to initialise graphics library structures for future drawing of video frames.

This function must be called only with a valid graphics context active (typically from the rendering thread) and only when the function arwIsRunning() returns true.

When drawing of video frames is no longer required, the function arwDrawVideoFinal must be called to clean up structures allocated by this call.

Parameters
videoSourceIndexThe 0-based index of the video source which will supply frames for drawing. Normally 0, but for the second camera in a stereo pair, 1.
Returns
true if successful, false if an error occurred.
See also
arwIsRunning
arwDrawVideoFinal
Here is the call graph for this function:

◆ arwDrawVideoSettings()

ARX_EXTERN bool arwDrawVideoSettings ( int  videoSourceIndex,
int  width,
int  height,
bool  rotate90,
bool  flipH,
bool  flipV,
int  hAlign,
int  vAlign,
int  scalingMode,
int32_t  viewport[4] 
)

Specify the layout of the graphics context in which drawing of video frames will occur.

As the layout of the graphics context (e.g. size, orientation) may differ widely from the format of the video frames which are to be drawn, this function specifies the layout of the graphics context and the desired scaling and positioning of the video frames within this context. Optionally, a calculated OpenGL-style viewport can be returned to the caller.

This function must only be called with a graphics context active (i.e. typically called only from a rendering thread) and only while arwIsRunning is true and only between calls to arwDrawVideoInit and arwDrawVideoFinal.

Parameters
videoSourceIndexThe 0-based index of the video source which is supplying frames for drawing. Normally 0, but for the second camera in a stereo pair, 1.
widthThe width in pixels of the graphics context.
heightThe height in pixels of the graphics context.
rotate90If true, content should be rendered in the graphics context rotated 90-degrees.
flipHIf true, content should be rendered in the graphics context mirrored (flipped) in the horizontal dimension.
flipVIf true, content should be rendered in the graphics context mirrored (flipped) in the vertical dimension.
hAlignAn enum ARW_H_ALIGN_* specifying the desired horizontal alignment of video frames in the graphics context. If unsure, pass ARW_H_ALIGN_CENTRE.
vAlignAn enum ARW_V_ALIGN_* specifying the desired vertical alignment of video frames in the graphics context. If unsure, pass ARW_V_ALIGN_CENTRE.
scalingModeAn enum ARW_SCALE_MODE_* specifying the desired scaling of the video frames to the graphics context. If unsure, pass ARW_SCALE_MODE_FIT.
viewportIf non-null, must be an array of 4 32-bit signed integers, in which the calculated OpenGL-style viewport parameters will be returned. The order of the parameters is: x-coordinate of the left edge of the viewport (may be negative), the y-coordinate of the bottom edge of the viewport (may be negative), the width of the viewport in the x-axis in pixels, and the height of the viewport in the y-axis in pixels.
Returns
true if successful, false if an error occurred.
See also
arwIsRunning
arwDrawVideoInit
arwDrawVideoFinal
Here is the call graph for this function:

◆ arwGetARToolKitVersion()

ARX_EXTERN bool arwGetARToolKitVersion ( char *  buffer,
int  length 
)

Gets the artoolkitX version as a string, such as "10.0.0".

Must not be called prior to arwInitialiseAR().

Parameters
bufferThe character buffer to populate
lengthThe maximum number of characters to set in buffer
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwGetError()

ARX_EXTERN int arwGetError ( )

Return error information Returns the value of the error flag.

Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until arwGetError is called, the error code is returned, and the flag is reset to AR_ERROR_NONE. If a call to arwGetError returns AR_ERROR_NONE, there has been no detectable error since the last call to arwGetError, or since the the library was initialized.

To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to AR_ERROR_NONE when arwGetError is called. If more than one flag has recorded an error, arwGetError returns and clears an arbitrary error flag value. Thus, arwGetError should always be called in a loop, until it returns AR_ERROR_NONE, if all error flags are to be reset.

Initially, all error flags are set to AR_ERROR_NONE.

Returns
enum with error code.
Here is the call graph for this function:

◆ arwGetProjectionMatrix()

ARX_EXTERN bool arwGetProjectionMatrix ( const float  nearPlane,
const float  farPlane,
float  p[16] 
)

Populates the given float array with the projection matrix computed from camera parameters for the video source.

Parameters
nearPlaneNear plane distance for projection matrix calculation.
farPlaneFar plane distance for projection matrix calculation.
pFloat array to populate with OpenGL compatible projection matrix.
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwGetProjectionMatrixStereo()

ARX_EXTERN bool arwGetProjectionMatrixStereo ( const float  nearPlane,
const float  farPlane,
float  pL[16],
float  pR[16] 
)

Populates the given float arrays with the projection matrices computed from camera parameters for each of the stereo video sources.

Parameters
nearPlaneNear plane distance for projection matrix calculation.
farPlaneFar plane distance for projection matrix calculation.
pLFloat array to populate with OpenGL compatible projection matrix for the left camera of the stereo video pair.
pRFloat array to populate with OpenGL compatible projection matrix for the right camera of the stereo video pair.
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwGetTrackableOptionBool()

ARX_EXTERN bool arwGetTrackableOptionBool ( int  trackableUID,
int  option 
)

Get boolean options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to get.
Returns
true if option is set, false if option is not set or an error occurred.
Here is the call graph for this function:

◆ arwGetTrackableOptionFloat()

ARX_EXTERN float arwGetTrackableOptionFloat ( int  trackableUID,
int  option 
)

Get floating-point options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to get.
Returns
floating-point value of option, or NAN if an error occurred.
Here is the call graph for this function:

◆ arwGetTrackableOptionInt()

ARX_EXTERN int arwGetTrackableOptionInt ( int  trackableUID,
int  option 
)

Get integer options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to get.
Returns
integer value of option, or INT_MIN if an error occurred.
Here is the call graph for this function:

◆ arwGetTrackablePatternConfig()

ARX_EXTERN bool arwGetTrackablePatternConfig ( int  trackableUID,
int  patternID,
float  matrix[16],
float *  width,
float *  height,
int *  imageSizeX,
int *  imageSizeY 
)

Gets configuration of a pattern associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
patternIDThe id of the pattern within the trackable, in range from 0 to arwGetTrackablePatternCount() - 1, inclusive. Ignored for single square markers and NFT markers (i.e. 0 assumed).
matrixThe float array to populate with the 4x4 transformation matrix of the pattern (column-major order).
widthFloat value to set to the width of the pattern
heightFloat value to set to the height of the pattern.
imageSizeXInt value to set to the width of the pattern image (in pixels).
imageSizeYInt value to set to the height of the pattern image (in pixels).
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwGetTrackablePatternCount()

ARX_EXTERN int arwGetTrackablePatternCount ( int  trackableUID)

Returns the number of pattern images associated with the specified trackable.

A single square marker trackable has one pattern image. A multi-square marker trackable has one or more pattern images. Images of NFT marker trackables are not currently supported, so at present this function will return 0 for NFT trackables.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
Returns
The number of pattern images.
Here is the call graph for this function:

◆ arwGetTrackablePatternImage()

ARX_EXTERN bool arwGetTrackablePatternImage ( int  trackableUID,
int  patternID,
uint32_t *  buffer 
)

Gets a pattern image associated with a trackable.

The provided color buffer is populated with the image of the pattern for the specified trackable. If the trackable is a multi-square marker, then the pattern image specified by patternID is used. Images of NFT marker trackables are not currently supported, so at present this function will return no image for NFT trackables.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
patternIDThe id for the pattern within that trackable. Ignored for single square marker and NFT marker trackables.
bufferPointer to a buffer of pixels (of type 'uint32_t') to be filled with pattern image. It is the caller's responsibility to ensure that the buffer is of sufficient size. Use arwGetTrackablePatternConfig to get the required size of this array (imageSizeX * imageSizeY elements). The pixels are RGBA in little-endian systems, or ABGR in big-endian systems.
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwGetTrackables()

ARX_EXTERN bool arwGetTrackables ( int *  count_p,
ARWTrackableStatus **  statuses_p 
)

Gets all current trackables and their status.

Parameters
count_pPointer to a location which will be filled with the number of trackable statuses in the array pointed to by statuses_p.
statuses_pPointer to a location which will be filled with a pointer to the first element of an array of trackable statuses, or NULL if the current status is not required. This array is allocated internally and must be deallocated (by calling free() on the pointer) when the caller has finished using the array.
Returns
true if the function proceeded without error, false if an error occurred
Here is the call graph for this function:

◆ arwGetTrackerOptionBool()

ARX_EXTERN bool arwGetTrackerOptionBool ( int  option)

Get boolean options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to get.
Returns
true if option is set, false if option is not set or an error occurred.
Here is the call graph for this function:

◆ arwGetTrackerOptionFloat()

ARX_EXTERN float arwGetTrackerOptionFloat ( int  option)

Get floating-point options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to get.
Returns
floating-point value of option, or NAN if an error occurred.
Here is the call graph for this function:

◆ arwGetTrackerOptionInt()

ARX_EXTERN int arwGetTrackerOptionInt ( int  option)

Get integer options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to get.
Returns
integer value of option, or INT_MAX if an error occurred.
Here is the call graph for this function:

◆ arwGetVideoParams()

ARX_EXTERN bool arwGetVideoParams ( int *  width,
int *  height,
int *  pixelSize,
char *  pixelFormatStringBuffer,
int  pixelFormatStringBufferLen 
)

Returns the parameters of the video source frame.

Parameters
widthPointer to an int which will be filled with the width (in pixels) of the video frame, or NULL if this information is not required.
heightPointer to an int which will be filled with the height (in pixels) of the video frame, or NULL if this information is not required.
pixelSizePointer to an int which will be filled with the numbers of bytes per pixel of the source frame.
pixelFormatStringBufferPointer to a buffer which will be filled with the symolic name of the pixel format (as a nul-terminated C-string) of the video frame, or NULL if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".
pixelFormatStringBufferLenLength (in bytes) of pixelFormatStringBuffer, or 0 if this information is not required.
Returns
True if the values were returned OK, false if there is currently no video source or an error int[] .
See also
arwGetVideoParamsStereo
Here is the call graph for this function:

◆ arwGetVideoParamsStereo()

ARX_EXTERN bool arwGetVideoParamsStereo ( int *  widthL,
int *  heightL,
int *  pixelSizeL,
char *  pixelFormatStringBufferL,
int  pixelFormatStringBufferLenL,
int *  widthR,
int *  heightR,
int *  pixelSizeR,
char *  pixelFormatStringBufferR,
int  pixelFormatStringBufferLenR 
)

Returns the parameters of the video source frames.

Parameters
widthLPointer to an int which will be filled with the width (in pixels) of the video frame, or NULL if this information is not required.
widthRPointer to an int which will be filled with the width (in pixels) of the video frame, or NULL if this information is not required.
heightLPointer to an int which will be filled with the height (in pixels) of the video frame, or NULL if this information is not required.
heightRPointer to an int which will be filled with the height (in pixels) of the video frame, or NULL if this information is not required.
pixelSizeLPointer to an int which will be filled with the numbers of bytes per pixel of the source frame, or NULL if this information is not required.
pixelSizeRPointer to an int which will be filled with the numbers of bytes per pixel of the source frame, or NULL if this information is not required.
pixelFormatStringBufferLPointer to a buffer which will be filled with the symbolic name of the pixel format (as a nul-terminated C-string) of the video frame, or NULL if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".
pixelFormatStringBufferRPointer to a buffer which will be filled with the symbolic name of the pixel format (as a nul-terminated C-string) of the video frame, or NULL if this information is not required. The name will be of the form "AR_PIXEL_FORMAT_xxx".
pixelFormatStringBufferLenLLength (in bytes) of pixelFormatStringBufferL, or 0 if this information is not required.
pixelFormatStringBufferLenRLength (in bytes) of pixelFormatStringBufferR, or 0 if this information is not required.
Returns
True if the values were returned OK, false if there is currently no stereo video source or an error int[] .
See also
arwGetVideoParams
Here is the call graph for this function:

◆ arwInitialiseAR()

ARX_EXTERN bool arwInitialiseAR ( )

Initialises the artoolkitX.

For any square template (pattern) marker trackables, the number of rows and columns in the template defaults to AR_PATT_SIZE1 and the maximum number of markers that may be loaded for a single matching pass defaults to AR_PATT_NUM_MAX.

Returns
true if successful, false if an error occurred
See also
arwShutdownAR()
Here is the call graph for this function:

◆ arwIsInited()

ARX_EXTERN bool arwIsInited ( )

Returns true if artoolkitX is initialized and read for adding trackables.

Returns
true when running, otherwise false
Here is the call graph for this function:

◆ arwIsRunning()

ARX_EXTERN bool arwIsRunning ( )

Returns true if artoolkitX is running, i.e.

detecting trackables.

Returns
true when running, otherwise false
Here is the call graph for this function:

◆ arwLoadOpticalParams()

ARX_EXTERN bool arwLoadOpticalParams ( const char *  optical_param_name,
const char *  optical_param_buff,
const int  optical_param_buffLen,
const float  projectionNearPlane,
const float  projectionFarPlane,
float *  fovy_p,
float *  aspect_p,
float  m[16],
float  p[16] 
)

Loads an optical parameters structure from file or from buffer.

Parameters
optical_param_nameIf supplied, points to a buffer specifying the path to the optical parameters file (as generated by the calib_optical utility.)
optical_param_buffIf optical_param_name is NULL, the contents of this buffer will be interpreted as containing the contents of an optical parameters file.
optical_param_buffLenLength of the buffer specified in optical_param_buff. Ignored if optical_param_buff is NULL.
projectionNearPlaneIf p is non-NULL, near plane distance for projection matrix calculation.
projectionFarPlaneIf p is non-NULL, far plane distance for projection matrix calculation.
fovy_pPointer to a float, which will be filled with the field-of-view (Y axis) component of the optical parameters, in degrees.
aspect_pPointer to a float, which will be filled with the aspect ratio (width / height) component of the optical parameters.
mPointer to an array of 16 floats, which will be filled with the transformation matrix component of the optical parameters.
p(Optional) May be NULL, or a pointer to an array of 16 floats, which will be filled with the perspective matrix calculated from fovy and aspect combined with the near and far projection values supplied in projectionNearPlane and projectionFarPlane.
Here is the call graph for this function:

◆ arwQueryTrackableVisibilityAndTransformation()

ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformation ( int  trackableUID,
float  matrix[16] 
)

Returns the visibility and pose of the specified trackable.

After a call to arwUpdate, all trackable information will be current. Any trackable can then be checked for visibility in the current frame, and if visible, additionally queried for its pose.

Parameters
trackableUIDThe unique identifier (UID) of the trackable to query.
matrixA float array to populate with an OpenGL-compatible transformation matrix.
Returns
true if the specified trackable is visible, false if not, or an error occurred.
Here is the call graph for this function:

◆ arwQueryTrackableVisibilityAndTransformationStereo()

ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformationStereo ( int  trackableUID,
float  matrixL[16],
float  matrixR[16] 
)

Returns the visibility and stereo pose of the specified trackable.

After a call to arwUpdate, all trackable information will be current. Any trackable can then be checked for visibility in the current frame, and if visible, additionally queried for its pose.

Parameters
trackableUIDThe unique identifier (UID) of the trackable to query
matrixLThe float array to populate with an OpenGL-compatible transformation matrix for the left camera.
matrixRThe float array to populate with an OpenGL-compatible transformation matrix for the right camera.
Returns
true if the specified trackable is visible, false if not, or an error occurred
Here is the call graph for this function:

◆ arwRegisterLogCallback()

ARX_EXTERN void arwRegisterLogCallback ( PFN_LOGCALLBACK  callback)

Registers a callback function to use when a message is logged.

If the callback is to become invalid, be sure to call this function with NULL first so that the callback is unregistered.

Here is the call graph for this function:

◆ arwRemoveAllTrackables()

ARX_EXTERN int arwRemoveAllTrackables ( )

Clears the collection of trackables.

Returns
The number of trackables removed
Here is the call graph for this function:

◆ arwRemoveTrackable()

ARX_EXTERN bool arwRemoveTrackable ( int  trackableUID)

Removes the trackable with the given unique identifier (UID).

Parameters
trackableUIDThe unique identifier (UID) of the trackable to remove
Returns
true if the trackable was removed, false if an error occurred

◆ arwSetLogLevel()

ARX_EXTERN void arwSetLogLevel ( const int  logLevel)

◆ arwSetTrackableOptionBool()

ARX_EXTERN void arwSetTrackableOptionBool ( int  trackableUID,
int  option,
bool  value 
)

Set boolean options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwSetTrackableOptionFloat()

ARX_EXTERN void arwSetTrackableOptionFloat ( int  trackableUID,
int  option,
float  value 
)

Set floating-point options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwSetTrackableOptionInt()

ARX_EXTERN void arwSetTrackableOptionInt ( int  trackableUID,
int  option,
int  value 
)

Set integer options associated with a trackable.

Parameters
trackableUIDThe unique identifier (UID) of the trackable
optionSymbolic constant identifying trackable option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwSetTrackerOptionBool()

ARX_EXTERN void arwSetTrackerOptionBool ( int  option,
bool  value 
)

Set boolean options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwSetTrackerOptionFloat()

ARX_EXTERN void arwSetTrackerOptionFloat ( int  option,
float  value 
)

Set floating-point options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwSetTrackerOptionInt()

ARX_EXTERN void arwSetTrackerOptionInt ( int  option,
int  value 
)

Set integer options associated with a tracker.

Parameters
optionSymbolic constant identifying tracker option to set.
valueThe value to set it to.
Here is the call graph for this function:

◆ arwShutdownAR()

ARX_EXTERN bool arwShutdownAR ( )

Shuts down the artoolkitX and frees all resources.

N.B.: If this is being called from the destructor of the same module which supplied the log callback, be sure to call arwRegisterLogCallback(NULL) prior to calling this function.

Returns
true if successful, false if an error occurred
See also
arwInitialiseAR()

◆ arwStartRunning()

ARX_EXTERN bool arwStartRunning ( const char *  vconf,
const char *  cparaName 
)

Initialises and starts video capture.

Parameters
vconfThe video configuration string
cparaNameThe camera parameter file, which is used to form the projection matrix
Returns
true if successful, false if an error occurred
See also
arwStopRunning()
Here is the call graph for this function:

◆ arwStartRunningB()

ARX_EXTERN bool arwStartRunningB ( const char *  vconf,
const char *  cparaBuff,
const int  cparaBuffLen 
)

Initialises and starts video capture.

Parameters
vconfThe video configuration string
cparaBuffA string containing the contents of a camera parameter file, which is used to form the projection matrix.
cparaBuffLenNumber of characters in cparaBuff.
Returns
true if successful, false if an error occurred
See also
arwStopRunning()
Here is the call graph for this function:

◆ arwStartRunningStereo()

ARX_EXTERN bool arwStartRunningStereo ( const char *  vconfL,
const char *  cparaNameL,
const char *  vconfR,
const char *  cparaNameR,
const char *  transL2RName 
)
Here is the call graph for this function:

◆ arwStartRunningStereoB()

ARX_EXTERN bool arwStartRunningStereoB ( const char *  vconfL,
const char *  cparaBuffL,
const int  cparaBuffLenL,
const char *  vconfR,
const char *  cparaBuffR,
int  cparaBuffLenR,
const char *  transL2RBuff,
const int  transL2RBuffLen 
)
Here is the call graph for this function:

◆ arwStopRunning()

ARX_EXTERN bool arwStopRunning ( )

Stops video capture and frees video capture resources.

Returns
true if successful, false if an error occurred
See also
arwStartRunning()
Here is the call graph for this function:

◆ arwUpdateAR()

ARX_EXTERN bool arwUpdateAR ( )

Performs tracking and trackable updates.

The newest frame from the video source is retrieved and analysed. All loaded trackables are updated.

Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwUpdateTexture32()

ARX_EXTERN bool arwUpdateTexture32 ( uint32_t *  buffer)

Asks the video source to push the most recent frame into the passed-in buffer.

Parameters
bufferPointer to a buffer of pixels (of type 'uint32_t') to be filled with video. It is the caller's responsibility to ensure that the buffer is of sufficient size, e.g. using arwGetVideoParams. The pixels are RGBA in little-endian systems, or ABGR in big-endian systems.
Returns
true if successful, false if an error occurred
Here is the call graph for this function:

◆ arwUpdateTexture32Stereo()

ARX_EXTERN bool arwUpdateTexture32Stereo ( uint32_t *  bufferL,
uint32_t *  bufferR 
)

Asks the video source to push the most recent stereo frame into the passed-in buffer.

Parameters
bufferLPointer to a buffer of pixels (of type 'uint32_t') to be filled with video from the left camera. It is the caller's responsibility to ensure that the buffer is of sufficient size, e.g. using arwGetVideoParamsStereo. The pixels are RGBA in little-endian systems, or ABGR in big-endian systems.
bufferRPointer to a buffer of pixels (of type 'uint32_t') to be filled with video from the right camera. It is the caller's responsibility to ensure that the buffer is of sufficient size, e.g. using arwGetVideoParamsStereo. The pixels are RGBA in little-endian systems, or ABGR in big-endian systems.
Returns
true if successful, false if an error occurred
Here is the call graph for this function: