Main MRPT website > C++ reference for MRPT 1.9.9
corner_12.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 // ---------------------------------------------------------------------------
11 // LICENSING: This file is a slightly-modified version of part of libcvd,
12 // released under LGPL 2.1 by Edward Rosten
13 // ---------------------------------------------------------------------------
14 
15 template <class C>
16 inline bool is_corner_12(const uint8_t* p, const int w, const int barrier)
17 {
18  const int w3 = 3 * w;
19  const int t = C::prep_t(*p, barrier);
20  if (!C::eval(p[-w3], t))
21  { // -???????????????
22  if (!C::eval(p[-3], t))
23  { // -???????????-???
24  return false;
25  } // -???????????@???
26  if (!C::eval(p[3], t))
27  { // -???-???????@???
28  return false;
29  } // -???@???????@???
30  if (!C::eval(p[3 + w], t))
31  { // -???@-??????@???
32  return false;
33  } // -???@@??????@???
34  if (!C::eval(p[-3 + w], t))
35  { // -???@@?????-@???
36  return false;
37  } // -???@@?????@@???
38  if (!C::eval(p[-2 + 2 * w], t))
39  { // -???@@????-@@???
40  return false;
41  } // -???@@????@@@???
42  if (!C::eval(p[-1 + w3], t))
43  { // -???@@???-@@@???
44  return false;
45  } // -???@@???@@@@???
46  if (!C::eval(p[2 + 2 * w], t))
47  { // -???@@-??@@@@???
48  return false;
49  } // -???@@@??@@@@???
50  if (!C::eval(p[w3], t))
51  { // -???@@@?-@@@@???
52  return false;
53  } // -???@@@?@@@@@???
54  if (!C::eval(p[1 + w3], t))
55  { // -???@@@-@@@@@???
56  return false;
57  } // -???@@@@@@@@@???
58  if (!C::eval(p[-3 - w], t))
59  { // -???@@@@@@@@@-??
60  if (!C::eval(p[1 - w3], t))
61  { // --??@@@@@@@@@-??
62  return false;
63  } // -@??@@@@@@@@@-??
64  if (!C::eval(p[2 - 2 * w], t))
65  { // -@-?@@@@@@@@@-??
66  return false;
67  } // -@@?@@@@@@@@@-??
68  if (!C::eval(p[3 - w], t))
69  { // -@@-@@@@@@@@@-??
70  return false;
71  } // -@@@@@@@@@@@@-??
72  return true;
73  } // -???@@@@@@@@@@??
74  if (!C::eval(p[-2 - 2 * w], t))
75  { // -???@@@@@@@@@@-?
76  if (!C::eval(p[2 - 2 * w], t))
77  { // -?-?@@@@@@@@@@-?
78  return false;
79  } // -?@?@@@@@@@@@@-?
80  if (!C::eval(p[3 - w], t))
81  { // -?@-@@@@@@@@@@-?
82  return false;
83  } // -?@@@@@@@@@@@@-?
84  return true;
85  } // -???@@@@@@@@@@@?
86  if (!C::eval(p[3 - w], t))
87  { // -??-@@@@@@@@@@@?
88  if (!C::eval(p[-1 - w3], t))
89  { // -??-@@@@@@@@@@@-
90  return false;
91  } // -??-@@@@@@@@@@@@
92  return true;
93  } // -??@@@@@@@@@@@@?
94  return true;
95  } // @???????????????
96  if (!C::eval(p[-1 - w3], t))
97  { // @??????????????-
98  if (!C::eval(p[3 - w], t))
99  { // @??-???????????-
100  return false;
101  } // @??@???????????-
102  if (!C::eval(p[-3 + w], t))
103  { // @??@???????-???-
104  return false;
105  } // @??@???????@???-
106  if (!C::eval(p[-2 + 2 * w], t))
107  { // @??@??????-@???-
108  return false;
109  } // @??@??????@@???-
110  if (!C::eval(p[-1 + w3], t))
111  { // @??@?????-@@???-
112  return false;
113  } // @??@?????@@@???-
114  if (!C::eval(p[w3], t))
115  { // @??@????-@@@???-
116  return false;
117  } // @??@????@@@@???-
118  if (!C::eval(p[3], t))
119  { // @??@-???@@@@???-
120  return false;
121  } // @??@@???@@@@???-
122  if (!C::eval(p[1 + w3], t))
123  { // @??@@??-@@@@???-
124  return false;
125  } // @??@@??@@@@@???-
126  if (!C::eval(p[2 + 2 * w], t))
127  { // @??@@?-@@@@@???-
128  return false;
129  } // @??@@?@@@@@@???-
130  if (!C::eval(p[3 + w], t))
131  { // @??@@-@@@@@@???-
132  return false;
133  } // @??@@@@@@@@@???-
134  if (!C::eval(p[2 - 2 * w], t))
135  { // @?-@@@@@@@@@???-
136  if (!C::eval(p[-3], t))
137  { // @?-@@@@@@@@@-??-
138  return false;
139  } // @?-@@@@@@@@@@??-
140  if (!C::eval(p[-3 - w], t))
141  { // @?-@@@@@@@@@@-?-
142  return false;
143  } // @?-@@@@@@@@@@@?-
144  if (!C::eval(p[-2 - 2 * w], t))
145  { // @?-@@@@@@@@@@@--
146  return false;
147  } // @?-@@@@@@@@@@@@-
148  return true;
149  } // @?@@@@@@@@@@???-
150  if (!C::eval(p[1 - w3], t))
151  { // @-@@@@@@@@@@???-
152  if (!C::eval(p[-3], t))
153  { // @-@@@@@@@@@@-??-
154  return false;
155  } // @-@@@@@@@@@@@??-
156  if (!C::eval(p[-3 - w], t))
157  { // @-@@@@@@@@@@@-?-
158  return false;
159  } // @-@@@@@@@@@@@@?-
160  return true;
161  } // @@@@@@@@@@@@???-
162  return true;
163  } // @??????????????@
164  if (!C::eval(p[1 - w3], t))
165  { // @-?????????????@
166  if (!C::eval(p[3 + w], t))
167  { // @-???-?????????@
168  return false;
169  } // @-???@?????????@
170  if (!C::eval(p[-3 - w], t))
171  { // @-???@???????-?@
172  return false;
173  } // @-???@???????@?@
174  if (!C::eval(p[-3], t))
175  { // @-???@??????-@?@
176  return false;
177  } // @-???@??????@@?@
178  if (!C::eval(p[-3 + w], t))
179  { // @-???@?????-@@?@
180  return false;
181  } // @-???@?????@@@?@
182  if (!C::eval(p[-2 + 2 * w], t))
183  { // @-???@????-@@@?@
184  return false;
185  } // @-???@????@@@@?@
186  if (!C::eval(p[2 + 2 * w], t))
187  { // @-???@-???@@@@?@
188  return false;
189  } // @-???@@???@@@@?@
190  if (!C::eval(p[1 + w3], t))
191  { // @-???@@-??@@@@?@
192  return false;
193  } // @-???@@@??@@@@?@
194  if (!C::eval(p[-1 + w3], t))
195  { // @-???@@@?-@@@@?@
196  return false;
197  } // @-???@@@?@@@@@?@
198  if (!C::eval(p[w3], t))
199  { // @-???@@@-@@@@@?@
200  return false;
201  } // @-???@@@@@@@@@?@
202  if (!C::eval(p[-2 - 2 * w], t))
203  { // @-???@@@@@@@@@-@
204  if (!C::eval(p[2 - 2 * w], t))
205  { // @--??@@@@@@@@@-@
206  return false;
207  } // @-@??@@@@@@@@@-@
208  if (!C::eval(p[3 - w], t))
209  { // @-@-?@@@@@@@@@-@
210  return false;
211  } // @-@@?@@@@@@@@@-@
212  if (!C::eval(p[3], t))
213  { // @-@@-@@@@@@@@@-@
214  return false;
215  } // @-@@@@@@@@@@@@-@
216  return true;
217  } // @-???@@@@@@@@@@@
218  return true;
219  } // @@?????????????@
220  if (!C::eval(p[2 - 2 * w], t))
221  { // @@-????????????@
222  if (!C::eval(p[2 + 2 * w], t))
223  { // @@-???-????????@
224  return false;
225  } // @@-???@????????@
226  if (!C::eval(p[1 + w3], t))
227  { // @@-???@-???????@
228  return false;
229  } // @@-???@@???????@
230  if (!C::eval(p[-2 - 2 * w], t))
231  { // @@-???@@??????-@
232  return false;
233  } // @@-???@@??????@@
234  if (!C::eval(p[w3], t))
235  { // @@-???@@-?????@@
236  return false;
237  } // @@-???@@@?????@@
238  if (!C::eval(p[-3 - w], t))
239  { // @@-???@@@????-@@
240  return false;
241  } // @@-???@@@????@@@
242  if (!C::eval(p[-3], t))
243  { // @@-???@@@???-@@@
244  return false;
245  } // @@-???@@@???@@@@
246  if (!C::eval(p[-1 + w3], t))
247  { // @@-???@@@-??@@@@
248  return false;
249  } // @@-???@@@@??@@@@
250  if (!C::eval(p[-2 + 2 * w], t))
251  { // @@-???@@@@-?@@@@
252  return false;
253  } // @@-???@@@@@?@@@@
254  if (!C::eval(p[-3 + w], t))
255  { // @@-???@@@@@-@@@@
256  return false;
257  } // @@-???@@@@@@@@@@
258  return true;
259  } // @@@????????????@
260  if (!C::eval(p[-2 - 2 * w], t))
261  { // @@@???????????-@
262  if (!C::eval(p[3 - w], t))
263  { // @@@-??????????-@
264  return false;
265  } // @@@@??????????-@
266  if (!C::eval(p[-2 + 2 * w], t))
267  { // @@@@??????-???-@
268  return false;
269  } // @@@@??????@???-@
270  if (!C::eval(p[3], t))
271  { // @@@@-?????@???-@
272  return false;
273  } // @@@@@?????@???-@
274  if (!C::eval(p[-1 + w3], t))
275  { // @@@@@????-@???-@
276  return false;
277  } // @@@@@????@@???-@
278  if (!C::eval(p[w3], t))
279  { // @@@@@???-@@???-@
280  return false;
281  } // @@@@@???@@@???-@
282  if (!C::eval(p[3 + w], t))
283  { // @@@@@-??@@@???-@
284  return false;
285  } // @@@@@@??@@@???-@
286  if (!C::eval(p[2 + 2 * w], t))
287  { // @@@@@@-?@@@???-@
288  return false;
289  } // @@@@@@@?@@@???-@
290  if (!C::eval(p[1 + w3], t))
291  { // @@@@@@@-@@@???-@
292  return false;
293  } // @@@@@@@@@@@???-@
294  return true;
295  } // @@@???????????@@
296  if (!C::eval(p[3 - w], t))
297  { // @@@-??????????@@
298  if (!C::eval(p[-3 - w], t))
299  { // @@@-?????????-@@
300  return false;
301  } // @@@-?????????@@@
302  if (!C::eval(p[1 + w3], t))
303  { // @@@-???-?????@@@
304  return false;
305  } // @@@-???@?????@@@
306  if (!C::eval(p[-3], t))
307  { // @@@-???@????-@@@
308  return false;
309  } // @@@-???@????@@@@
310  if (!C::eval(p[-3 + w], t))
311  { // @@@-???@???-@@@@
312  return false;
313  } // @@@-???@???@@@@@
314  if (!C::eval(p[w3], t))
315  { // @@@-???@-??@@@@@
316  return false;
317  } // @@@-???@@??@@@@@
318  if (!C::eval(p[-1 + w3], t))
319  { // @@@-???@@-?@@@@@
320  return false;
321  } // @@@-???@@@?@@@@@
322  if (!C::eval(p[-2 + 2 * w], t))
323  { // @@@-???@@@-@@@@@
324  return false;
325  } // @@@-???@@@@@@@@@
326  return true;
327  } // @@@@??????????@@
328  if (!C::eval(p[3], t))
329  { // @@@@-?????????@@
330  if (!C::eval(p[w3], t))
331  { // @@@@-???-?????@@
332  return false;
333  } // @@@@-???@?????@@
334  if (!C::eval(p[-3 - w], t))
335  { // @@@@-???@????-@@
336  return false;
337  } // @@@@-???@????@@@
338  if (!C::eval(p[-3], t))
339  { // @@@@-???@???-@@@
340  return false;
341  } // @@@@-???@???@@@@
342  if (!C::eval(p[-1 + w3], t))
343  { // @@@@-???@-??@@@@
344  return false;
345  } // @@@@-???@@??@@@@
346  if (!C::eval(p[-2 + 2 * w], t))
347  { // @@@@-???@@-?@@@@
348  return false;
349  } // @@@@-???@@@?@@@@
350  if (!C::eval(p[-3 + w], t))
351  { // @@@@-???@@@-@@@@
352  return false;
353  } // @@@@-???@@@@@@@@
354  return true;
355  } // @@@@@?????????@@
356  if (!C::eval(p[-3 - w], t))
357  { // @@@@@????????-@@
358  if (!C::eval(p[-1 + w3], t))
359  { // @@@@@????-???-@@
360  return false;
361  } // @@@@@????@???-@@
362  if (!C::eval(p[w3], t))
363  { // @@@@@???-@???-@@
364  return false;
365  } // @@@@@???@@???-@@
366  if (!C::eval(p[3 + w], t))
367  { // @@@@@-??@@???-@@
368  return false;
369  } // @@@@@@??@@???-@@
370  if (!C::eval(p[2 + 2 * w], t))
371  { // @@@@@@-?@@???-@@
372  return false;
373  } // @@@@@@@?@@???-@@
374  if (!C::eval(p[1 + w3], t))
375  { // @@@@@@@-@@???-@@
376  return false;
377  } // @@@@@@@@@@???-@@
378  return true;
379  } // @@@@@????????@@@
380  if (!C::eval(p[3 + w], t))
381  { // @@@@@-???????@@@
382  if (!C::eval(p[-3], t))
383  { // @@@@@-??????-@@@
384  return false;
385  } // @@@@@-??????@@@@
386  if (!C::eval(p[-1 + w3], t))
387  { // @@@@@-???-??@@@@
388  return false;
389  } // @@@@@-???@??@@@@
390  if (!C::eval(p[-2 + 2 * w], t))
391  { // @@@@@-???@-?@@@@
392  return false;
393  } // @@@@@-???@@?@@@@
394  if (!C::eval(p[-3 + w], t))
395  { // @@@@@-???@@-@@@@
396  return false;
397  } // @@@@@-???@@@@@@@
398  return true;
399  } // @@@@@@???????@@@
400  if (!C::eval(p[2 + 2 * w], t))
401  { // @@@@@@-??????@@@
402  if (!C::eval(p[-2 + 2 * w], t))
403  { // @@@@@@-???-??@@@
404  return false;
405  } // @@@@@@-???@??@@@
406  if (!C::eval(p[-3 + w], t))
407  { // @@@@@@-???@-?@@@
408  return false;
409  } // @@@@@@-???@@?@@@
410  if (!C::eval(p[-3], t))
411  { // @@@@@@-???@@-@@@
412  return false;
413  } // @@@@@@-???@@@@@@
414  return true;
415  } // @@@@@@@??????@@@
416  if (!C::eval(p[1 + w3], t))
417  { // @@@@@@@-?????@@@
418  if (!C::eval(p[-3 + w], t))
419  { // @@@@@@@-???-?@@@
420  return false;
421  } // @@@@@@@-???@?@@@
422  if (!C::eval(p[-3], t))
423  { // @@@@@@@-???@-@@@
424  return false;
425  } // @@@@@@@-???@@@@@
426  return true;
427  } // @@@@@@@@?????@@@
428  if (!C::eval(p[-3], t))
429  { // @@@@@@@@????-@@@
430  if (!C::eval(p[w3], t))
431  { // @@@@@@@@-???-@@@
432  return false;
433  } // @@@@@@@@@???-@@@
434  return true;
435  } // @@@@@@@@????@@@@
436  return true;
437 }
GLdouble GLdouble t
Definition: glext.h:3689
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
unsigned char uint8_t
Definition: rptypes.h:41
bool is_corner_12(const uint8_t *p, const int w, const int barrier)
Definition: corner_12.h:16
GLfloat GLfloat p
Definition: glext.h:6305



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019