ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
arg.h
Go to the documentation of this file.
1/*
2 * arg.h
3 * artoolkitX
4 *
5 * Graphics Subroutines for artoolkitX.
6 *
7 * This file is part of artoolkitX.
8 *
9 * artoolkitX is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * artoolkitX is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * As a special exception, the copyright holders of this library give you
23 * permission to link this library with independent modules to produce an
24 * executable, regardless of the license terms of these independent modules, and to
25 * copy and distribute the resulting executable under terms of your choice,
26 * provided that you also meet, for each linked independent module, the terms and
27 * conditions of the license of that module. An independent module is a module
28 * which is neither derived from nor based on this library. If you modify this
29 * library, you may extend this exception to your version of the library, but you
30 * are not obligated to do so. If you do not wish to do so, delete this exception
31 * statement from your version.
32 *
33 * Copyright 2018 Realmax, Inc.
34 * Copyright 2015 Daqri, LLC.
35 * Copyright 2011-2015 ARToolworks, Inc.
36 *
37 * Author(s): Philip Lamb
38 *
39 */
40
61#ifndef __arg_h__
62#define __arg_h__
63
64// ============================================================================
65// Public includes.
66// ============================================================================
67
68#include <ARX/AR/ar.h> // ARUint8, AR_PIXEL_FORMAT, ARParam, arParamObserv2Ideal()
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74// ============================================================================
75// Public types and definitions.
76// ============================================================================
77
78#ifdef _WIN32
79# ifdef ARG_STATIC
80# define ARG_EXTERN
81# else
82# ifdef ARX_EXPORTS
83# define ARG_EXTERN __declspec(dllexport)
84# else
85# define ARG_EXTERN __declspec(dllimport)
86# endif
87# endif
88#else
89# define ARG_EXTERN
90#endif
91
116
120typedef enum {
126
127// ============================================================================
128// Public functions.
129// ============================================================================
130
163ARG_EXTERN ARGL_CONTEXT_SETTINGS_REF arglSetupForCurrentContext(const ARParam *cparam, AR_PIXEL_FORMAT pixelFormat);
164
179
180
195
228ARG_EXTERN void arglDispImage(ARGL_CONTEXT_SETTINGS_REF contextSettings, int32_t viewport[4]);
229
249
264
272
279ARG_EXTERN int arglGetPixelZoom(ARGL_CONTEXT_SETTINGS_REF contextSettings, float *zoom);
280
299ARG_EXTERN int arglPixelFormatSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT format);
300
314ARG_EXTERN int arglPixelFormatGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT *format, int *size);
315
330
348
350ARG_EXTERN void arglSetFlipH(ARGL_CONTEXT_SETTINGS_REF contextSettings, int flipH);
352ARG_EXTERN void arglSetFlipV(ARGL_CONTEXT_SETTINGS_REF contextSettings, int flipV);
353
376ARG_EXTERN int arglPixelBufferSizeSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int bufWidth, int bufHeight);
377
388ARG_EXTERN int arglPixelBufferSizeGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int *bufWidth, int *bufHeight);
389
432ARG_EXTERN int arglPixelBufferDataUploadBiPlanar(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARUint8 *bufDataPtr0, ARUint8 *bufDataPtr1);
433#define arglPixelBufferDataUpload(contextSettings,bufDataPtr) arglPixelBufferDataUploadBiPlanar(contextSettings,bufDataPtr,NULL)
434
456ARG_EXTERN int arglGLCapabilityCheck(ARGL_CONTEXT_SETTINGS_REF contextSettings, const uint16_t minVersion, const unsigned char *extension);
457
458#ifdef __cplusplus
459}
460#endif
461
462#endif // !__arg_h__
artoolkitX core routines.
unsigned char ARUint8
Definition: ar.h:92
ARG_EXTERN ARGL_CONTEXT_SETTINGS_REF arglSetupForCurrentContext(const ARParam *cparam, AR_PIXEL_FORMAT pixelFormat)
Initialise the arg library for the current OpenGL context.
Definition: arg.c:146
ARG_EXTERN int arglPixelBufferSizeGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int *bufWidth, int *bufHeight)
Query the size of pixel data buffers expected by arglPixelBufferDataUpload().
Definition: arg.c:429
ARG_EXTERN int arglSetPixelZoom(ARGL_CONTEXT_SETTINGS_REF contextSettings, float zoom)
Set the current video image drawing scalefactor.
Definition: arg.c:263
ARG_EXTERN int arglGetFlipV(ARGL_CONTEXT_SETTINGS_REF contextSettings)
Definition: arg.c:407
ARG_API
Underlying rendering API being used in implementation.
Definition: arg.h:120
@ ARG_API_GL
OpenGL 1.5 or later.
Definition: arg.h:122
@ ARG_API_None
No API currently selected.
Definition: arg.h:121
@ ARG_API_GLES2
OpenGL ES 2.0 or later.
Definition: arg.h:124
@ ARG_API_GL3
OpenGL 3.1 or later.
Definition: arg.h:123
ARG_EXTERN int arglPixelFormatSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT format)
Set the format of pixel data which will be passed to arglDispImage*()
Definition: arg.c:288
ARG_EXTERN void arglSetFlipV(ARGL_CONTEXT_SETTINGS_REF contextSettings, int flipV)
Definition: arg.c:382
ARG_EXTERN void arglCleanup(ARGL_CONTEXT_SETTINGS_REF contextSettings)
Free memory used by arg associated with the specified context.
Definition: arg.c:207
ARG_EXTERN int arglGLCapabilityCheck(ARGL_CONTEXT_SETTINGS_REF contextSettings, const uint16_t minVersion, const unsigned char *extension)
Checks for the presence of an OpenGL capability by version or extension.
Definition: arg.c:461
struct _ARGL_CONTEXT_SETTINGS * ARGL_CONTEXT_SETTINGS_REF
Opaque type to hold ARGL settings for a given OpenGL context.
Definition: arg.h:115
ARG_EXTERN int arglSetupDebugMode(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARHandle *arHandle)
Provide an ARHandle structure from which to extract information about debug mode.
Definition: arg.c:201
ARG_EXTERN void arglSetRotate90(ARGL_CONTEXT_SETTINGS_REF contextSettings, int rotate90)
Set or unset a 90 degree rotation in all OpenGL drawing performed by ARGL.
Definition: arg.c:320
ARG_EXTERN int arglGetFlipH(ARGL_CONTEXT_SETTINGS_REF contextSettings)
Definition: arg.c:376
#define ARG_EXTERN
Definition: arg.h:89
ARG_EXTERN int arglPixelFormatGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, AR_PIXEL_FORMAT *format, int *size)
Get the format of pixel data in which arglDispImage*() is expecting data to be passed.
Definition: arg.c:304
ARG_EXTERN int arglDistortionCompensationGet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int *enable)
Enquire as to the enable state of camera lens distortion compensation in arglDispImage.
Definition: arg.c:256
ARG_EXTERN int arglGetRotate90(ARGL_CONTEXT_SETTINGS_REF contextSettings)
Find out whether ARGL is rotating all OpenGL drawing by 90 degrees.
Definition: arg.c:345
ARG_EXTERN void arglSetFlipH(ARGL_CONTEXT_SETTINGS_REF contextSettings, int flipH)
Definition: arg.c:351
ARG_EXTERN int arglPixelBufferDataUploadBiPlanar(ARGL_CONTEXT_SETTINGS_REF contextSettings, ARUint8 *bufDataPtr0, ARUint8 *bufDataPtr1)
Upload a buffer of pixel data to an OpenGL texture for later use by arglDispImage().
Definition: arg.c:445
ARG_EXTERN int arglDistortionCompensationSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int enable)
Set compensation for camera lens distortion in arglDispImage to off or on.
Definition: arg.c:239
ARG_EXTERN int arglGetPixelZoom(ARGL_CONTEXT_SETTINGS_REF contextSettings, float *zoom)
Retrieve the current video image drawing scalefactor.
Definition: arg.c:281
ARG_EXTERN int arglPixelBufferSizeSet(ARGL_CONTEXT_SETTINGS_REF contextSettings, int bufWidth, int bufHeight)
Specify a desired pixel buffer size larger than the camera image size.
Definition: arg.c:413
ARG_EXTERN void arglDispImage(ARGL_CONTEXT_SETTINGS_REF contextSettings, int32_t viewport[4])
Display an ARVideo image, by drawing it using OpenGL.
Definition: arg.c:224
Definition: arg_private.h:48
int flipH
Definition: arg_private.h:56
int flipV
Definition: arg_private.h:57
float zoom
Definition: arg_private.h:53
int rotate90
Definition: arg_private.h:55
Structure holding state of an instance of the square marker tracker.
Definition: ar.h:341
Structure holding camera parameters, including image size, projection matrix and lens distortion para...
Definition: param.h:99