ARWrapper Provides a C++ wrapper around ARToolKit and exposes a C and JNI API

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator
ARToolKitWrapperExportedAPI.h
Go to the documentation of this file.
1 /*
2 * ARToolKitWrapperExportedAPI.h
3 * ARToolKit5
4 *
5 * This file is part of ARToolKit.
6 *
7 * ARToolKit is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * ARToolKit is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with ARToolKit. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2015 Daqri, LLC.
32 * Copyright 2010-2015 ARToolworks, Inc.
33 *
34 * Author(s): Philip Lamb, Julian Looser.
35 *
36 */
37
38 #ifndef ARTOOLKITWRAPPEREXPORTEDAPI_H
39 #define ARTOOLKITWRAPPEREXPORTEDAPI_H
40
41 #include <ARWrapper/Platform.h>
42 #include <ARWrapper/Image.h>
43 #include <ARWrapper/Error.h>
44
50 extern "C" {
51
57 EXPORT_API void arwRegisterLogCallback(PFN_LOGCALLBACK callback);
58
59 // ----------------------------------------------------------------------------------------------------
60 #pragma mark ARToolKit lifecycle functions
61 // ----------------------------------------------------------------------------------------------------
68 EXPORT_API bool arwInitialiseAR();
69
77 EXPORT_API bool arwInitialiseARWithOptions(const int pattSize, const int pattCountMax);
78
86 EXPORT_API bool arwGetARToolKitVersion(char *buffer, int length);
87
109 EXPORT_API int arwGetError();
110
117 EXPORT_API bool arwChangeToResourcesDir(const char *resourcesDirectoryPath);
118
128 EXPORT_API bool arwStartRunning(const char *vconf, const char *cparaName, const float nearPlane, const float farPlane);
129
140 EXPORT_API bool arwStartRunningB(const char *vconf, const char *cparaBuff, const int cparaBuffLen, const float nearPlane, const float farPlane);
141
142 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);
143
144 EXPORT_API 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, const float nearPlane, const float farPlane);
145
150 EXPORT_API bool arwIsRunning();
151
157 EXPORT_API bool arwStopRunning();
158
167 EXPORT_API bool arwShutdownAR();
168
169 // ----------------------------------------------------------------------------------------------------
170 #pragma mark Video stream management
171 // ----------------------------------------------------------------------------------------------------
172
178 EXPORT_API bool arwGetProjectionMatrix(float p[16]);
179
186 EXPORT_API bool arwGetProjectionMatrixStereo(float pL[16], float pR[16]);
187
198 EXPORT_API bool arwGetVideoParams(int *width, int *height, int *pixelSize, char *pixelFormatStringBuffer, int pixelFormatStringBufferLen);
199
215 EXPORT_API bool arwGetVideoParamsStereo(int *widthL, int *heightL, int *pixelSizeL, char *pixelFormatStringBufferL, int pixelFormatStringBufferLenL, int *widthR, int *heightR, int *pixelSizeR, char *pixelFormatStringBufferR, int pixelFormatStringBufferLenR);
216
221 EXPORT_API bool arwCapture();
222
228 EXPORT_API bool arwUpdateAR();
229
235 EXPORT_API bool arwUpdateTexture(Color *buffer);
236
237 EXPORT_API bool arwUpdateTexture32(unsigned int *buffer);
238
239 EXPORT_API bool arwUpdateTextureStereo(Color *bufferL, Color *bufferR);
240
241 EXPORT_API bool arwUpdateTexture32Stereo(unsigned int *bufferL, unsigned int *bufferR);
242
250 EXPORT_API void arwSetVideoDebugMode(bool debug);
251
257 EXPORT_API bool arwGetVideoDebugMode();
258
264 EXPORT_API bool arwUpdateDebugTexture(Color *buffer);
265
266
273 EXPORT_API bool arwUpdateDebugTexture32(unsigned int *buffer);
274
275 #if !TARGET_PLATFORM_WINRT
276
281 EXPORT_API bool arwUpdateTextureGL(const int textureID);
282
283 EXPORT_API bool arwUpdateTextureGLStereo(const int textureID_L, const int textureID_R);
284 #endif // !TARGET_PLATFORM_WINRT
285
286 // ----------------------------------------------------------------------------------------------------
287 #pragma mark Unity-specific API
288 // ----------------------------------------------------------------------------------------------------
289
290 enum {
291 ARW_UNITY_RENDER_EVENTID_NOP = 0, // No operation (does nothing).
292 #if !TARGET_PLATFORM_WINRT
293 ARW_UNITY_RENDER_EVENTID_UPDATE_TEXTURE_GL = 1,
294 ARW_UNITY_RENDER_EVENTID_UPDATE_TEXTURE_GL_STEREO = 2,
295 #endif // !TARGET_PLATFORM_WINRT
296 };
297
305 EXPORT_API void UnityRenderEvent(int eventID);
306
307 #if !TARGET_PLATFORM_WINRT
308
313 EXPORT_API void arwSetUnityRenderEventUpdateTextureGLTextureID(int textureID);
314
315 EXPORT_API void arwSetUnityRenderEventUpdateTextureGLStereoTextureIDs(int textureID_L, int textureID_R);
316 #endif // !TARGET_PLATFORM_WINRT
317
318 // ----------------------------------------------------------------------------------------------------
319 #pragma mark Tracking configuration
320 // ----------------------------------------------------------------------------------------------------
326 EXPORT_API void arwSetVideoThreshold(int threshold);
327
333 EXPORT_API int arwGetVideoThreshold();
334
340 EXPORT_API void arwSetVideoThresholdMode(int mode);
341
347 EXPORT_API int arwGetVideoThresholdMode();
348
349 EXPORT_API void arwSetLabelingMode(int mode);
350
351 EXPORT_API int arwGetLabelingMode();
352
353 EXPORT_API void arwSetPatternDetectionMode(int mode);
354
355 EXPORT_API int arwGetPatternDetectionMode();
356
357 EXPORT_API void arwSetBorderSize(float size);
358
359 EXPORT_API float arwGetBorderSize();
360
361 EXPORT_API void arwSetMatrixCodeType(int type);
362
363 EXPORT_API int arwGetMatrixCodeType();
364
365 EXPORT_API void arwSetImageProcMode(int mode);
366
367 EXPORT_API int arwGetImageProcMode();
368
369 EXPORT_API void arwSetNFTMultiMode(bool on);
370
371 EXPORT_API bool arwGetNFTMultiMode();
372
373 // ----------------------------------------------------------------------------------------------------
374 #pragma mark Marker management
375 // ----------------------------------------------------------------------------------------------------
385 EXPORT_API int arwAddMarker(const char *cfg);
386
392 EXPORT_API bool arwRemoveMarker(int markerUID);
393
398 EXPORT_API int arwRemoveAllMarkers();
399
406 EXPORT_API bool arwQueryMarkerVisibility(int markerUID);
407
417 EXPORT_API bool arwQueryMarkerTransformation(int markerUID, float matrix[16]);
418
429 EXPORT_API bool arwQueryMarkerTransformationStereo(int markerUID, float matrixL[16], float matrixR[16]);
430
438 EXPORT_API int arwGetMarkerPatternCount(int markerUID);
439
451 EXPORT_API bool arwGetMarkerPatternConfig(int markerUID, int patternID, float matrix[16], float *width, float *height, int *imageSizeX, int *imageSizeY);
452
463 EXPORT_API bool arwGetMarkerPatternImage(int markerUID, int patternID, Color *buffer);
464
468 enum {
469 ARW_MARKER_OPTION_FILTERED = 1,
470 ARW_MARKER_OPTION_FILTER_SAMPLE_RATE = 2,
471 ARW_MARKER_OPTION_FILTER_CUTOFF_FREQ = 3,
472 ARW_MARKER_OPTION_SQUARE_USE_CONT_POSE_ESTIMATION = 4,
473 ARW_MARKER_OPTION_SQUARE_CONFIDENCE = 5,
474 ARW_MARKER_OPTION_SQUARE_CONFIDENCE_CUTOFF = 6,
475 ARW_MARKER_OPTION_NFT_SCALE = 7
476 };
477
484 EXPORT_API void arwSetMarkerOptionBool(int markerUID, int option, bool value);
485
492 EXPORT_API void arwSetMarkerOptionInt(int markerUID, int option, int value);
493
500 EXPORT_API void arwSetMarkerOptionFloat(int markerUID, int option, float value);
501
508 EXPORT_API bool arwGetMarkerOptionBool(int markerUID, int option);
509
516 EXPORT_API int arwGetMarkerOptionInt(int markerUID, int option);
517
524 EXPORT_API float arwGetMarkerOptionFloat(int markerUID, int option);
525
526 // ----------------------------------------------------------------------------------------------------
527 #pragma mark Utility
528 // ----------------------------------------------------------------------------------------------------
550 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]);
551 }
552
553 #endif // !ARTOOLKITWRAPPEREXPORTEDAPI_H