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



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019