SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
gl_types.h
Go to the documentation of this file.
1 /*
2  This file is part of the CVD Library.
3 
4  Copyright (C) 2005 The Authors
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 // Pulled out of gl_helpers to make documentation neater
22 // Paul Smith 20/4/05
23 
24 #ifndef CVD_GL_TYPES_H
25 #define CVD_GL_TYPES_H
26 
27 #include <OpenGLES/ES2/gl.h>
28 #include "byte.h"
29 #include "rgb.h"
30 #include "rgb8.h"
31 #include "rgba.h"
32 #include "la.h"
33 
34 namespace CVD
35 {
36 
37  namespace gl
38  {
39  template<class C> struct data;
40 
41  //Scalar types
42 
43  template<> struct data<unsigned char>
44  {
45  static const int format=GL_LUMINANCE;
46  static const int type =GL_UNSIGNED_BYTE;
47  };
48 
49  template<> struct data<signed char>
50  {
51  static const int format=GL_LUMINANCE;
52  static const int type =GL_BYTE;
53  };
54 
55  template<> struct data<unsigned short>
56  {
57  static const int format=GL_LUMINANCE;
58  static const int type =GL_UNSIGNED_SHORT;
59  };
60 
61  template<> struct data<short>
62  {
63  static const int format=GL_LUMINANCE;
64  static const int type =GL_SHORT;
65  };
66 
67  template<> struct data<unsigned int>
68  {
69  static const int format=GL_LUMINANCE;
70  static const int type =GL_UNSIGNED_INT;
71  };
72 
73  template<> struct data<int>
74  {
75  static const int format=GL_LUMINANCE;
76  static const int type =GL_INT;
77  };
78 
79  template<> struct data<float>
80  {
81  static const int format=GL_LUMINANCE;
82  static const int type =GL_FLOAT;
83  };
84 
85  /*template<> struct data<double>
86  {
87  static const int format=GL_LUMINANCE;
88  static const int type =GL_DOUBLE;
89  };*/
90 
91 
92 
93  //Rgb<*> types
94 
95  template<> struct data<Rgb<unsigned char> >
96  {
97  static const int format=GL_RGB;
98  static const int type =GL_UNSIGNED_BYTE;
99  };
100 
101  template<> struct data<Rgb<signed char> >
102  {
103  static const int format=GL_RGB;
104  static const int type =GL_BYTE;
105  };
106 
107  template<> struct data<Rgb<unsigned short> >
108  {
109  static const int format=GL_RGB;
110  static const int type =GL_UNSIGNED_SHORT;
111  };
112 
113  template<> struct data<Rgb<short> >
114  {
115  static const int format=GL_RGB;
116  static const int type =GL_SHORT;
117  };
118 
119  template<> struct data<Rgb<unsigned int> >
120  {
121  static const int format=GL_RGB;
122  static const int type =GL_UNSIGNED_INT;
123  };
124 
125  template<> struct data<Rgb<int> >
126  {
127  static const int format=GL_RGB;
128  static const int type =GL_INT;
129  };
130 
131  template<> struct data<Rgb<float> >
132  {
133  static const int format=GL_RGB;
134  static const int type =GL_FLOAT;
135  };
136 
137  /*template<> struct data<Rgb<double> >
138  {
139  static const int format=GL_RGB;
140  static const int type =GL_DOUBLE;
141  };*/
142 
143 
144  //Rgba<*> types
145 
146  template<> struct data<Rgba<unsigned char> >
147  {
148  static const int format=GL_RGBA;
149  static const int type =GL_UNSIGNED_BYTE;
150  };
151 
152  template<> struct data<Rgba<signed char> >
153  {
154  static const int format=GL_RGBA;
155  static const int type =GL_BYTE;
156  };
157 
158  template<> struct data<Rgba<unsigned short> >
159  {
160  static const int format=GL_RGBA;
161  static const int type =GL_UNSIGNED_SHORT;
162  };
163 
164  template<> struct data<Rgba<short> >
165  {
166  static const int format=GL_RGBA;
167  static const int type =GL_SHORT;
168  };
169 
170  template<> struct data<Rgba<unsigned int> >
171  {
172  static const int format=GL_RGBA;
173  static const int type =GL_UNSIGNED_INT;
174  };
175 
176  template<> struct data<Rgba<int> >
177  {
178  static const int format=GL_RGBA;
179  static const int type =GL_INT;
180  };
181 
182  template<> struct data<Rgba<float> >
183  {
184  static const int format=GL_RGBA;
185  static const int type =GL_FLOAT;
186  };
187 
188  /* template<> struct data<Rgba<double> >
189  {
190  static const int format=GL_RGBA;
191  static const int type =GL_DOUBLE;
192  };
193 */
194 
195  //La<*> types
196  template<> struct data<La<unsigned char> >
197  {
198  static const int format=GL_LUMINANCE_ALPHA;
199  static const int type =GL_UNSIGNED_BYTE;
200  };
201 
202  template<> struct data<La<signed char> >
203  {
204  static const int format=GL_LUMINANCE_ALPHA;
205  static const int type =GL_BYTE;
206  };
207 
208  template<> struct data<La<unsigned short> >
209  {
210  static const int format=GL_LUMINANCE_ALPHA;
211  static const int type =GL_UNSIGNED_SHORT;
212  };
213 
214  template<> struct data<La<short> >
215  {
216  static const int format=GL_LUMINANCE_ALPHA;
217  static const int type =GL_SHORT;
218  };
219 
220  template<> struct data<La<unsigned int> >
221  {
222  static const int format=GL_LUMINANCE_ALPHA;
223  static const int type =GL_UNSIGNED_INT;
224  };
225 
226  template<> struct data<La<int> >
227  {
228  static const int format=GL_LUMINANCE_ALPHA;
229  static const int type =GL_INT;
230  };
231 
232  template<> struct data<La<float> >
233  {
234  static const int format=GL_LUMINANCE_ALPHA;
235  static const int type =GL_FLOAT;
236  };
237 
238  /* template<> struct data<La<double> >
239  {
240  static const int format=GL_LUMINANCE_ALPHA;
241  static const int type =GL_DOUBLE;
242  };
243 */
244  //Rgb8 type
245 
246  template<> struct data<Rgb8>
247  {
248  static const int format=GL_RGBA;
249  static const int type =GL_UNSIGNED_BYTE;
250  };
251 
252  };
253 
254 
255 };
256 
257 #endif
Definition: rgb.h:45
Definition: rgba.h:38
Definition: abs.h:24
Definition: rgb8.h:33
Definition: la.h:38