arBitFieldPattern.h
Go to the documentation of this file.
1 /* ========================================================================
2 * PROJECT: ARToolKitPlus
3 * ========================================================================
4 * This work is based on the original ARToolKit developed by
5 * Hirokazu Kato
6 * Mark Billinghurst
7 * HITLab, University of Washington, Seattle
8 * http://www.hitl.washington.edu/artoolkit/
9 *
10 * Copyright of the derived and new portions of this work
11 * (C) 2006 Graz University of Technology
12 *
13 * This framework is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This framework is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this framework; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 * For further information please contact
28 * Dieter Schmalstieg
29 * <schmalstieg@icg.tu-graz.ac.at>
30 * Graz University of Technology,
31 * Institut for Computer Graphics and Vision,
32 * Inffeldgasse 16a, 8010 Graz, Austria.
33 * ========================================================================
34 ** @author Daniel Wagner
35 *
36 * $Id: arBitFieldPattern.h 162 2006-04-19 21:28:10Z grabner $
37 * @file
38 * ======================================================================== */
39 
40 
41 #ifndef __ARBITFIELDPATTERN_HEADERFILE__
42 #define __ARBITFIELDPATTERN_HEADERFILE__
43 
44 
45 namespace ARToolKitPlus {
46 
47  enum {
48  // size of the marker images
51 
52  // number of bits we can use for marker id
53  idBits = 9,
54  idMask = (1<<idBits) - 1,
55  idMax = (1<<idBits) - 1,
56 
58  };
59 
60  // we only use __int64 under windows.
61  // have to use unsigned long long othersie...
62 #if defined(_MSC_VER) || defined(_WIN32_WCE)
63  typedef __int64 IDPATTERN;
64  const IDPATTERN bchMask = 0x8f80b8750;
65 #else
66  typedef unsigned long long IDPATTERN;
67  const IDPATTERN bchMask = 0x8f80b8750ll;
68 #endif
69 
70  const IDPATTERN xorMask0 = 0x0027;
71  const IDPATTERN xorMask1 = 0x014e;
72  const IDPATTERN xorMask2 = 0x0109;
73  const IDPATTERN xorMask3 = 0x00db;
74 
75  const int posMask0 = 0;
76  const int posMask1 = idBits;
77  const int posMask2 = 2*idBits;
78  const int posMask3 = 3*idBits;
79 
80  // full mask that is used to xor raw pattern image
81  const IDPATTERN fullMask = (xorMask0<<posMask0) | (xorMask1<<posMask1) | (xorMask2<<posMask2) | (xorMask3<<posMask3);
82 
83 
84  const unsigned int bchBits = 12;
85  const unsigned int idMaxBCH = (1<<bchBits) - 1;
86 
87  // array with indices for 90° CW rotated grid
88  const int rotate90[] = {
89  30, 24, 18, 12, 6, 0,
90  31, 25, 19, 13, 7, 1,
91  32, 26, 20, 14, 8, 2,
92  33, 27, 21, 15, 9, 3,
93  34, 28, 22, 16, 10, 4,
94  35, 29, 23, 17, 11, 5
95  };
96 
97 
98  // some internal methods. primarily needed for
99  // marker printing, etc.
100  //
101  static void generatePatternSimple(int nID, IDPATTERN& nPattern);
102 
103  static void generatePatternBCH(int nID, IDPATTERN& nPattern);
104 
105  // static void setBit(IDPATTERN& pat, int which);
106 
107  static bool isBitSet(IDPATTERN pat, int which);
108 
109 
110 } // namespace ARToolKitPlus
111 
112 
113 #endif //__ARBITFIELDPATTERN_HEADERFILE__
const unsigned int idMaxBCH
const int posMask2
const int posMask1
const IDPATTERN xorMask2
static void generatePatternSimple(int nID, IDPATTERN &nPattern)
const IDPATTERN xorMask1
const int posMask0
const IDPATTERN bchMask
This file should only be compiled when using ARToolKitPlus as a DLL.
Definition: ar.h:60
const IDPATTERN xorMask3
const unsigned int bchBits
const int posMask3
const IDPATTERN xorMask0
static bool isBitSet(IDPATTERN pat, int which)
unsigned long long IDPATTERN
const IDPATTERN fullMask
const int rotate90[]
static void generatePatternBCH(int nID, IDPATTERN &nPattern)


tuw_artoolkitplus
Author(s): Markus Bader
autogenerated on Sun Sep 4 2016 03:24:33