65#pragma mark artoolkitX lifecycle functions
122 ARX_EXTERN
bool arwStartRunning(
const char *vconf,
const char *cparaName);
132 ARX_EXTERN
bool arwStartRunningB(
const char *vconf,
const char *cparaBuff,
const int cparaBuffLen);
134 ARX_EXTERN
bool arwStartRunningStereo(
const char *vconfL,
const char *cparaNameL,
const char *vconfR,
const char *cparaNameR,
const char *transL2RName);
136 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);
168#pragma mark Video stream management
232 ARX_EXTERN
bool arwGetVideoParams(
int *width,
int *height,
int *pixelSize,
char *pixelFormatStringBuffer,
int pixelFormatStringBufferLen);
249 ARX_EXTERN
bool arwGetVideoParamsStereo(
int *widthL,
int *heightL,
int *pixelSizeL,
char *pixelFormatStringBufferL,
int pixelFormatStringBufferLenL,
int *widthR,
int *heightR,
int *pixelSizeR,
char *pixelFormatStringBufferR,
int pixelFormatStringBufferLenR);
265#pragma mark Video push interface.
267 ARX_EXTERN
int arwVideoPushInit(
int videoSourceIndex,
int width,
int height,
const char *pixelFormat,
int cameraIndex,
int cameraPosition);
269 uint8_t *buf0p,
int buf0Size,
int buf0PixelStride,
int buf0RowStride,
270 uint8_t *buf1p,
int buf1Size,
int buf1PixelStride,
int buf1RowStride,
271 uint8_t *buf2p,
int buf2Size,
int buf2PixelStride,
int buf2RowStride,
272 uint8_t *buf3p,
int buf3Size,
int buf3PixelStride,
int buf3RowStride);
276#pragma mark Video stream retrieval and/or drawing.
371 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]);
391 ARX_EXTERN
bool arwDrawVideo(
const int videoSourceIndex);
411#pragma mark Tracking configuration
478#pragma mark Trackable management
579 ARX_EXTERN
bool arwGetTrackablePatternConfig(
int trackableUID,
int patternID,
float matrix[16],
float *width,
float *height,
int *imageSizeX,
int *imageSizeY);
722 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]);
725#pragma mark Video source info list management
766 ARX_EXTERN
bool arwGetVideoSourceInfoListEntry(
int index,
char *nameBuf,
int nameBufLen,
char *modelBuf,
int modelBufLen,
char *UIDBuf,
int UIDBufLen, uint32_t *flags_p,
char *openTokenBuf,
int openTokenBufLen);
ARX_EXTERN bool arwSave2dTrackableDatabase(const char *databaseFileName)
Save the currently loaded 2D trackable set as a trackable database.
ARX_EXTERN bool arwGetVideoParams(int *width, int *height, int *pixelSize, char *pixelFormatStringBuffer, int pixelFormatStringBufferLen)
Returns the parameters of the video source frame.
Definition: ARX_c.cpp:256
@ ARW_TRACKABLE_TYPE_Square
A square template (pattern) marker.
Definition: ARX_c.h:619
@ ARW_TRACKABLE_TYPE_TwoD
An artoolkitX 2D textured trackable.
Definition: ARX_c.h:623
@ ARW_TRACKABLE_TYPE_SquareBarcode
A square matrix (2D barcode) marker.
Definition: ARX_c.h:620
@ ARW_TRACKABLE_TYPE_Unknown
Type not known, e.g. autocreated trackable.
Definition: ARX_c.h:618
@ ARW_TRACKABLE_TYPE_Multimarker
Multiple square markers treated as a single marker.
Definition: ARX_c.h:621
@ ARW_TRACKABLE_TYPE_NFT
A legacy NFT marker.
Definition: ARX_c.h:622
ARX_EXTERN void arwSetTrackerOptionBool(int option, bool value)
Set boolean options associated with a tracker.
Definition: ARX_c.cpp:391
ARX_EXTERN int arwGetError()
Return error information Returns the value of the error flag.
Definition: ARX_c.cpp:110
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.
Definition: ARX_c.cpp:644
ARX_EXTERN bool arwGetVideoSourceInfoListEntry(int index, char *nameBuf, int nameBufLen, char *modelBuf, int modelBufLen, char *UIDBuf, int UIDBufLen, uint32_t *flags_p, char *openTokenBuf, int openTokenBufLen)
Get an entry from the video source info list describing the name, model, UID, flags,...
Definition: ARX_c.cpp:946
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.
Definition: ARX_c.cpp:312
ARX_EXTERN bool arwShutdownAR()
Shuts down the artoolkitX and frees all resources.
Definition: ARX_c.cpp:177
ARX_EXTERN void arwSetTrackableOptionInt(int trackableUID, int option, int value)
Set integer options associated with a trackable.
Definition: ARX_c.cpp:778
ARX_EXTERN int arwVideoPush(int videoSourceIndex, uint8_t *buf0p, int buf0Size, int buf0PixelStride, int buf0RowStride, uint8_t *buf1p, int buf1Size, int buf1PixelStride, int buf1RowStride, uint8_t *buf2p, int buf2Size, int buf2PixelStride, int buf2RowStride, uint8_t *buf3p, int buf3Size, int buf3PixelStride, int buf3RowStride)
Definition: ARX_c.cpp:338
ARX_EXTERN bool arwGetTrackerOptionBool(int option)
Get boolean options associated with a tracker.
Definition: ARX_c.cpp:457
ARX_EXTERN bool arwIsInited()
Returns true if artoolkitX is initialized and read for adding trackables.
Definition: ARX_c.cpp:165
ARX_EXTERN void arwSetTrackableOptionFloat(int trackableUID, int option, float value)
Set floating-point options associated with a trackable.
Definition: ARX_c.cpp:858
ARX_EXTERN bool arwGetProjectionMatrixForViewportSizeAndFittingMode(const int width, const int height, const int scaleMode, const int hAlign, const int vAlign, const float nearPlane, const float farPlane, float p[16])
Definition: ARX_c.cpp:225
ARX_EXTERN bool arwInitialiseAR()
Initialises the artoolkitX.
Definition: ARX_c.cpp:92
ARX_EXTERN bool arwStartRunning(const char *vconf, const char *cparaName)
Initialises and starts video capture.
Definition: ARX_c.cpp:135
ARX_EXTERN bool arwDrawVideo(const int videoSourceIndex)
Draws the latest frame from the video source in the active graphics context.
Definition: ARX_c.cpp:373
ARX_EXTERN bool arwGetProjectionMatrixForViewportSizeAndFittingModeStereo(const int width, const int height, const int scaleMode, const int hAlign, const int vAlign, const float nearPlane, const float farPlane, float pL[16], float pR[16])
Definition: ARX_c.cpp:230
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)
Definition: ARX_c.cpp:153
ARX_EXTERN float arwGetTrackableOptionFloat(int trackableUID, int option)
Get floating-point options associated with a trackable.
Definition: ARX_c.cpp:798
@ ARW_TRACKER_OPTION_SQUARE_MATRIX_MODE_AUTOCREATE_NEW_TRACKABLES_DEFAULT_WIDTH
If ARW_TRACKER_OPTION_SQUARE_MATRIX_MODE_AUTOCREATE_NEW_TRACKABLES is true, this value will be used f...
Definition: ARX_c.h:431
@ ARW_TRACKER_OPTION_SQUARE_BORDER_SIZE
float in range (0-0.5).
Definition: ARX_c.h:422
@ ARW_TRACKER_OPTION_SQUARE_MATRIX_CODE_TYPE
int.
Definition: ARX_c.h:423
@ ARW_TRACKER_OPTION_NFT_MULTIMODE
int.
Definition: ARX_c.h:417
@ ARW_TRACKER_OPTION_SQUARE_MATRIX_MODE_AUTOCREATE_NEW_TRACKABLES
If true, when the square tracker is detecting matrix (barcode) markers, new trackables will be create...
Definition: ARX_c.h:430
@ ARW_TRACKER_OPTION_SQUARE_THRESHOLD
Threshold value used for image binarization. int in range [0-255].
Definition: ARX_c.h:418
@ ARW_TRACKER_OPTION_SQUARE_PATTERN_COUNT_MAX
Maximum number of square template (pattern) markers that may be loaded at once. Defaults to AR_PATT_N...
Definition: ARX_c.h:427
@ ARW_TRACKER_OPTION_2D_MAXIMUM_MARKERS_TO_TRACK
Maximum number of markers able to be tracked simultaneously. Defaults to 1. Should not be set higher ...
Definition: ARX_c.h:429
@ ARW_TRACKER_OPTION_SQUARE_THRESHOLD_MODE
Threshold mode used for image binarization. int.
Definition: ARX_c.h:419
@ ARW_TRACKER_OPTION_SQUARE_IMAGE_PROC_MODE
int.
Definition: ARX_c.h:424
@ ARW_TRACKER_OPTION_2D_TRACKER_FEATURE_TYPE
Feature detector type used in the 2d Tracker - 0 AKAZE, 1 ORB, 2 BRISK, 3 KAZE.
Definition: ARX_c.h:428
@ 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...
Definition: ARX_c.h:425
@ ARW_TRACKER_OPTION_2D_THREADED
bool, If false, 2D tracking updates synchronously, and arwUpdateAR will not return until 2D tracking ...
Definition: ARX_c.h:432
@ ARW_TRACKER_OPTION_SQUARE_PATTERN_SIZE
Number of rows and columns in square template (pattern) markers. Defaults to AR_PATT_SIZE1,...
Definition: ARX_c.h:426
@ ARW_TRACKER_OPTION_SQUARE_PATTERN_DETECTION_MODE
int.
Definition: ARX_c.h:421
@ ARW_TRACKER_OPTION_SQUARE_LABELING_MODE
int.
Definition: ARX_c.h:420
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.
Definition: ARX_c.cpp:270
ARX_EXTERN bool arwStartRunningStereo(const char *vconfL, const char *cparaNameL, const char *vconfR, const char *cparaNameR, const char *transL2RName)
Definition: ARX_c.cpp:147
ARX_EXTERN bool arwStopRunning()
Stops video capture and frees video capture resources.
Definition: ARX_c.cpp:171
ARX_EXTERN void arwSetTrackerOptionInt(int option, int value)
Set integer options associated with a tracker.
Definition: ARX_c.cpp:411
ARX_EXTERN int arwVideoPushInit(int videoSourceIndex, int width, int height, const char *pixelFormat, int cameraIndex, int cameraPosition)
Definition: ARX_c.cpp:331
@ ARW_TRACKABLE_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION
bool, true to use continuous pose estimate.
Definition: ARX_c.h:604
@ ARW_TRACKABLE_OPTION_TYPE
readonly int enum, trackable type as per ARW_TRACKABLE_TYPE_* enum .
Definition: ARX_c.h:600
@ ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_MATRIX
float, minimum confidence value for submarker matrix tracking to be valid.
Definition: ARX_c.h:609
@ ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE_CUTOFF
float, minimum allowable confidence value used in marker matching.
Definition: ARX_c.h:606
@ ARW_TRACKABLE_OPTION_FILTER_CUTOFF_FREQ
float, cutoff frequency of filter.
Definition: ARX_c.h:603
@ ARW_TRACKABLE_OPTION_NFT_SCALE
float, scale factor applied to NFT marker size.
Definition: ARX_c.h:607
@ ARW_TRACKABLE_OPTION_FILTERED
bool, true for filtering enabled.
Definition: ARX_c.h:601
@ ARW_TRACKABLE_OPTION_SQUARE_CONFIDENCE
float, confidence value of most recent marker match
Definition: ARX_c.h:605
@ ARW_TRACKABLE_OPTION_2D_SCALE
float, 2D trackable scale (i.e. width).
Definition: ARX_c.h:613
@ ARW_TRACKABLE_OPTION_MULTI_MIN_SUBMARKERS
int, minimum number of submarkers for tracking to be valid.
Definition: ARX_c.h:608
@ ARW_TRACKABLE_OPTION_FILTER_SAMPLE_RATE
float, sample rate for filter calculations.
Definition: ARX_c.h:602
@ ARW_TRACKABLE_OPTION_MULTI_MIN_INLIER_PROB
float, minimum inlier probability value for robust multimarker pose estimation (range 1....
Definition: ARX_c.h:611
@ ARW_TRACKABLE_OPTION_SQUARE_WIDTH
float, square marker width
Definition: ARX_c.h:612
@ ARW_TRACKABLE_OPTION_MULTI_MIN_CONF_PATTERN
float, minimum confidence value for submarker pattern tracking to be valid.
Definition: ARX_c.h:610
ARX_EXTERN bool arwGetTrackableStatuses(ARWTrackableStatus *statuses, int statusesCount)
Gets status of trackables.
Definition: ARX_c.cpp:550
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.
Definition: ARX_c.cpp:366
ARX_EXTERN bool arwGetTrackableOptionBool(int trackableUID, int option)
Get boolean options associated with a trackable.
Definition: ARX_c.cpp:685
ARX_EXTERN void arwSetTrackerOptionFloat(int option, float value)
Set floating-point options associated with a tracker.
Definition: ARX_c.cpp:444
ARX_EXTERN int arwGetTrackerOptionInt(int option)
Get integer options associated with a tracker.
Definition: ARX_c.cpp:477
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 vi...
Definition: ARX_c.cpp:199
ARX_EXTERN int arwAddTrackable(const char *cfg)
Adds a trackable as specified in the given configuration string.
Definition: ARX_c.cpp:538
ARX_EXTERN bool arwUpdateAR()
Performs tracking and trackable updates.
Definition: ARX_c.cpp:300
ARX_EXTERN float arwGetTrackerOptionFloat(int option)
Get floating-point options associated with a tracker.
Definition: ARX_c.cpp:509
ARX_EXTERN void arwRegisterTrackableEventCallback(PFN_TRACKABLEEVENTCALLBACK callback)
Definition: ARX_c.cpp:531
ARX_EXTERN bool arwGetARToolKitVersion(char *buffer, int length)
Gets the artoolkitX version as a string, such as "10.0.0".
Definition: ARX_c.cpp:98
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.
Definition: ARX_c.cpp:907
ARX_EXTERN void arwSetTrackableOptionBool(int trackableUID, int option, bool value)
Set boolean options associated with a trackable.
Definition: ARX_c.cpp:709
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 eac...
Definition: ARX_c.cpp:204
ARX_EXTERN bool arwDrawVideoInit(const int videoSourceIndex)
Initialise drawing of video frames in a graphics context.
Definition: ARX_c.cpp:359
@ ARW_H_ALIGN_CENTRE
Align the centre of the video frame with the centre of the context.
Definition: ARX_c.h:176
@ ARW_H_ALIGN_LEFT
Align the left edge of the video frame with the left edge of the context.
Definition: ARX_c.h:175
@ ARW_H_ALIGN_RIGHT
Align the right edge of the video frame with the right edge of the context.
Definition: ARX_c.h:177
ARX_EXTERN int arwCreateVideoSourceInfoList(char *config)
Create a video source info list using the supplied video configuration string.
Definition: ARX_c.cpp:930
ARX_EXTERN bool arwChangeToResourcesDir(const char *resourcesDirectoryPath)
Changes the working directory to the resources directory used by artoolkitX.
Definition: ARX_c.cpp:116
ARX_EXTERN bool arwDrawVideoFinal(const int videoSourceIndex)
Finalise drawing of video frames in a graphics context.
Definition: ARX_c.cpp:380
ARX_EXTERN int arwRemoveAllTrackables()
Clears the collection of trackables.
Definition: ARX_c.cpp:581
ARX_EXTERN int arwGetTrackableCount(void)
Gets current number of trackables.
Definition: ARX_c.cpp:544
ARX_EXTERN bool arwUpdateTexture32(uint32_t *buffer)
Asks the video source to push the most recent frame into the passed-in buffer.
Definition: ARX_c.cpp:306
@ ARW_V_ALIGN_CENTRE
Align the centre of the video frame with the centre of the context.
Definition: ARX_c.h:185
@ ARW_V_ALIGN_TOP
Align the top edge of the video frame with the top edge of the context.
Definition: ARX_c.h:184
@ ARW_V_ALIGN_BOTTOM
Align the bottom edge of the video frame with the bottom edge of the context.
Definition: ARX_c.h:186
@ ARW_TRACKABLE_EVENT_TYPE_AUTOCREATED
Definition: ARX_c.h:676
@ ARW_TRACKABLE_EVENT_TYPE_AUTOREMOVED
Definition: ARX_c.h:677
@ ARW_TRACKABLE_EVENT_TYPE_NONE
Definition: ARX_c.h:675
ARX_EXTERN int arwGetTrackablePatternCount(int trackableUID)
Returns the number of pattern images associated with the specified trackable.
Definition: ARX_c.cpp:632
ARX_EXTERN bool arwStartRunningB(const char *vconf, const char *cparaBuff, const int cparaBuffLen)
Initialises and starts video capture.
Definition: ARX_c.cpp:141
ARX_EXTERN void arwDeleteVideoSourceInfoList(void)
Delete a video source info list.
Definition: ARX_c.cpp:988
ARX_EXTERN bool arwLoad2dTrackableDatabase(const char *databaseFileName)
Load a 2D trackable set from a trackable database.
ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformation(int trackableUID, float matrix[16])
Returns the visibility and pose of the specified trackable.
Definition: ARX_c.cpp:601
@ 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 gr...
Definition: ARX_c.h:196
@ ARW_SCALE_MODE_FIT
Scale the video frame proportionally up or down so that it fits visible in its entirety in the graphi...
Definition: ARX_c.h:194
@ ARW_SCALE_MODE_FILL
Scale the video frame proportionally up or down so that it fills the entire in the graphics context....
Definition: ARX_c.h:195
@ ARW_SCALE_MODE_STRETCH
Scale the video frame non-proportionally up or down so that it matches exactly the size of the graphi...
Definition: ARX_c.h:193
ARX_EXTERN void arwRegisterLogCallback(PFN_LOGCALLBACK callback)
Registers a callback function to use when a message is logged.
Definition: ARX_c.cpp:76
ARX_EXTERN bool arwCapture()
Captures a newest frame from the video source.
Definition: ARX_c.cpp:294
ARX_EXTERN bool arwIsRunning()
Returns true if artoolkitX is running, i.e.
Definition: ARX_c.cpp:159
ARX_EXTERN int arwVideoPushFinal(int videoSourceIndex)
Definition: ARX_c.cpp:349
ARX_EXTERN bool arwGetTrackablePatternImage(int trackableUID, int patternID, uint32_t *buffer)
Gets a pattern image associated with a trackable.
Definition: ARX_c.cpp:668
ARX_EXTERN void arwSetLogLevel(const int logLevel)
Definition: ARX_c.cpp:81
ARX_EXTERN bool arwQueryTrackableVisibilityAndTransformationStereo(int trackableUID, float matrixL[16], float matrixR[16])
Returns the visibility and stereo pose of the specified trackable.
Definition: ARX_c.cpp:614
ARX_EXTERN bool arwRemoveTrackable(int trackableUID)
Removes the trackable with the given unique identifier (UID).
Definition: ARX_c.cpp:575
ARX_EXTERN int arwGetTrackableOptionInt(int trackableUID, int option)
Get integer options associated with a trackable.
Definition: ARX_c.cpp:732
Defines error codes used in the ARX library.
bool visible
Definition: ARX_c.h:499
int uid
Definition: ARX_c.h:498