OSDN Git Service

初期インポート。
[nyartoolkit-and/nyartoolkit-android-0.9.git] / src / jp / nyatla / nyartoolkit / core / NyARVersion.java
diff --git a/src/jp/nyatla/nyartoolkit/core/NyARVersion.java b/src/jp/nyatla/nyartoolkit/core/NyARVersion.java
new file mode 100644 (file)
index 0000000..ef76572
--- /dev/null
@@ -0,0 +1,66 @@
+/* \r
+ * PROJECT: NyARToolkit\r
+ * --------------------------------------------------------------------------------\r
+ * This work is based on the original ARToolKit developed by\r
+ *   Hirokazu Kato\r
+ *   Mark Billinghurst\r
+ *   HITLab, University of Washington, Seattle\r
+ * http://www.hitl.washington.edu/artoolkit/\r
+ *\r
+ * The NyARToolkit is Java version ARToolkit class library.\r
+ * Copyright (C)2008 R.Iizuka\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ * \r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this framework; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+ * \r
+ * For further information please contact.\r
+ *     http://nyatla.jp/nyatoolkit/\r
+ *     <airmail(at)ebony.plala.or.jp>\r
+ * \r
+ */\r
+package jp.nyatla.nyartoolkit.core;\r
+\r
+\r
+/**\r
+ * ARUint32 arGetVersion(char **versionStringRef);\r
+ * 関数の置き換え\r
+ */\r
+public class NyARVersion {\r
+    private static final int AR_HEADER_VERSION_MAJOR=2; //#define AR_HEADER_VERSION_MAJOR              2\r
+    private static final int AR_HEADER_VERSION_MINOR=72;//#define AR_HEADER_VERSION_MINOR              72   \r
+    private static final int AR_HEADER_VERSION_TINY=0;//#define AR_HEADER_VERSION_TINY         0\r
+    private static final int AR_HEADER_VERSION_BUILD=0;//#define AR_HEADER_VERSION_BUILD               0\r
+    private static final String AR_HEADER_VERSION_STRING="2.72.0";//#define AR_HEADER_VERSION_STRING   "2.72.0"\r
+    public static final boolean AR_HAVE_HEADER_VERSION_2=true;//#define AR_HAVE_HEADER_VERSION_2\r
+    public static final boolean AR_HAVE_HEADER_VERSION_2_72=true;//#define AR_HAVE_HEADER_VERSION_2_72\r
+\r
+    public static String getARVersion()\r
+    {\r
+       return AR_HEADER_VERSION_STRING;\r
+    }\r
+    public static int getARVersionInt()\r
+    {\r
+        // Represent full version number (major, minor, tiny, build) in\r
+        // binary coded decimal. N.B: Integer division.\r
+       return  (int)(0x10000000 * (AR_HEADER_VERSION_MAJOR / 10)) +\r
+                (int)(0x01000000 * (AR_HEADER_VERSION_MAJOR % 10)) +\r
+                (int)(0x00100000 * (AR_HEADER_VERSION_MINOR / 10)) +\r
+                (int)(0x00010000 * (AR_HEADER_VERSION_MINOR % 10)) +\r
+                (int)(0x00001000 * (AR_HEADER_VERSION_TINY /  10)) +\r
+                (int)(0x00000100 * (AR_HEADER_VERSION_TINY %  10)) +\r
+                (int)(0x00000010 * (AR_HEADER_VERSION_BUILD / 10)) +\r
+                (int)(0x00000001 * (AR_HEADER_VERSION_BUILD % 10));\r
+       \r
+    }\r
+}\r