69# define pthread_mutex_t CRITICAL_SECTION
70# define pthread_mutex_init(pm, a) InitializeCriticalSectionEx(pm, 4000, CRITICAL_SECTION_NO_DEBUG_INFO)
71# define pthread_mutex_lock(pm) EnterCriticalSection(pm)
72# define pthread_mutex_unlock(pm) LeaveCriticalSection(pm)
73# define pthread_mutex_destroy(pm) DeleteCriticalSection(pm)
83#pragma mark Private types and instance variables
96 bool stateWaitingMessageLogged;
103 bool m_videoSourceIsStereo;
108 std::vector<ARTrackable *> m_trackables;
110 bool doSquareMarkerDetection;
111 std::shared_ptr<ARTrackerSquare> m_squareTracker;
113 bool doNFTMarkerDetection;
114 std::shared_ptr<ARTrackerNFT> m_nftTracker;
117 bool doTwoDMarkerDetection;
118 std::shared_ptr<ARTracker2d> m_twoDTracker;
121 void setError(
int error);
123#pragma mark Private methods.
148#pragma mark Public API
179 std::shared_ptr<ARTrackerNFT> getNFTTracker() {
return m_nftTracker; };
182 std::shared_ptr<ARTracker2d> get2dTracker() {
return m_twoDTracker; };
200 bool startRunning(
const char* vconf,
const char* cparaName,
const char* cparaBuff,
const long cparaBuffLen);
217 bool startRunningStereo(
const char* vconfL,
const char* cparaNameL,
const char* cparaBuffL,
const long cparaBuffLenL,
218 const char* vconfR,
const char* cparaNameR,
const char* cparaBuffR,
const long cparaBuffLenR,
219 const char* transL2RName,
const char* transL2RBuff,
const long transL2RBuffLen);
221#if ARX_TARGET_PLATFORM_ANDROID
222 jint androidVideoPushInit(JNIEnv *env, jobject obj, jint videoSourceIndex, jint width, jint height,
const char *pixelFormat, jint camera_index, jint camera_face);
223 jint androidVideoPush1(JNIEnv *env, jobject obj, jint videoSourceIndex, jbyteArray buf, jint bufSize);
224 jint androidVideoPush2(JNIEnv *env, jobject obj, jint videoSourceIndex,
225 jobject buf0, jint buf0PixelStride, jint buf0RowStride,
226 jobject buf1, jint buf1PixelStride, jint buf1RowStride,
227 jobject buf2, jint buf2PixelStride, jint buf2RowStride,
228 jobject buf3, jint buf3PixelStride, jint buf3RowStride);
229 jint androidVideoPushFinal(JNIEnv *env, jobject obj, jint videoSourceIndex);
242 bool videoParameters(
const int videoSourceIndex,
int *width,
int *height, AR_PIXEL_FORMAT *pixelFormat);
279 bool drawVideo(
const int videoSourceIndex);
297 int addTrackable(
const std::string& cfgs);
304 bool removeTrackable(
int UID);
418 bool load2DTrackerImageDatabase(
const char* databaseFileName);
425 bool save2DTrackerImageDatabase(
const char* databaseFileName);
artoolkitX core routines.
double ARdouble
Definition: ar.h:99
Wrapper for artoolkitX functionality.
Definition: ARController.h:80
bool loadOpticalParams(const char *optical_param_name, const char *optical_param_buff, const long optical_param_buffLen, const ARdouble projectionNearPlane, const ARdouble projectionFarPlane, ARdouble *fovy_p, ARdouble *aspect_p, ARdouble m[16], ARdouble p[16])
Loads an optical parameters structure from file or from buffer.
Definition: ARController.cpp:855
bool startRunning(const char *vconf, const char *cparaName, const char *cparaBuff, const long cparaBuffLen)
Start video capture and tracking.
Definition: ARController.cpp:165
bool drawVideoSettings(const int videoSourceIndex, const int width, const int height, const bool rotate90, const bool flipH, const bool flipV, const ARVideoView::HorizontalAlignment hAlign, const ARVideoView::VerticalAlignment vAlign, const ARVideoView::ScalingMode scalingMode, int32_t viewport[4])
Definition: ARController.cpp:505
int removeAllTrackables()
Clears the collection of trackables.
Definition: ARController.cpp:768
ARTrackable * findTrackable(int UID)
Searches the collection of trackables for the given ID.
Definition: ARController.cpp:840
bool getPatternImage(int patternID, uint32_t *buffer)
Populates the provided color buffer with the image for the specified pattern.
bool isRunning()
Returns true if video capture and tracking is running.
Definition: ARController.cpp:601
bool updateDebugTexture32(const int videoSourceIndex, uint32_t *buffer)
Populates the provided buffer with the current contents of the debug image.
~ARController()
Destructor.
Definition: ARController.cpp:84
bool stopRunning()
Video capture and tracking stops, but trackables are still valid and can be configured.
Definition: ARController.cpp:405
bool isInited()
Report whether artoolkit was initialized and a trackable can be added.
Definition: ARController.cpp:595
bool drawVideo(const int videoSourceIndex)
Definition: ARController.cpp:534
std::shared_ptr< ARTrackerSquare > getSquareTracker()
Definition: ARController.h:177
bool updateTextureRGBA32(const int videoSourceIndex, uint32_t *buffer)
Asks the video source to push the most recent frame into the passed-in buffer.
Definition: ARController.cpp:299
bool projectionMatrix(const int videoSourceIndex, const ARdouble projectionNearPlane, const ARdouble projectionFarPlane, ARdouble proj[16])
Populates the provided array with the ARToolKit projection matrix.
Definition: ARController.cpp:570
bool startRunningStereo(const char *vconfL, const char *cparaNameL, const char *cparaBuffL, const long cparaBuffLenL, const char *vconfR, const char *cparaNameR, const char *cparaBuffR, const long cparaBuffLenR, const char *transL2RName, const char *transL2RBuff, const long transL2RBuffLen)
Start stereo video capture and tracking.
Definition: ARController.cpp:203
bool initialiseBase()
Start trackable management so trackables can be added and removed.
Definition: ARController.cpp:116
bool capture()
Requests the capture of a new frame from the video source(s).
Definition: ARController.cpp:278
unsigned int countTrackables() const
Returns the number of currently loaded trackables.
Definition: ARController.cpp:794
bool shutdown()
Stop, if running.
Definition: ARController.cpp:442
ARController()
Constructor.
Definition: ARController.cpp:63
bool update()
Performs tracking and updates all trackables.
Definition: ARController.cpp:312
bool drawVideoFinal(const int videoSourceIndex)
Definition: ARController.cpp:549
const char * getARToolKitVersion()
Returns a string containing the artoolkitX version, such as "10.0.0".
Definition: ARController.cpp:90
ARTrackable * getTrackableAtIndex(unsigned int index)
Returns the trackable at the specified index.
Definition: ARController.cpp:834
int getError()
Definition: ARController.cpp:103
bool videoParameters(const int videoSourceIndex, int *width, int *height, AR_PIXEL_FORMAT *pixelFormat)
Reports width, height and pixel format of a video source.
Definition: ARController.cpp:606
bool drawVideoInit(const int videoSourceIndex)
Definition: ARController.cpp:485
Base class for supported trackable types.
Definition: ARTrackable.h:54
TrackableType
Definition: ARTrackable.h:78
A video source provides video frames to the artoolkitX tracking module.
Definition: ARVideoSource.h:53
ARVideoView draws the output of an ARVideoSource to a rendering context, usually for the purposes of ...
Definition: ARVideoView.h:55
HorizontalAlignment
Definition: ARVideoView.h:63
ScalingMode
Definition: ARVideoView.h:73
VerticalAlignment
Definition: ARVideoView.h:68
A structure to hold a timestamp in seconds and microseconds, with arbitrary epoch.
Definition: ar.h:139