ARWrapper
Provides a C++ wrapper around ARToolKit and exposes a C and JNI API
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
Functions
ARToolKitWrapperExportedAPI.cpp File Reference

Functions

void CALL_CONV log (const char *msg)
 
EXPORT_API void arwRegisterLogCallback (PFN_LOGCALLBACK callback)
 Registers a callback function to use when a message is logged. More...
 
EXPORT_API bool arwInitialiseAR ()
 Initialises the ARToolKit. More...
 
EXPORT_API bool arwInitialiseARWithOptions (const int pattSize, const int pattCountMax)
 Initialises the ARToolKit with non-default options for size and number of square markers. More...
 
EXPORT_API bool arwGetARToolKitVersion (char *buffer, int length)
 Gets the ARToolKit version as a string, such as "4.5.1". More...
 
EXPORT_API int arwGetError ()
 Return error information Returns the value of the error flag. More...
 
EXPORT_API bool arwChangeToResourcesDir (const char *resourcesDirectoryPath)
 Changes the working directory to the resources directory used by ARToolKit. More...
 
EXPORT_API bool arwStartRunning (const char *vconf, const char *cparaName, const float nearPlane, const float farPlane)
 Initialises and starts video capture. More...
 
EXPORT_API bool arwStartRunningB (const char *vconf, const char *cparaBuff, const int cparaBuffLen, const float nearPlane, const float farPlane)
 Initialises and starts video capture. More...
 
EXPORT_API bool arwStartRunningStereo (const char *vconfL, const char *cparaNameL, const char *vconfR, const char *cparaNameR, const char *transL2RName, const float nearPlane, const float farPlane)
 
EXPORT_API bool arwStartRunningStereoB (const char *vconfL, const char *cparaBuffL, const int cparaBuffLenL, const char *vconfR, const char *cparaBuffR, const int cparaBuffLenR, const char *transL2RBuff, const int transL2RBuffLen, const float nearPlane, const float farPlane)
 
EXPORT_API bool arwIsRunning ()
 Returns true if ARToolKit is running, i.e. More...
 
EXPORT_API bool arwStopRunning ()
 Stops video capture and frees video capture resources. More...
 
EXPORT_API bool arwShutdownAR ()
 Shuts down the ARToolKit and frees all resources. More...
 
EXPORT_API bool arwGetProjectionMatrix (float p[16])
 Populates the given float array with the projection matrix computed from camera parameters for the video source. More...
 
EXPORT_API bool arwGetProjectionMatrixStereo (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...
 
EXPORT_API bool arwGetVideoParams (int *width, int *height, int *pixelSize, char *pixelFormatStringBuffer, int pixelFormatStringBufferLen)
 Returns the parameters of the video source frame. More...
 
EXPORT_API 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...
 
EXPORT_API bool arwCapture ()
 Captures a newest frame from the video source. More...
 
EXPORT_API bool arwUpdateAR ()
 Performs detection and marker updates. More...
 
EXPORT_API bool arwUpdateTexture (Color *buffer)
 Populates the provided floating-point color buffer with the current video frame. More...
 
EXPORT_API bool arwUpdateTexture32 (unsigned int *buffer)
 
EXPORT_API bool arwUpdateTextureStereo (Color *bufferL, Color *bufferR)
 
EXPORT_API bool arwUpdateTexture32Stereo (unsigned int *bufferL, unsigned int *bufferR)
 
EXPORT_API void arwSetVideoDebugMode (bool debug)
 Enables or disables debug mode in the tracker. More...
 
EXPORT_API bool arwGetVideoDebugMode ()
 Returns whether debug mode is currently enabled. More...
 
EXPORT_API bool arwUpdateDebugTexture (Color *buffer, float alpha)
 Populates the provided color buffer with the contents of the debug image. More...
 
EXPORT_API bool arwUpdateTextureGL (const int textureID)
 Uses OpenGL to directly updated the specified texture with the current video frame. More...
 
EXPORT_API bool arwUpdateTextureGLStereo (const int textureID_L, const int textureID_R)
 
EXPORT_API void UnityRenderEvent (int eventID)
 When ARWrapper is loaded as a plugin into the Unity 3D environment, this function will be called for Unity GL.IssuePluginEvent script calls. More...
 
EXPORT_API void arwSetUnityRenderEventUpdateTextureGLTextureID (int textureID)
 Uses OpenGL to directly updated the specified texture with the current video frame. More...
 
EXPORT_API void arwSetUnityRenderEventUpdateTextureGLStereoTextureIDs (int textureID_L, int textureID_R)
 
EXPORT_API void arwSetVideoThreshold (int threshold)
 Sets the threshold value used for image binarization. More...
 
EXPORT_API int arwGetVideoThreshold ()
 Returns the current threshold value used for image binarization. More...
 
EXPORT_API void arwSetVideoThresholdMode (int mode)
 Sets the current threshold mode used for image binarization. More...
 
EXPORT_API int arwGetVideoThresholdMode ()
 Gets the current threshold mode used for image binarization. More...
 
EXPORT_API void arwSetLabelingMode (int mode)
 
EXPORT_API int arwGetLabelingMode ()
 
EXPORT_API void arwSetPatternDetectionMode (int mode)
 
EXPORT_API int arwGetPatternDetectionMode ()
 
EXPORT_API void arwSetBorderSize (float size)
 
EXPORT_API float arwGetBorderSize ()
 
EXPORT_API void arwSetMatrixCodeType (int type)
 
EXPORT_API int arwGetMatrixCodeType ()
 
EXPORT_API void arwSetImageProcMode (int mode)
 
EXPORT_API int arwGetImageProcMode ()
 
EXPORT_API void arwSetNFTMultiMode (bool on)
 
EXPORT_API bool arwGetNFTMultiMode ()
 
EXPORT_API int arwAddMarker (const char *cfg)
 Adds a marker as specified in the given configuration string. More...
 
EXPORT_API bool arwRemoveMarker (int markerUID)
 Removes the marker with the given unique identifier (UID). More...
 
EXPORT_API int arwRemoveAllMarkers ()
 Clears the collection of markers. More...
 
EXPORT_API bool arwQueryMarkerVisibility (int markerUID)
 Returns the visibility status of the specified marker. More...
 
EXPORT_API bool arwQueryMarkerTransformation (int markerUID, float matrix[16])
 Populates the provided float array with the current transformation for the specified marker. More...
 
EXPORT_API bool arwQueryMarkerTransformationStereo (int markerUID, float matrixL[16], float matrixR[16])
 Populates the provided float arrays with the current transformations for the specified marker. More...
 
EXPORT_API int arwGetMarkerPatternCount (int markerUID)
 Returns the number of pattern images associated with the specified marker. More...
 
EXPORT_API bool arwGetMarkerPatternConfig (int markerUID, int patternID, float matrix[16], float *width, float *height, int *imageSizeX, int *imageSizeY)
 Gets configuration of a pattern associated with a marker. More...
 
EXPORT_API bool arwGetMarkerPatternImage (int markerUID, int patternID, Color *buffer)
 Gets a pattern image associated with a marker. More...
 
EXPORT_API bool arwGetMarkerOptionBool (int markerUID, int option)
 Get boolean options associated with a marker. More...
 
EXPORT_API void arwSetMarkerOptionBool (int markerUID, int option, bool value)
 Set boolean options associated with a marker. More...
 
EXPORT_API int arwGetMarkerOptionInt (int markerUID, int option)
 Get integer options associated with a marker. More...
 
EXPORT_API void arwSetMarkerOptionInt (int markerUID, int option, int value)
 Set integer options associated with a marker. More...
 
EXPORT_API float arwGetMarkerOptionFloat (int markerUID, int option)
 Get floating-point options associated with a marker. More...
 
EXPORT_API void arwSetMarkerOptionFloat (int markerUID, int option, float value)
 Set floating-point options associated with a marker. More...
 
EXPORT_API bool arwLoadOpticalParams (const char *optical_param_name, const char *optical_param_buff, const int optical_param_buffLen, float *fovy_p, float *aspect_p, float m[16], float p[16])
 Loads an optical parameters structure from file or from buffer. More...
 
jfloatArray glArrayToJava (JNIEnv *env, ARdouble *arr, int len)
 
JNIEXPORT jstring JNICALL JNIFUNCTION (arwGetARToolKitVersion(JNIEnv *env, jobject obj))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetError(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwInitialiseAR(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwInitialiseARWithOptions(JNIEnv *env, jobject obj, jint pattSize, jint pattCountMax))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwChangeToResourcesDir(JNIEnv *env, jobject obj, jstring resourcesDirectoryPath))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwShutdownAR(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwStartRunning(JNIEnv *env, jobject obj, jstring vconf, jstring cparaName, float nearPlane, float farPlane))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwStartRunningStereo(JNIEnv *env, jobject obj, jstring vconfL, jstring cparaNameL, jstring vconfR, jstring cparaNameR, jstring transL2RName, float nearPlane, float farPlane))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwIsRunning(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwStopRunning(JNIEnv *env, jobject obj))
 
JNIEXPORT jfloatArray JNICALL JNIFUNCTION (arwGetProjectionMatrix(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetProjectionMatrixStereo(JNIEnv *env, jobject obj, jfloatArray projL, jfloatArray projR))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetVideoParams(JNIEnv *env, jobject obj, jintArray width, jintArray height, jintArray pixelSize, jobjectArray pixelFormatStringBuffer))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetVideoParamsStereo(JNIEnv *env, jobject obj, jintArray widthL, jintArray heightL, jintArray pixelSizeL, jobjectArray pixelFormatStringL, jintArray widthR, jintArray heightR, jintArray pixelSizeR, jobjectArraypixelFormatStringR))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwCapture(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwUpdateAR(JNIEnv *env, jobject obj))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwAddMarker(JNIEnv *env, jobject obj, jstring cfg))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwRemoveMarker(JNIEnv *env, jobject obj, jint markerUID))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwRemoveAllMarkers(JNIEnv *env, jobject obj))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwQueryMarkerVisibility(JNIEnv *env, jobject obj, jint markerUID))
 
JNIEXPORT jfloatArray JNICALL JNIFUNCTION (arwQueryMarkerTransformation(JNIEnv *env, jobject obj, jint markerUID))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwQueryMarkerTransformationStereo(JNIEnv *env, jobject obj, jint markerUID, jfloatArray matrixL, jfloatArray matrixR))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetMarkerPatternCount(JNIEnv *env, jobject obj, int markerUID))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetVideoDebugMode(JNIEnv *env, jobject obj, jboolean debug))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetVideoDebugMode(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetVideoThreshold(JNIEnv *env, jobject obj, jint threshold))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetVideoThreshold(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetLabelingMode(JNIEnv *env, jobject obj, jint mode))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetLabelingMode(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetPatternDetectionMode(JNIEnv *env, jobject obj, jint mode))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetPatternDetectionMode(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetBorderSize(JNIEnv *env, jobject obj, jfloat size))
 
JNIEXPORT jfloat JNICALL JNIFUNCTION (arwGetBorderSize(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetMatrixCodeType(JNIEnv *env, jobject obj, jint type))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetMatrixCodeType(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetImageProcMode(JNIEnv *env, jobject obj, jint mode))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetImageProcMode(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetNFTMultiMode(JNIEnv *env, jobject obj, jboolean on))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetNFTMultiMode(JNIEnv *env, jobject obj))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetMarkerOptionBool(JNIEnv *env, jobject obj, jint markerUID, jint option, jboolean value))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetMarkerOptionInt(JNIEnv *env, jobject obj, jint markerUID, jint option, jint value))
 
JNIEXPORT void JNICALL JNIFUNCTION (arwSetMarkerOptionFloat(JNIEnv *env, jobject obj, jint markerUID, jint option, jfloat value))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetMarkerOptionBool(JNIEnv *env, jobject obj, jint markerUID, jint option))
 
JNIEXPORT jint JNICALL JNIFUNCTION (arwGetMarkerOptionInt(JNIEnv *env, jobject obj, jint markerUID, jint option))
 
JNIEXPORT jfloat JNICALL JNIFUNCTION (arwGetMarkerOptionFloat(JNIEnv *env, jobject obj, jint markerUID, jint option))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwAcceptVideoImage(JNIEnv *env, jobject obj, jbyteArray pinArray, jint width, jint height, jint cameraIndex, jboolean cameraIsFrontFacing))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwAcceptVideoImageStereo(JNIEnv *env, jobject obj, jbyteArray pinArrayL, jint widthL, jint heightL, jint cameraIndexL, jboolean cameraIsFrontFacingL, jbyteArray pinArrayR, jint widthR, jint heightR, jint cameraIndexR, jboolean cameraIsFrontFacingR))
 
JNIEXPORT bool JNICALL JNIFUNCTION (arwUpdateDebugTexture(JNIEnv *env, jobject obj, jbyteArray pinArray, bool flipY))
 
JNIEXPORT jboolean JNICALL JNIFUNCTION (arwGetVideoParams(JNIEnv *env, jobject obj, jintArray width, jintArray height, jintArray pixelSize, jobjectArray pixelFormatString))
 

Function Documentation

EXPORT_API int arwAddMarker ( const char *  cfg)

Adds a marker as specified in the given configuration string.

The format of the string can be one of:

  • Single marker: "single;pattern_file;pattern_width", e.g. "single;data/patt.hiro;80"
  • Multi marker: "multi;config_file", e.g. "multi;data/multi/marker.dat"
  • NFT marker: "nft;nft_dataset_pathname", e.g. "nft;gibraltar"
    Parameters
    cfgThe configuration string
    Returns
    The unique identifier (UID) of the marker instantiated based on the configuration string, or -1 if an error occurred
EXPORT_API bool arwCapture ( )

Captures a newest frame from the video source.

Returns
true if successful, false if an error occurred
EXPORT_API bool arwChangeToResourcesDir ( const char *  resourcesDirectoryPath)

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

Normally, this would be called immediately after arwInitialiseAR()

Returns
true if successful, false if an error occurred
See Also
arwInitialiseAR()
EXPORT_API bool arwGetARToolKitVersion ( char *  buffer,
int  length 
)

Gets the ARToolKit version as a string, such as "4.5.1".

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
EXPORT_API float arwGetBorderSize ( )
EXPORT_API 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.
EXPORT_API int arwGetImageProcMode ( )
EXPORT_API int arwGetLabelingMode ( )
EXPORT_API bool arwGetMarkerOptionBool ( int  markerUID,
int  option 
)

Get boolean options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to get.
Returns
true if option is set, false if option is not set or an error occurred.
EXPORT_API float arwGetMarkerOptionFloat ( int  markerUID,
int  option 
)

Get floating-point options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to get.
Returns
floating-point value of option, or NAN if an error occurred.
EXPORT_API int arwGetMarkerOptionInt ( int  markerUID,
int  option 
)

Get integer options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to get.
Returns
integer value of option, or INT_MIN if an error occurred.
EXPORT_API bool arwGetMarkerPatternConfig ( int  markerUID,
int  patternID,
float  matrix[16],
float *  width,
float *  height,
int *  imageSizeX,
int *  imageSizeY 
)

Gets configuration of a pattern associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
patternIDThe id of the pattern within the marker, in range from 0 to arwGetMarkerPatternCount() - 1, inclusive. Ignored for single 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
EXPORT_API int arwGetMarkerPatternCount ( int  markerUID)

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

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

Parameters
markerUIDThe unique identifier (UID) of the marker
Returns
The number of pattern images
EXPORT_API bool arwGetMarkerPatternImage ( int  markerUID,
int  patternID,
Color buffer 
)

Gets a pattern image associated with a marker.

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

Parameters
markerUIDThe unique identifier (UID) of the marker
patternIDThe id for the pattern within that marker. Ignored for single markers and NFT markers.
bufferColor array to populate with pattern image. Use arwGetMarkerPatternConfig to get the required size of this array (imageSizeX * imageSizeY elements).
Returns
true if successful, false if an error occurred
EXPORT_API int arwGetMatrixCodeType ( )
EXPORT_API bool arwGetNFTMultiMode ( )
EXPORT_API int arwGetPatternDetectionMode ( )
EXPORT_API bool arwGetProjectionMatrix ( float  p[16])

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

Parameters
pFloat array to populate with OpenGL compatible projection matrix.
Returns
true if successful, false if an error occurred
EXPORT_API bool arwGetProjectionMatrixStereo ( 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
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
EXPORT_API bool arwGetVideoDebugMode ( )

Returns whether debug mode is currently enabled.

Returns
true when debug mode is enabled, false when debug mode is disabled
See Also
arwSetVideoDebugMode()
EXPORT_API 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
EXPORT_API 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
EXPORT_API int arwGetVideoThreshold ( )

Returns the current threshold value used for image binarization.

Returns
The current threshold value
See Also
arwSetVideoThreshold()
EXPORT_API int arwGetVideoThresholdMode ( )

Gets the current threshold mode used for image binarization.

Returns
The current threshold mode
See Also
arwGetVideoThresholdMode()
EXPORT_API bool arwInitialiseAR ( )

Initialises the ARToolKit.

For any square template (pattern) markers, 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()
EXPORT_API bool arwInitialiseARWithOptions ( const int  pattSize,
const int  pattCountMax 
)

Initialises the ARToolKit with non-default options for size and number of square markers.

Parameters
pattSizeFor any square template (pattern) markers, the number of rows and columns in the template. May not be less than 16 or more than AR_PATT_SIZE1_MAX.
pattCountMaxFor any square template (pattern) markers, the maximum number of markers that may be loaded for a single matching pass. Must be > 0.
Returns
true if successful, false if an error occurred
See Also
arwShutdownAR()
EXPORT_API bool arwIsRunning ( )

Returns true if ARToolKit is running, i.e.

detecting markers.

Returns
true when running, otherwise false
EXPORT_API bool arwLoadOpticalParams ( const char *  optical_param_name,
const char *  optical_param_buff,
const int  optical_param_buffLen,
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.
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 arwStartRunning().
EXPORT_API bool arwQueryMarkerTransformation ( int  markerUID,
float  matrix[16] 
)

Populates the provided float array with the current transformation for the specified marker.

After a call to arwUpdate, all marker information will be current. Marker transformations can then be checked. If the specified marker is not found the last good transformation is used, and false is returned.

Parameters
markerUIDThe unique identifier (UID) of the marker to query
matrixThe float array to populate with an OpenGL compatible transformation matrix
Returns
true if the specified marker is visible, false if not, or an error occurred
EXPORT_API bool arwQueryMarkerTransformationStereo ( int  markerUID,
float  matrixL[16],
float  matrixR[16] 
)

Populates the provided float arrays with the current transformations for the specified marker.

After a call to arwUpdate, all marker information will be current. Marker transformations can then be checked. If the specified marker is not found the last good transformation is used, and false is returned.

Parameters
markerUIDThe unique identifier (UID) of the marker 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 marker is visible, false if not, or an error occurred
EXPORT_API bool arwQueryMarkerVisibility ( int  markerUID)

Returns the visibility status of the specified marker.

After a call to arwUpdate, all marker information will be current. Any marker can then be checked for visibility in the current frame.

Parameters
markerUIDThe unique identifier (UID) of the marker to query
Returns
true if the specified marker is visible, false if not, or an error occurred
EXPORT_API 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.

EXPORT_API int arwRemoveAllMarkers ( )

Clears the collection of markers.

Returns
The number of markers removed
EXPORT_API bool arwRemoveMarker ( int  markerUID)

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

Parameters
markerUIDThe unique identifier (UID) of the marker to remove
Returns
true if the marker was removed, false if an error occurred
EXPORT_API void arwSetBorderSize ( float  size)
EXPORT_API void arwSetImageProcMode ( int  mode)
EXPORT_API void arwSetLabelingMode ( int  mode)
EXPORT_API void arwSetMarkerOptionBool ( int  markerUID,
int  option,
bool  value 
)

Set boolean options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to set.
valueThe value to set it to.
EXPORT_API void arwSetMarkerOptionFloat ( int  markerUID,
int  option,
float  value 
)

Set floating-point options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to set.
valueThe value to set it to.
EXPORT_API void arwSetMarkerOptionInt ( int  markerUID,
int  option,
int  value 
)

Set integer options associated with a marker.

Parameters
markerUIDThe unique identifier (UID) of the marker
optionSymbolic constant identifying marker option to set.
valueThe value to set it to.
EXPORT_API void arwSetMatrixCodeType ( int  type)
EXPORT_API void arwSetNFTMultiMode ( bool  on)
EXPORT_API void arwSetPatternDetectionMode ( int  mode)
EXPORT_API void arwSetUnityRenderEventUpdateTextureGLStereoTextureIDs ( int  textureID_L,
int  textureID_R 
)
EXPORT_API void arwSetUnityRenderEventUpdateTextureGLTextureID ( int  textureID)

Uses OpenGL to directly updated the specified texture with the current video frame.

Parameters
textureIDThe OpenGL texture ID to upload texture data to
Returns
true if successful, false if an error occurred
EXPORT_API void arwSetVideoDebugMode ( bool  debug)

Enables or disables 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.

Parameters
debugtrue to enable debug mode, false to disable debug mode
See Also
arwGetVideoDebugMode()
EXPORT_API void arwSetVideoThreshold ( int  threshold)

Sets the threshold value used for image binarization.

Parameters
thresholdThe new threshold value to use
See Also
arwGetVideoThreshold()
EXPORT_API void arwSetVideoThresholdMode ( int  mode)

Sets the current threshold mode used for image binarization.

Parameters
modeThe new threshold mode
See Also
arwSetVideoThresholdMode()
EXPORT_API bool arwShutdownAR ( )

Shuts down the ARToolKit 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 set the logCallback = NULL prior to calling this function.

Returns
true if successful, false if an error occurred
See Also
arwInitialiseAR()
EXPORT_API bool arwStartRunning ( const char *  vconf,
const char *  cparaName,
const float  nearPlane,
const float  farPlane 
)

Initialises and starts video capture.

Parameters
vconfThe video configuration string
cparaNameThe camera parameter file, which is used to form the projection matrix
nearPlaneThe distance to the near plane of the viewing frustum formed by the camera parameters.
farPlaneThe distance to the far plane of the viewing frustum formed by the camera parameters.
Returns
true if successful, false if an error occurred
See Also
arwStopRunning()
EXPORT_API bool arwStartRunningB ( const char *  vconf,
const char *  cparaBuff,
const int  cparaBuffLen,
const float  nearPlane,
const float  farPlane 
)

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.
nearPlaneThe distance to the near plane of the viewing frustum formed by the camera parameters.
farPlaneThe distance to the far plane of the viewing frustum formed by the camera parameters.
Returns
true if successful, false if an error occurred
See Also
arwStopRunning()
EXPORT_API bool arwStartRunningStereo ( const char *  vconfL,
const char *  cparaNameL,
const char *  vconfR,
const char *  cparaNameR,
const char *  transL2RName,
const float  nearPlane,
const float  farPlane 
)
EXPORT_API bool arwStartRunningStereoB ( const char *  vconfL,
const char *  cparaBuffL,
const int  cparaBuffLenL,
const char *  vconfR,
const char *  cparaBuffR,
const int  cparaBuffLenR,
const char *  transL2RBuff,
const int  transL2RBuffLen,
const float  nearPlane,
const float  farPlane 
)
EXPORT_API bool arwStopRunning ( )

Stops video capture and frees video capture resources.

Returns
true if successful, false if an error occurred
See Also
arwStartRunning()
EXPORT_API bool arwUpdateAR ( )

Performs detection and marker updates.

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

Returns
true if successful, false if an error occurred
EXPORT_API bool arwUpdateDebugTexture ( Color buffer,
float  alpha 
)

Populates the provided color buffer with the contents of the debug image.

Parameters
bufferThe color buffer to fill with the debug image
alphaThe alpha value to apply to each pixel
Returns
true if successful, false if an error occurred
EXPORT_API bool arwUpdateTexture ( Color buffer)

Populates the provided floating-point color buffer with the current video frame.

Parameters
bufferThe color buffer to fill with video
Returns
true if successful, false if an error occurred
EXPORT_API bool arwUpdateTexture32 ( unsigned int *  buffer)
EXPORT_API bool arwUpdateTexture32Stereo ( unsigned int *  bufferL,
unsigned int *  bufferR 
)
EXPORT_API bool arwUpdateTextureGL ( const int  textureID)

Uses OpenGL to directly updated the specified texture with the current video frame.

Parameters
textureIDThe OpenGL texture ID to upload texture data to
Returns
true if successful, false if an error occurred
EXPORT_API bool arwUpdateTextureGLStereo ( const int  textureID_L,
const int  textureID_R 
)
EXPORT_API bool arwUpdateTextureStereo ( Color bufferL,
Color bufferR 
)
jfloatArray glArrayToJava ( JNIEnv *  env,
ARdouble *  arr,
int  len 
)
JNIEXPORT jstring JNICALL JNIFUNCTION ( arwGetARToolKitVersion(JNIEnv *env, jobject obj)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetError(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwInitialiseAR(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwInitialiseARWithOptions(JNIEnv *env, jobject obj, jint pattSize, jint pattCountMax)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwChangeToResourcesDir(JNIEnv *env, jobject obj, jstring resourcesDirectoryPath)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwShutdownAR(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwStartRunning(JNIEnv *env, jobject obj, jstring vconf, jstring cparaName, float nearPlane, float farPlane)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwStartRunningStereo(JNIEnv *env, jobject obj, jstring vconfL, jstring cparaNameL, jstring vconfR, jstring cparaNameR, jstring transL2RName, float nearPlane, float farPlane)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwIsRunning(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwStopRunning(JNIEnv *env, jobject obj)  )
JNIEXPORT jfloatArray JNICALL JNIFUNCTION ( arwGetProjectionMatrix(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetProjectionMatrixStereo(JNIEnv *env, jobject obj, jfloatArray projL, jfloatArray projR)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetVideoParams(JNIEnv *env, jobject obj, jintArray width, jintArray height, jintArray pixelSize, jobjectArray pixelFormatStringBuffer)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetVideoParamsStereo(JNIEnv *env, jobject obj, jintArray widthL, jintArray heightL, jintArray pixelSizeL, jobjectArray pixelFormatStringL, jintArray widthR, jintArray heightR, jintArray pixelSizeR, jobjectArraypixelFormatStringR)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwCapture(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwUpdateAR(JNIEnv *env, jobject obj)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwAddMarker(JNIEnv *env, jobject obj, jstring cfg)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwRemoveMarker(JNIEnv *env, jobject obj, jint markerUID)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwRemoveAllMarkers(JNIEnv *env, jobject obj)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwQueryMarkerVisibility(JNIEnv *env, jobject obj, jint markerUID)  )
JNIEXPORT jfloatArray JNICALL JNIFUNCTION ( arwQueryMarkerTransformation(JNIEnv *env, jobject obj, jint markerUID)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwQueryMarkerTransformationStereo(JNIEnv *env, jobject obj, jint markerUID, jfloatArray matrixL, jfloatArray matrixR)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetMarkerPatternCount(JNIEnv *env, jobject obj, int markerUID)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetVideoDebugMode(JNIEnv *env, jobject obj, jboolean debug)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetVideoDebugMode(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetVideoThreshold(JNIEnv *env, jobject obj, jint threshold)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetVideoThreshold(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetLabelingMode(JNIEnv *env, jobject obj, jint mode)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetLabelingMode(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetPatternDetectionMode(JNIEnv *env, jobject obj, jint mode)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetPatternDetectionMode(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetBorderSize(JNIEnv *env, jobject obj, jfloat size)  )
JNIEXPORT jfloat JNICALL JNIFUNCTION ( arwGetBorderSize(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetMatrixCodeType(JNIEnv *env, jobject obj, jint type)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetMatrixCodeType(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetImageProcMode(JNIEnv *env, jobject obj, jint mode)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetImageProcMode(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetNFTMultiMode(JNIEnv *env, jobject obj, jboolean on)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetNFTMultiMode(JNIEnv *env, jobject obj)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetMarkerOptionBool(JNIEnv *env, jobject obj, jint markerUID, jint option, jboolean value)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetMarkerOptionInt(JNIEnv *env, jobject obj, jint markerUID, jint option, jint value)  )
JNIEXPORT void JNICALL JNIFUNCTION ( arwSetMarkerOptionFloat(JNIEnv *env, jobject obj, jint markerUID, jint option, jfloat value)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetMarkerOptionBool(JNIEnv *env, jobject obj, jint markerUID, jint option)  )
JNIEXPORT jint JNICALL JNIFUNCTION ( arwGetMarkerOptionInt(JNIEnv *env, jobject obj, jint markerUID, jint option)  )
JNIEXPORT jfloat JNICALL JNIFUNCTION ( arwGetMarkerOptionFloat(JNIEnv *env, jobject obj, jint markerUID, jint option)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwAcceptVideoImage(JNIEnv *env, jobject obj, jbyteArray pinArray, jint width, jint height, jint cameraIndex, jboolean cameraIsFrontFacing)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwAcceptVideoImageStereo(JNIEnv *env, jobject obj, jbyteArray pinArrayL, jint widthL, jint heightL, jint cameraIndexL, jboolean cameraIsFrontFacingL, jbyteArray pinArrayR, jint widthR, jint heightR, jint cameraIndexR, jboolean cameraIsFrontFacingR)  )
JNIEXPORT bool JNICALL JNIFUNCTION ( arwUpdateDebugTexture(JNIEnv *env, jobject obj, jbyteArray pinArray, bool flipY)  )
JNIEXPORT jboolean JNICALL JNIFUNCTION ( arwGetVideoParams(JNIEnv *env, jobject obj, jintArray width, jintArray height, jintArray pixelSize, jobjectArray pixelFormatString)  )
void CALL_CONV log ( const char *  msg)
EXPORT_API void UnityRenderEvent ( int  eventID)

When ARWrapper is loaded as a plugin into the Unity 3D environment, this function will be called for Unity GL.IssuePluginEvent script calls.

The function will be called on a rendering thread; note that when multithreaded rendering is used, the rendering thread WILL BE DIFFERENT from the thread that all scripts & other game logic happens. It is up to the user to ensure any synchronization with other plugin script calls.

Variable Documentation

unsigned char __c[4]
float __d