Skip to content

Commit b485deb

Browse files
committed
Convert to artoolkitX.
1 parent aebb531 commit b485deb

File tree

94 files changed

+1217
-937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1217
-937
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
depends/ios/include/AR6/
2-
depends/ios/lib/libAR6.a
3-
depends/macos/Frameworks/AR6.framework/
1+
depends/ios/include/ARX/
2+
depends/ios/lib/libARX.a
3+
depends/macos/Frameworks/ARX.framework/
44
Linux/build/
55
iOS/build/
66
macOS/build/

Calibration.cpp

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
/*
22
* Calibration.cpp
3-
* ARToolKit6 Camera Calibration Utility
3+
* artoolkitX Camera Calibration Utility
44
*
5-
* This file is part of ARToolKit.
5+
* This file is part of artoolkitX.
66
*
7-
* Copyright 2015-2017 Daqri, LLC.
8-
* Copyright 2002-2015 ARToolworks, Inc.
7+
* artoolkitX 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.
911
*
10-
* Author(s): Hirokazu Kato, Philip Lamb
12+
* artoolkitX 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.
1116
*
12-
* Licensed under the Apache License, Version 2.0 (the "License");
13-
* you may not use this file except in compliance with the License.
14-
* You may obtain a copy of the License at
17+
* You should have received a copy of the GNU Lesser General Public License
18+
* along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
1519
*
16-
* http://www.apache.org/licenses/LICENSE-2.0
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.
1730
*
18-
* Unless required by applicable law or agreed to in writing, software
19-
* distributed under the License is distributed on an "AS IS" BASIS,
20-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21-
* See the License for the specific language governing permissions and
22-
* limitations under the License.
31+
* Copyright 2018 Realmax, Inc.
32+
* Copyright 2015-2017 Daqri, LLC.
33+
* Copyright 2002-2015 ARToolworks, Inc.
34+
*
35+
* Author(s): Hirokazu Kato, Philip Lamb
2336
*
2437
*/
2538

@@ -238,12 +251,12 @@ bool Calibration::capture()
238251
pthread_mutex_unlock(&m_cornerFinderResultLock);
239252

240253
if (saved) {
241-
ARLOG("---------- %2d/%2d -----------\n", (int)m_corners.size(), m_calibImageCountMax);
254+
ARPRINT("---------- %2d/%2d -----------\n", (int)m_corners.size(), m_calibImageCountMax);
242255
const std::vector<cv::Point2f>& corners = m_corners.back();
243256
for (std::vector<cv::Point2f>::const_iterator it = corners.begin(); it < corners.end(); it++) {
244-
ARLOG(" %f, %f\n", it->x, it->y);
257+
ARPRINT(" %f, %f\n", it->x, it->y);
245258
}
246-
ARLOG("---------- %2d/%2d -----------\n", (int)m_corners.size(), m_calibImageCountMax);
259+
ARPRINT("---------- %2d/%2d -----------\n", (int)m_corners.size(), m_calibImageCountMax);
247260
}
248261

249262
return (saved);

Calibration.hpp

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
11
/*
22
* Calibration.hpp
3-
* ARToolKit6 Camera Calibration Utility
3+
* artoolkitX Camera Calibration Utility
44
*
5-
* This file is part of ARToolKit.
5+
* This file is part of artoolkitX.
66
*
7-
* Copyright 2015-2017 Daqri, LLC.
8-
* Copyright 2002-2015 ARToolworks, Inc.
7+
* artoolkitX 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.
911
*
10-
* Author(s): Hirokazu Kato, Philip Lamb
12+
* artoolkitX 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.
1116
*
12-
* Licensed under the Apache License, Version 2.0 (the "License");
13-
* you may not use this file except in compliance with the License.
14-
* You may obtain a copy of the License at
17+
* You should have received a copy of the GNU Lesser General Public License
18+
* along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
1519
*
16-
* http://www.apache.org/licenses/LICENSE-2.0
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.
1730
*
18-
* Unless required by applicable law or agreed to in writing, software
19-
* distributed under the License is distributed on an "AS IS" BASIS,
20-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21-
* See the License for the specific language governing permissions and
22-
* limitations under the License.
31+
* Copyright 2018 Realmax, Inc.
32+
* Copyright 2015-2017 Daqri, LLC.
33+
* Copyright 2002-2015 ARToolworks, Inc.
34+
*
35+
* Author(s): Hirokazu Kato, Philip Lamb
2336
*
2437
*/
2538

2639
#pragma once
2740

28-
#include <AR6/AR/ar.h>
41+
#include <ARX/AR/ar.h>
2942
#include <opencv2/core/core.hpp>
30-
#include <AR6/ARVideoSource.h>
43+
#include <ARX/ARVideoSource.h>
3144
#include <map>
3245

33-
#include <AR6/ARUtil/thread_sub.h>
46+
#include <ARX/ARUtil/thread_sub.h>
3447

3548
class Calibration
3649
{

Eden/Eden.h

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// (i.e., implicitly included from every source file.)
77
//
88
// Copyright (c) 2001-2016 Philip Lamb (PRL) [email protected]. All rights reserved.
9-
//
9+
//
1010
//
1111

1212
// @@BEGIN_EDEN_LICENSE_HEADER@@
@@ -50,15 +50,15 @@
5050
#include <stdio.h>
5151
#ifndef _WIN32 // errno is defined in stdlib.h on Windows.
5252
# include <sys/errno.h>
53-
#endif
53+
#endif
5454
#ifdef __ANDROID__
5555
# include <android/log.h>
5656
#endif
5757

5858
#ifdef __cplusplus
5959
extern "C" {
6060
#endif
61-
61+
6262
#ifdef __ANDROID__
6363
# define EDEN_LOG(...) __android_log_print(ANDROID_LOG_INFO, "libeden", __VA_ARGS__);
6464
# define EDEN_LOGe(...) __android_log_print(ANDROID_LOG_ERROR, "libeden", __VA_ARGS__);
@@ -74,7 +74,7 @@ extern "C" {
7474
// byte-aligned.)
7575
// I don't know how to do this in compilers other than GCC at the moment.
7676
#if defined(__GNUC__)
77-
# if defined(__BIG_ENDIAN__)
77+
# if defined(__BIG_ENDIAN__)
7878
# define EDEN_BIGENDIAN // Most Significant Byte has greatest address in memory.
7979
# endif
8080
# define EDEN_INLINE_H extern inline
@@ -83,7 +83,7 @@ extern "C" {
8383
#else
8484
# define EDEN_PACKED
8585
#endif
86-
86+
8787
// GCC on Mac OS X.
8888
#if defined(__APPLE__)
8989
# define EDEN_UNIX
@@ -97,12 +97,16 @@ extern "C" {
9797
# else
9898
# error
9999
# endif
100-
100+
101101
# if TARGET_OS_IPHONE
102102
# define EDEN_IPHONEOS
103+
# define EDEN_USE_GL 0
103104
# define EDEN_USE_GLES2 1
105+
# define EDNE_USE_GL3 0
104106
# else
105107
# define EDEN_USE_GL 1
108+
# define EDEN_USE_GLES2 0
109+
# define EDEN_USE_GL3 0
106110
# endif
107111

108112
# if !defined(DARWINONLY) && !TARGET_OS_IPHONE
@@ -125,24 +129,38 @@ extern "C" {
125129
# ifndef ANDROID
126130
# define ANDROID
127131
# endif
132+
# define EDEN_USE_GL 0
128133
# define EDEN_USE_GLES2 1
134+
# define EDEN_USE_GL3 0
129135

130136
// GCC on Cygnus GNU for Windows.
131137
#elif defined(__CYGWIN__)
132138
# define EDEN_UNIX // Its a Unix system too!
133139
# define EDEN_SERIAL_POSIX_ONLY // Use only POSIX-compliant serial calls.
134140
# define EDEN_USE_GL 1
141+
# define EDEN_USE_GLES2 0
142+
# define EDEN_USE_GL3 0
135143

136144
// GCC on Linux.
137145
#elif defined(__linux__)
138146
# define EDEN_UNIX // Its a Unix-like system.
139147
//# define EDEN_HAVE_ARTOOLKIT
148+
# ifdef __arm__
149+
# define EDEN_USE_GL 0
150+
# define EDEN_USE_GLES2 1
151+
# define EDEN_USE_GL3 0
152+
# else
140153
# define EDEN_USE_GL 1
141-
154+
# define EDEN_USE_GLES2 0
155+
# define EDEN_USE_GL3 0
156+
# endif
157+
142158
// GCC on NetBSD.
143159
#elif defined(__NetBSD__)
144160
# define EDEN_UNIX
145161
# define EDEN_USE_GL 1
162+
# define EDEN_USE_GLES2 0
163+
# define EDEN_USE_GL3 0
146164

147165
// Microsoft C++ on Windows.
148166
#elif defined(_MSC_VER)
@@ -165,12 +183,14 @@ extern "C" {
165183
# define EDEN_INLINE_H
166184
# define EDEN_INLINE_C
167185
# define EDEN_USE_GL 1
186+
# define EDEN_USE_GLES2 0
187+
# define EDEN_USE_GL3 0
168188

169189
#else
170190
# error Unrecognised compiler in __FILE__.
171191
#endif
172192

173-
193+
174194
//
175195
// Application code which is dependent on platform capabilities.
176196
//

Eden/EdenError.h

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242

4343
/*!
4444
@header EdenError
45-
@abstract Error codes and error reporting for the Eden library.
45+
@brief Error codes and error reporting for the Eden library.
4646
@version 1.0.0
4747
@updated 2004-06-01
48-
@discussion
48+
@details
4949
*/
5050

5151
#ifndef __EdenError_h__
@@ -70,8 +70,8 @@ extern "C" {
7070

7171
/*!
7272
@enum EDEN_E_*
73-
@abstract Symbolic codes for errors reported by routines in the Eden Library.
74-
@discussion
73+
@brief Symbolic codes for errors reported by routines in the Eden Library.
74+
@details
7575
As the actual numerical values for certain errors may change from time
7676
to time, these symbolic codes should be used instead.
7777
@constant EDEN_E_NONE No error.
@@ -131,8 +131,8 @@ enum {
131131
// ============================================================================
132132
/*!
133133
@typedef EDEN_E_t
134-
@abstract Return type of routines in the Eden Library.
135-
@discussion
134+
@brief Return type of routines in the Eden Library.
135+
@details
136136
Zero and positive values are used to report success, and possibly, return data.
137137
An error is indicated by a value less than zero. Symbolic values for the error
138138
codes are available.
@@ -148,23 +148,21 @@ typedef signed int EDEN_E_t;
148148
// ============================================================================
149149

150150
/*!
151-
@function
152-
@abstract Produce an error string from an Eden Library error code.
153-
@discussion
151+
@brief Produce an error string from an Eden Library error code.
152+
@details
154153
Produces a null-terminated ASCII string with a description of the error
155154
represented by the supplied code, followed by the code itself, in brackets.
156155
See also EdenError_strerror_r, EdenError_perror.
157156
@param code The code to produce the string for, as returned by various routines
158157
in the Eden Library.
159158
@result Pointer to a null-terminated constant character string.
160-
@seealso EdenError_strerror_r EdenError_strerror_r
159+
@see EdenError_strerror_r EdenError_strerror_r
161160
*/
162161
const char *EdenError_strerror(const EDEN_E_t code);
163162

164163
/*!
165-
@function
166-
@abstract Produce an error string from an Eden Library error code.
167-
@discussion
164+
@brief Produce an error string from an Eden Library error code.
165+
@details
168166
Produces an ASCII string with a description of the error
169167
corresponding to the supplied code, and copies up to buflen
170168
characters of the string into strerrbuf
@@ -181,14 +179,13 @@ const char *EdenError_strerror(const EDEN_E_t code);
181179
to contain the error string, returns ERANGE and strerrbuf
182180
will contain an error message that has been truncated and NUL terminated
183181
to fit the length specified by buflen.
184-
@seealso EdenError_strerror EdenError_strerror
182+
@see EdenError_strerror EdenError_strerror
185183
*/
186184
int EdenError_strerror_r(const EDEN_E_t code, char *strerrbuf, const size_t buflen);
187185

188186
/*!
189-
@function
190-
@abstract Print an Eden Library error message and code to stderr, with optional string.
191-
@discussion
187+
@brief Print an Eden Library error message and code to stderr, with optional string.
188+
@details
192189
Finds the error message corresponding to the supplied code,
193190
and writes it, followed by a newline, to the standard error file
194191
descriptor. If the argument string is non-NULL and does not point
@@ -197,8 +194,8 @@ int EdenError_strerror_r(const EDEN_E_t code, char *strerrbuf, const size_t bufl
197194
the error message string is printed.
198195
@param code The code to produce the string for, as returned by various routines
199196
in the Eden Library.
200-
@seealso EdenError_strerror EdenError_strerror
201-
@seealso EdenError_strerror_r EdenError_strerror_r
197+
@see EdenError_strerror EdenError_strerror
198+
@see EdenError_strerror_r EdenError_strerror_r
202199
*/
203200
void EdenError_perror(const EDEN_E_t code, const char *string);
204201

Eden/EdenGLFont.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
# define USE_GL_STATE_CACHE 0
5555
# include <Eden/glStateCache.h>
5656
#elif EDEN_USE_GLES2
57-
# include <AR6/ARG/glStateCache2.h>
58-
# include <AR6/ARG/arg_shader_gl.h>
59-
# include <AR6/ARG/arg_mtx.h>
57+
# include <ARX/ARG/glStateCache2.h>
58+
# include <ARX/ARG/shader_gl.h>
59+
# include <ARX/ARG/mtx.h>
6060
#endif
6161

6262
// ============================================================================
@@ -714,8 +714,8 @@ void EdenGLFontDrawLine(const int contextIndex, const float viewProjection[16],
714714
if (vOffsetType == V_OFFSET_VIEW_BOTTOM_TO_TEXT_BASELINE) y = vOffset;
715715
else {
716716
float textHeight = EdenGLFontGetHeight();
717-
if (vOffsetType == V_OFFSET_VIEW_TEXT_TOP_TO_VIEW_TOP) y = gViewSettings.height - hOffset - textHeight;
718-
else /* V_OFFSET_VIEW_CENTER_TO_TEXT_CENTER */ y = (gViewSettings.height - textHeight)/2.0f + hOffset;
717+
if (vOffsetType == V_OFFSET_TEXT_TOP_TO_VIEW_TOP) y = gViewSettings.height - vOffset - textHeight;
718+
else /* V_OFFSET_VIEW_CENTER_TO_TEXT_CENTER */ y = (gViewSettings.height - textHeight)/2.0f + vOffset;
719719
}
720720

721721
if (gFontSettings.font->type == EDEN_GL_FONT_TYPE_TEXTURE) drawSetup(contextIndex, &VTs);
@@ -754,7 +754,7 @@ void EdenGLFontDrawBlock(const int contextIndex, const float viewProjection[16],
754754
if (vOffsetType == V_OFFSET_VIEW_BOTTOM_TO_TEXT_BASELINE) y = vOffset;
755755
else {
756756
float textHeight = EdenGLFontGetBlockHeight(lines, lineCount);
757-
if (vOffsetType == V_OFFSET_VIEW_TEXT_TOP_TO_VIEW_TOP) y = gViewSettings.height - hOffset - textHeight;
757+
if (vOffsetType == V_OFFSET_TEXT_TOP_TO_VIEW_TOP) y = gViewSettings.height - hOffset - textHeight;
758758
else /* V_OFFSET_VIEW_CENTER_TO_TEXT_CENTER */ y = (gViewSettings.height - textHeight)/2.0f + hOffset;
759759
}
760760

0 commit comments

Comments
 (0)