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::shared_ptr<ARTrackerSquare> m_squareTracker;
110 std::shared_ptr<ARTrackerNFT> m_nftTracker;
113 std::shared_ptr<ARTracker2d> m_twoDTracker;
117 void setError(
int error);
120#pragma mark Public API
151 std::shared_ptr<ARTrackerNFT> getNFTTracker() {
return m_nftTracker; };
154 std::shared_ptr<ARTracker2d> get2dTracker() {
return m_twoDTracker; };
172 bool startRunning(
const char* vconf,
const char* cparaName,
const char* cparaBuff,
const long cparaBuffLen);
189 bool startRunningStereo(
const char* vconfL,
const char* cparaNameL,
const char* cparaBuffL,
const long cparaBuffLenL,
190 const char* vconfR,
const char* cparaNameR,
const char* cparaBuffR,
const long cparaBuffLenR,
191 const char* transL2RName,
const char* transL2RBuff,
const long transL2RBuffLen);
193 int videoPushInit(
int videoSourceIndex,
int width,
int height,
const char *pixelFormat,
int cameraIndex,
int cameraPosition);
195 ARUint8 *buf0p,
int buf0Size,
int buf0PixelStride,
int buf0RowStride,
196 ARUint8 *buf1p,
int buf1Size,
int buf1PixelStride,
int buf1RowStride,
197 ARUint8 *buf2p,
int buf2Size,
int buf2PixelStride,
int buf2RowStride,
198 ARUint8 *buf3p,
int buf3Size,
int buf3PixelStride,
int buf3RowStride);
211 bool videoParameters(
const int videoSourceIndex,
int *width,
int *height, AR_PIXEL_FORMAT *pixelFormat);
263 bool drawVideo(
const int videoSourceIndex);
401 bool load2DTrackerImageDatabase(
const char* databaseFileName);
408 bool save2DTrackerImageDatabase(
const char* databaseFileName);
artoolkitX core routines.
unsigned char ARUint8
Definition: ar.h:92
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:800
bool startRunning(const char *vconf, const char *cparaName, const char *cparaBuff, const long cparaBuffLen)
Start video capture and tracking.
Definition: ARController.cpp:157
int addTrackable(const std::string &cfgs)
Adds a trackable as specified in the given configuration string.
Definition: ARController.cpp:643
int videoPushFinal(int videoSourceIndex)
Definition: ARController.cpp:890
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:497
int removeAllTrackables()
Clears the collection of trackables.
Definition: ARController.cpp:719
bool getPatternImage(int patternID, uint32_t *buffer)
Populates the provided color buffer with the image for the specified pattern.
std::vector< std::shared_ptr< ARTrackable > > getAllTrackables()
Returns all trackables.
Definition: ARController.cpp:782
int videoPushInit(int videoSourceIndex, int width, int height, const char *pixelFormat, int cameraIndex, int cameraPosition)
Definition: ARController.cpp:844
bool isRunning()
Returns true if video capture and tracking is running.
Definition: ARController.cpp:620
bool projectionForViewportSizeAndFittingMode(const int videoSourceIndex, const ARVideoSource::Size viewportSize, const ARVideoSource::ScalingMode scalingMode, const ARdouble projectionNearPlane, const ARdouble projectionFarPlane, ARdouble proj[16])
Populates the provided array with the ARToolKit projection matrix, so that the projection maps to the...
Definition: ARController.cpp:588
unsigned int countTrackables(ARTrackable::TrackableType trackableType) const
Returns the number of currently loaded trackables of the specified type.
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:76
bool stopRunning()
Video capture and tracking stops, but trackables are still valid and can be configured.
Definition: ARController.cpp:397
bool isInited()
Report whether artoolkit was initialized and a trackable can be added.
Definition: ARController.cpp:614
bool drawVideo(const int videoSourceIndex)
Definition: ARController.cpp:526
std::shared_ptr< ARTrackerSquare > getSquareTracker()
Definition: ARController.h:149
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:291
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:562
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:195
bool initialiseBase()
Start trackable management so trackables can be added and removed.
Definition: ARController.cpp:108
bool capture()
Requests the capture of a new frame from the video source(s).
Definition: ARController.cpp:270
unsigned int countTrackables() const
Returns the number of currently loaded trackables.
Definition: ARController.cpp:735
bool shutdown()
Stop, if running.
Definition: ARController.cpp:434
ARController()
Constructor.
Definition: ARController.cpp:63
bool update()
Performs tracking and updates all trackables.
Definition: ARController.cpp:304
bool drawVideoFinal(const int videoSourceIndex)
Definition: ARController.cpp:541
const char * getARToolKitVersion()
Returns a string containing the artoolkitX version, such as "10.0.0".
Definition: ARController.cpp:82
int videoPush(int videoSourceIndex, ARUint8 *buf0p, int buf0Size, int buf0PixelStride, int buf0RowStride, ARUint8 *buf1p, int buf1Size, int buf1PixelStride, int buf1RowStride, ARUint8 *buf2p, int buf2Size, int buf2PixelStride, int buf2RowStride, ARUint8 *buf3p, int buf3Size, int buf3PixelStride, int buf3RowStride)
Definition: ARController.cpp:865
int getError()
Definition: ARController.cpp:95
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:625
bool drawVideoInit(const int videoSourceIndex)
Definition: ARController.cpp:477
bool removeTrackable(int UID)
Removes the trackable with the given ID.
Definition: ARController.cpp:689
std::shared_ptr< ARTrackable > findTrackable(int UID)
Searches the collection of trackables for the given ID.
Definition: ARController.cpp:764
TrackableType
Definition: ARTrackable.h:78
A video source provides video frames to the artoolkitX tracking module.
Definition: ARVideoSource.h:53
ScalingMode
Definition: ARVideoSource.h:138
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
Definition: ARVideoSource.h:133