Main MRPT website > C++ reference for MRPT 1.9.9
corner_10.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_10(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[-1 - w3], t))
21  { // ???????????????-
22  if (!C::eval(p[3 + w], t))
23  { // ?????-?????????-
24  return false;
25  } // ?????@?????????-
26  if (!C::eval(p[2 + 2 * w], t))
27  { // ?????@-????????-
28  return false;
29  } // ?????@@????????-
30  if (!C::eval(p[-1 + w3], t))
31  { // ?????@@??-?????-
32  return false;
33  } // ?????@@??@?????-
34  if (!C::eval(p[1 + w3], t))
35  { // ?????@@-?@?????-
36  return false;
37  } // ?????@@@?@?????-
38  if (!C::eval(p[w3], t))
39  { // ?????@@@-@?????-
40  return false;
41  } // ?????@@@@@?????-
42  if (!C::eval(p[-2 + 2 * w], t))
43  { // ?????@@@@@-????-
44  if (!C::eval(p[-w3], t))
45  { // -????@@@@@-????-
46  return false;
47  } // @????@@@@@-????-
48  if (!C::eval(p[3], t))
49  { // @???-@@@@@-????-
50  return false;
51  } // @???@@@@@@-????-
52  if (!C::eval(p[1 - w3], t))
53  { // @-??@@@@@@-????-
54  return false;
55  } // @@??@@@@@@-????-
56  if (!C::eval(p[2 - 2 * w], t))
57  { // @@-?@@@@@@-????-
58  return false;
59  } // @@@?@@@@@@-????-
60  if (!C::eval(p[3 - w], t))
61  { // @@@-@@@@@@-????-
62  return false;
63  } // @@@@@@@@@@-????-
64  return true;
65  } // ?????@@@@@@????-
66  if (!C::eval(p[-3 + w], t))
67  { // ?????@@@@@@-???-
68  if (!C::eval(p[3], t))
69  { // ????-@@@@@@-???-
70  return false;
71  } // ????@@@@@@@-???-
72  if (!C::eval(p[1 - w3], t))
73  { // ?-??@@@@@@@-???-
74  return false;
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], t))
87  { // ????-@@@@@@@???-
88  if (!C::eval(p[-3], t))
89  { // ????-@@@@@@@-??-
90  return false;
91  } // ????-@@@@@@@@??-
92  if (!C::eval(p[-3 - w], t))
93  { // ????-@@@@@@@@-?-
94  return false;
95  } // ????-@@@@@@@@@?-
96  if (!C::eval(p[-2 - 2 * w], t))
97  { // ????-@@@@@@@@@--
98  return false;
99  } // ????-@@@@@@@@@@-
100  return true;
101  } // ????@@@@@@@@???-
102  if (!C::eval(p[3 - w], t))
103  { // ???-@@@@@@@@???-
104  if (!C::eval(p[-3], t))
105  { // ???-@@@@@@@@-??-
106  return false;
107  } // ???-@@@@@@@@@??-
108  if (!C::eval(p[-3 - w], t))
109  { // ???-@@@@@@@@@-?-
110  return false;
111  } // ???-@@@@@@@@@@?-
112  return true;
113  } // ???@@@@@@@@@???-
114  if (!C::eval(p[-3], t))
115  { // ???@@@@@@@@@-??-
116  if (!C::eval(p[2 - 2 * w], t))
117  { // ??-@@@@@@@@@-??-
118  return false;
119  } // ??@@@@@@@@@@-??-
120  return true;
121  } // ???@@@@@@@@@@??-
122  return true;
123  } // ???????????????@
124  if (!C::eval(p[-2 - 2 * w], t))
125  { // ??????????????-@
126  if (!C::eval(p[3], t))
127  { // ????-?????????-@
128  return false;
129  } // ????@?????????-@
130  if (!C::eval(p[3 + w], t))
131  { // ????@-????????-@
132  return false;
133  } // ????@@????????-@
134  if (!C::eval(p[w3], t))
135  { // ????@@??-?????-@
136  return false;
137  } // ????@@??@?????-@
138  if (!C::eval(p[1 + w3], t))
139  { // ????@@?-@?????-@
140  return false;
141  } // ????@@?@@?????-@
142  if (!C::eval(p[2 + 2 * w], t))
143  { // ????@@-@@?????-@
144  return false;
145  } // ????@@@@@?????-@
146  if (!C::eval(p[3 - w], t))
147  { // ???-@@@@@?????-@
148  if (!C::eval(p[-1 + w3], t))
149  { // ???-@@@@@-????-@
150  return false;
151  } // ???-@@@@@@????-@
152  if (!C::eval(p[-3 - w], t))
153  { // ???-@@@@@@???--@
154  return false;
155  } // ???-@@@@@@???@-@
156  if (!C::eval(p[-2 + 2 * w], t))
157  { // ???-@@@@@@-??@-@
158  return false;
159  } // ???-@@@@@@@??@-@
160  if (!C::eval(p[-3 + w], t))
161  { // ???-@@@@@@@-?@-@
162  return false;
163  } // ???-@@@@@@@@?@-@
164  if (!C::eval(p[-3], t))
165  { // ???-@@@@@@@@-@-@
166  return false;
167  } // ???-@@@@@@@@@@-@
168  return true;
169  } // ???@@@@@@?????-@
170  if (!C::eval(p[2 - 2 * w], t))
171  { // ??-@@@@@@?????-@
172  if (!C::eval(p[-3], t))
173  { // ??-@@@@@@???-?-@
174  return false;
175  } // ??-@@@@@@???@?-@
176  if (!C::eval(p[-1 + w3], t))
177  { // ??-@@@@@@-??@?-@
178  return false;
179  } // ??-@@@@@@@??@?-@
180  if (!C::eval(p[-2 + 2 * w], t))
181  { // ??-@@@@@@@-?@?-@
182  return false;
183  } // ??-@@@@@@@@?@?-@
184  if (!C::eval(p[-3 + w], t))
185  { // ??-@@@@@@@@-@?-@
186  return false;
187  } // ??-@@@@@@@@@@?-@
188  return true;
189  } // ??@@@@@@@?????-@
190  if (!C::eval(p[1 - w3], t))
191  { // ?-@@@@@@@?????-@
192  if (!C::eval(p[-1 + w3], t))
193  { // ?-@@@@@@@-????-@
194  return false;
195  } // ?-@@@@@@@@????-@
196  if (!C::eval(p[-2 + 2 * w], t))
197  { // ?-@@@@@@@@-???-@
198  return false;
199  } // ?-@@@@@@@@@???-@
200  if (!C::eval(p[-3 + w], t))
201  { // ?-@@@@@@@@@-??-@
202  return false;
203  } // ?-@@@@@@@@@@??-@
204  return true;
205  } // ?@@@@@@@@?????-@
206  if (!C::eval(p[-w3], t))
207  { // -@@@@@@@@?????-@
208  if (!C::eval(p[-1 + w3], t))
209  { // -@@@@@@@@-????-@
210  return false;
211  } // -@@@@@@@@@????-@
212  if (!C::eval(p[-2 + 2 * w], t))
213  { // -@@@@@@@@@-???-@
214  return false;
215  } // -@@@@@@@@@@???-@
216  return true;
217  } // @@@@@@@@@?????-@
218  return true;
219  } // ??????????????@@
220  if (!C::eval(p[-3 - w], t))
221  { // ?????????????-@@
222  if (!C::eval(p[1 + w3], t))
223  { // ???????-?????-@@
224  return false;
225  } // ???????@?????-@@
226  if (!C::eval(p[3 - w], t))
227  { // ???-???@?????-@@
228  return false;
229  } // ???@???@?????-@@
230  if (!C::eval(p[3], t))
231  { // ???@-??@?????-@@
232  return false;
233  } // ???@@??@?????-@@
234  if (!C::eval(p[3 + w], t))
235  { // ???@@-?@?????-@@
236  return false;
237  } // ???@@@?@?????-@@
238  if (!C::eval(p[2 + 2 * w], t))
239  { // ???@@@-@?????-@@
240  return false;
241  } // ???@@@@@?????-@@
242  if (!C::eval(p[2 - 2 * w], t))
243  { // ??-@@@@@?????-@@
244  if (!C::eval(p[w3], t))
245  { // ??-@@@@@-????-@@
246  return false;
247  } // ??-@@@@@@????-@@
248  if (!C::eval(p[-3], t))
249  { // ??-@@@@@@???--@@
250  return false;
251  } // ??-@@@@@@???@-@@
252  if (!C::eval(p[-1 + w3], t))
253  { // ??-@@@@@@-??@-@@
254  return false;
255  } // ??-@@@@@@@??@-@@
256  if (!C::eval(p[-2 + 2 * w], t))
257  { // ??-@@@@@@@-?@-@@
258  return false;
259  } // ??-@@@@@@@@?@-@@
260  if (!C::eval(p[-3 + w], t))
261  { // ??-@@@@@@@@-@-@@
262  return false;
263  } // ??-@@@@@@@@@@-@@
264  return true;
265  } // ??@@@@@@?????-@@
266  if (!C::eval(p[1 - w3], t))
267  { // ?-@@@@@@?????-@@
268  if (!C::eval(p[-3 + w], t))
269  { // ?-@@@@@@???-?-@@
270  return false;
271  } // ?-@@@@@@???@?-@@
272  if (!C::eval(p[w3], t))
273  { // ?-@@@@@@-??@?-@@
274  return false;
275  } // ?-@@@@@@@??@?-@@
276  if (!C::eval(p[-1 + w3], t))
277  { // ?-@@@@@@@-?@?-@@
278  return false;
279  } // ?-@@@@@@@@?@?-@@
280  if (!C::eval(p[-2 + 2 * w], t))
281  { // ?-@@@@@@@@-@?-@@
282  return false;
283  } // ?-@@@@@@@@@@?-@@
284  return true;
285  } // ?@@@@@@@?????-@@
286  if (!C::eval(p[-w3], t))
287  { // -@@@@@@@?????-@@
288  if (!C::eval(p[w3], t))
289  { // -@@@@@@@-????-@@
290  return false;
291  } // -@@@@@@@@????-@@
292  if (!C::eval(p[-1 + w3], t))
293  { // -@@@@@@@@-???-@@
294  return false;
295  } // -@@@@@@@@@???-@@
296  if (!C::eval(p[-2 + 2 * w], t))
297  { // -@@@@@@@@@-??-@@
298  return false;
299  } // -@@@@@@@@@@??-@@
300  return true;
301  } // @@@@@@@@?????-@@
302  return true;
303  } // ?????????????@@@
304  if (!C::eval(p[-w3], t))
305  { // -????????????@@@
306  if (!C::eval(p[2 + 2 * w], t))
307  { // -?????-??????@@@
308  return false;
309  } // -?????@??????@@@
310  if (!C::eval(p[1 + w3], t))
311  { // -?????@-?????@@@
312  return false;
313  } // -?????@@?????@@@
314  if (!C::eval(p[-2 + 2 * w], t))
315  { // -?????@@??-??@@@
316  return false;
317  } // -?????@@??@??@@@
318  if (!C::eval(p[w3], t))
319  { // -?????@@-?@??@@@
320  return false;
321  } // -?????@@@?@??@@@
322  if (!C::eval(p[-1 + w3], t))
323  { // -?????@@@-@??@@@
324  return false;
325  } // -?????@@@@@??@@@
326  if (!C::eval(p[-3 + w], t))
327  { // -?????@@@@@-?@@@
328  if (!C::eval(p[1 - w3], t))
329  { // --????@@@@@-?@@@
330  return false;
331  } // -@????@@@@@-?@@@
332  if (!C::eval(p[3 + w], t))
333  { // -@???-@@@@@-?@@@
334  return false;
335  } // -@???@@@@@@-?@@@
336  if (!C::eval(p[2 - 2 * w], t))
337  { // -@-??@@@@@@-?@@@
338  return false;
339  } // -@@??@@@@@@-?@@@
340  if (!C::eval(p[3 - w], t))
341  { // -@@-?@@@@@@-?@@@
342  return false;
343  } // -@@@?@@@@@@-?@@@
344  if (!C::eval(p[3], t))
345  { // -@@@-@@@@@@-?@@@
346  return false;
347  } // -@@@@@@@@@@-?@@@
348  return true;
349  } // -?????@@@@@@?@@@
350  if (!C::eval(p[-3], t))
351  { // -?????@@@@@@-@@@
352  if (!C::eval(p[3 + w], t))
353  { // -????-@@@@@@-@@@
354  return false;
355  } // -????@@@@@@@-@@@
356  if (!C::eval(p[2 - 2 * w], t))
357  { // -?-??@@@@@@@-@@@
358  return false;
359  } // -?@??@@@@@@@-@@@
360  if (!C::eval(p[3 - w], t))
361  { // -?@-?@@@@@@@-@@@
362  return false;
363  } // -?@@?@@@@@@@-@@@
364  if (!C::eval(p[3], t))
365  { // -?@@-@@@@@@@-@@@
366  return false;
367  } // -?@@@@@@@@@@-@@@
368  return true;
369  } // -?????@@@@@@@@@@
370  return true;
371  } // @????????????@@@
372  if (!C::eval(p[-3], t))
373  { // @???????????-@@@
374  if (!C::eval(p[2 + 2 * w], t))
375  { // @?????-?????-@@@
376  return false;
377  } // @?????@?????-@@@
378  if (!C::eval(p[2 - 2 * w], t))
379  { // @?-???@?????-@@@
380  return false;
381  } // @?@???@?????-@@@
382  if (!C::eval(p[3 - w], t))
383  { // @?@-??@?????-@@@
384  return false;
385  } // @?@@??@?????-@@@
386  if (!C::eval(p[3 + w], t))
387  { // @?@@?-@?????-@@@
388  return false;
389  } // @?@@?@@?????-@@@
390  if (!C::eval(p[3], t))
391  { // @?@@-@@?????-@@@
392  return false;
393  } // @?@@@@@?????-@@@
394  if (!C::eval(p[1 - w3], t))
395  { // @-@@@@@?????-@@@
396  if (!C::eval(p[1 + w3], t))
397  { // @-@@@@@-????-@@@
398  return false;
399  } // @-@@@@@@????-@@@
400  if (!C::eval(p[-3 + w], t))
401  { // @-@@@@@@???--@@@
402  return false;
403  } // @-@@@@@@???@-@@@
404  if (!C::eval(p[w3], t))
405  { // @-@@@@@@-??@-@@@
406  return false;
407  } // @-@@@@@@@??@-@@@
408  if (!C::eval(p[-1 + w3], t))
409  { // @-@@@@@@@-?@-@@@
410  return false;
411  } // @-@@@@@@@@?@-@@@
412  if (!C::eval(p[-2 + 2 * w], t))
413  { // @-@@@@@@@@-@-@@@
414  return false;
415  } // @-@@@@@@@@@@-@@@
416  return true;
417  } // @@@@@@@?????-@@@
418  return true;
419  } // @???????????@@@@
420  if (!C::eval(p[1 - w3], t))
421  { // @-??????????@@@@
422  if (!C::eval(p[1 + w3], t))
423  { // @-?????-????@@@@
424  return false;
425  } // @-?????@????@@@@
426  if (!C::eval(p[-3 + w], t))
427  { // @-?????@???-@@@@
428  return false;
429  } // @-?????@???@@@@@
430  if (!C::eval(p[w3], t))
431  { // @-?????@-??@@@@@
432  return false;
433  } // @-?????@@??@@@@@
434  if (!C::eval(p[-1 + w3], t))
435  { // @-?????@@-?@@@@@
436  return false;
437  } // @-?????@@@?@@@@@
438  if (!C::eval(p[-2 + 2 * w], t))
439  { // @-?????@@@-@@@@@
440  return false;
441  } // @-?????@@@@@@@@@
442  return true;
443  } // @@??????????@@@@
444  if (!C::eval(p[2 - 2 * w], t))
445  { // @@-?????????@@@@
446  if (!C::eval(p[-3 + w], t))
447  { // @@-????????-@@@@
448  return false;
449  } // @@-????????@@@@@
450  if (!C::eval(p[w3], t))
451  { // @@-?????-??@@@@@
452  return false;
453  } // @@-?????@??@@@@@
454  if (!C::eval(p[-1 + w3], t))
455  { // @@-?????@-?@@@@@
456  return false;
457  } // @@-?????@@?@@@@@
458  if (!C::eval(p[-2 + 2 * w], t))
459  { // @@-?????@@-@@@@@
460  return false;
461  } // @@-?????@@@@@@@@
462  return true;
463  } // @@@?????????@@@@
464  if (!C::eval(p[-3 + w], t))
465  { // @@@????????-@@@@
466  if (!C::eval(p[3 - w], t))
467  { // @@@-???????-@@@@
468  return false;
469  } // @@@@???????-@@@@
470  if (!C::eval(p[3], t))
471  { // @@@@-??????-@@@@
472  return false;
473  } // @@@@@??????-@@@@
474  if (!C::eval(p[3 + w], t))
475  { // @@@@@-?????-@@@@
476  return false;
477  } // @@@@@@?????-@@@@
478  return true;
479  } // @@@????????@@@@@
480  if (!C::eval(p[-2 + 2 * w], t))
481  { // @@@???????-@@@@@
482  if (!C::eval(p[3 - w], t))
483  { // @@@-??????-@@@@@
484  return false;
485  } // @@@@??????-@@@@@
486  if (!C::eval(p[3], t))
487  { // @@@@-?????-@@@@@
488  return false;
489  } // @@@@@?????-@@@@@
490  return true;
491  } // @@@???????@@@@@@
492  if (!C::eval(p[3 - w], t))
493  { // @@@-??????@@@@@@
494  if (!C::eval(p[-1 + w3], t))
495  { // @@@-?????-@@@@@@
496  return false;
497  } // @@@-?????@@@@@@@
498  return true;
499  } // @@@@??????@@@@@@
500  return true;
501 }
GLdouble GLdouble t
Definition: glext.h:3689
bool is_corner_10(const uint8_t *p, const int w, const int barrier)
Definition: corner_10.h:16
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:4178
unsigned char uint8_t
Definition: rptypes.h:41
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