00001
00021 #ifndef __ARBITFIELDPATTERN_HEADERFILE__
00022 #define __ARBITFIELDPATTERN_HEADERFILE__
00023
00024 #include <ARToolKitPlus/config.h>
00025
00026 namespace ARToolKitPlus {
00027
00028 enum {
00029
00030 idPattWidth = 6,
00031 idPattHeight = 6,
00032
00033
00034 idBits = 9,
00035 idMask = (1 << idBits) - 1,
00036 idMax = (1 << idBits) - 1,
00037
00038 pattBits = 4 * idBits
00039 };
00040
00041
00042
00043 #if defined(_MSC_VER) || defined(_WIN32_WCE)
00044 typedef __int64 IDPATTERN;
00045 const IDPATTERN bchMask = 0x8f80b8750;
00046 #else
00047 typedef unsigned long long IDPATTERN;
00048 const IDPATTERN bchMask = 0x8f80b8750ll;
00049 #endif
00050
00051 const IDPATTERN xorMask0 = 0x0027;
00052 const IDPATTERN xorMask1 = 0x014e;
00053 const IDPATTERN xorMask2 = 0x0109;
00054 const IDPATTERN xorMask3 = 0x00db;
00055
00056 const int posMask0 = 0;
00057 const int posMask1 = idBits;
00058 const int posMask2 = 2 * idBits;
00059 const int posMask3 = 3 * idBits;
00060
00061
00062 const IDPATTERN fullMask = (xorMask0 << posMask0) | (xorMask1 << posMask1) | (xorMask2 << posMask2) | (xorMask3
00063 << posMask3);
00064
00065 const unsigned int bchBits = 12;
00066 const unsigned int idMaxBCH = (1 << bchBits) - 1;
00067
00068
00069 const int rotate90[] = {
00070 30, 24, 18, 12, 6, 0,
00071 31, 25, 19, 13, 7, 1,
00072 32, 26, 20, 14, 8, 2,
00073 33, 27, 21, 15, 9, 3,
00074 34, 28, 22, 16, 10, 4,
00075 35, 29, 23, 17, 11, 5
00076 };
00077
00078
00079
00080
00081 void AR_EXPORT generatePatternSimple(int nID, IDPATTERN& nPattern);
00082
00083 void AR_EXPORT generatePatternBCH(int nID, IDPATTERN& nPattern);
00084
00085
00086
00087 bool AR_EXPORT isBitSet(IDPATTERN pat, int which);
00088
00089 }
00090
00091
00092 #endif //__ARBITFIELDPATTERN_HEADERFILE__