Main MRPT website > C++ reference for MRPT 1.9.9
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>
16 inline bool is_corner_9(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[w3], t))
23  { // ????????-??????-
24  return false;
25  } // ????????@??????-
26  if (!C::eval(p[1 + w3], t))
27  { // ???????-@??????-
28  return false;
29  } // ???????@@??????-
30  if (!C::eval(p[2 + 2 * w], t))
31  { // ??????-@@??????-
32  return false;
33  } // ??????@@@??????-
34  if (!C::eval(p[3 + w], t))
35  { // ?????-@@@??????-
36  if (!C::eval(p[-2 - 2 * w], t))
37  { // ?????-@@@?????--
38  return false;
39  } // ?????-@@@?????@-
40  if (!C::eval(p[-3 - w], t))
41  { // ?????-@@@????-@-
42  return false;
43  } // ?????-@@@????@@-
44  if (!C::eval(p[-1 + w3], t))
45  { // ?????-@@@-???@@-
46  return false;
47  } // ?????-@@@@???@@-
48  if (!C::eval(p[-2 + 2 * w], t))
49  { // ?????-@@@@-??@@-
50  return false;
51  } // ?????-@@@@@??@@-
52  if (!C::eval(p[-3 + w], t))
53  { // ?????-@@@@@-?@@-
54  return false;
55  } // ?????-@@@@@@?@@-
56  if (!C::eval(p[-3], t))
57  { // ?????-@@@@@@-@@-
58  return false;
59  } // ?????-@@@@@@@@@-
60  return true;
61  } // ?????@@@@??????-
62  if (!C::eval(p[3], t))
63  { // ????-@@@@??????-
64  if (!C::eval(p[-3 - w], t))
65  { // ????-@@@@????-?-
66  return false;
67  } // ????-@@@@????@?-
68  if (!C::eval(p[-1 + w3], t))
69  { // ????-@@@@-???@?-
70  return false;
71  } // ????-@@@@@???@?-
72  if (!C::eval(p[-2 + 2 * w], t))
73  { // ????-@@@@@-??@?-
74  return false;
75  } // ????-@@@@@@??@?-
76  if (!C::eval(p[-3 + w], t))
77  { // ????-@@@@@@-?@?-
78  return false;
79  } // ????-@@@@@@@?@?-
80  if (!C::eval(p[-3], 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  if (!C::eval(p[-2 + 2 * w], t))
93  { // ???-@@@@@@-????-
94  return false;
95  } // ???-@@@@@@@????-
96  if (!C::eval(p[-3 + w], t))
97  { // ???-@@@@@@@-???-
98  return false;
99  } // ???-@@@@@@@@???-
100  if (!C::eval(p[-3], t))
101  { // ???-@@@@@@@@-??-
102  return false;
103  } // ???-@@@@@@@@@??-
104  return true;
105  } // ???@@@@@@??????-
106  if (!C::eval(p[-1 + w3], t))
107  { // ???@@@@@@-?????-
108  if (!C::eval(p[-w3], t))
109  { // -??@@@@@@-?????-
110  return false;
111  } // @??@@@@@@-?????-
112  if (!C::eval(p[1 - w3], t))
113  { // @-?@@@@@@-?????-
114  return false;
115  } // @@?@@@@@@-?????-
116  if (!C::eval(p[2 - 2 * w], t))
117  { // @@-@@@@@@-?????-
118  return false;
119  } // @@@@@@@@@-?????-
120  return true;
121  } // ???@@@@@@@?????-
122  if (!C::eval(p[2 - 2 * w], t))
123  { // ??-@@@@@@@?????-
124  if (!C::eval(p[-2 + 2 * w], t))
125  { // ??-@@@@@@@-????-
126  return false;
127  } // ??-@@@@@@@@????-
128  if (!C::eval(p[-3 + w], t))
129  { // ??-@@@@@@@@-???-
130  return false;
131  } // ??-@@@@@@@@@???-
132  return true;
133  } // ??@@@@@@@@?????-
134  if (!C::eval(p[-2 + 2 * w], t))
135  { // ??@@@@@@@@-????-
136  if (!C::eval(p[1 - w3], t))
137  { // ?-@@@@@@@@-????-
138  return false;
139  } // ?@@@@@@@@@-????-
140  return true;
141  } // ??@@@@@@@@@????-
142  return true;
143  } // ???????????????@
144  if (!C::eval(p[-2 - 2 * w], t))
145  { // ??????????????-@
146  if (!C::eval(p[3 + w], t))
147  { // ?????-????????-@
148  return false;
149  } // ?????@????????-@
150  if (!C::eval(p[1 + w3], t))
151  { // ?????@?-??????-@
152  return false;
153  } // ?????@?@??????-@
154  if (!C::eval(p[2 + 2 * w], t))
155  { // ?????@-@??????-@
156  return false;
157  } // ?????@@@??????-@
158  if (!C::eval(p[3], t))
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  if (!C::eval(p[w3], t))
169  { // ????-@@@-???@@-@
170  return false;
171  } // ????-@@@@???@@-@
172  if (!C::eval(p[-1 + w3], t))
173  { // ????-@@@@-??@@-@
174  return false;
175  } // ????-@@@@@??@@-@
176  if (!C::eval(p[-2 + 2 * w], t))
177  { // ????-@@@@@-?@@-@
178  return false;
179  } // ????-@@@@@@?@@-@
180  if (!C::eval(p[-3 + w], t))
181  { // ????-@@@@@@-@@-@
182  return false;
183  } // ????-@@@@@@@@@-@
184  return true;
185  } // ????@@@@??????-@
186  if (!C::eval(p[3 - w], t))
187  { // ???-@@@@??????-@
188  if (!C::eval(p[-3], t))
189  { // ???-@@@@????-?-@
190  return false;
191  } // ???-@@@@????@?-@
192  if (!C::eval(p[w3], t))
193  { // ???-@@@@-???@?-@
194  return false;
195  } // ???-@@@@@???@?-@
196  if (!C::eval(p[-1 + w3], t))
197  { // ???-@@@@@-??@?-@
198  return false;
199  } // ???-@@@@@@??@?-@
200  if (!C::eval(p[-2 + 2 * w], t))
201  { // ???-@@@@@@-?@?-@
202  return false;
203  } // ???-@@@@@@@?@?-@
204  if (!C::eval(p[-3 + w], t))
205  { // ???-@@@@@@@-@?-@
206  return false;
207  } // ???-@@@@@@@@@?-@
208  return true;
209  } // ???@@@@@??????-@
210  if (!C::eval(p[2 - 2 * w], t))
211  { // ??-@@@@@??????-@
212  if (!C::eval(p[w3], t))
213  { // ??-@@@@@-?????-@
214  return false;
215  } // ??-@@@@@@?????-@
216  if (!C::eval(p[-1 + w3], t))
217  { // ??-@@@@@@-????-@
218  return false;
219  } // ??-@@@@@@@????-@
220  if (!C::eval(p[-2 + 2 * w], t))
221  { // ??-@@@@@@@-???-@
222  return false;
223  } // ??-@@@@@@@@???-@
224  if (!C::eval(p[-3 + w], t))
225  { // ??-@@@@@@@@-??-@
226  return false;
227  } // ??-@@@@@@@@@??-@
228  return true;
229  } // ??@@@@@@??????-@
230  if (!C::eval(p[1 - w3], t))
231  { // ?-@@@@@@??????-@
232  if (!C::eval(p[w3], t))
233  { // ?-@@@@@@-?????-@
234  return false;
235  } // ?-@@@@@@@?????-@
236  if (!C::eval(p[-1 + w3], t))
237  { // ?-@@@@@@@-????-@
238  return false;
239  } // ?-@@@@@@@@????-@
240  if (!C::eval(p[-2 + 2 * w], t))
241  { // ?-@@@@@@@@-???-@
242  return false;
243  } // ?-@@@@@@@@@???-@
244  return true;
245  } // ?@@@@@@@??????-@
246  if (!C::eval(p[-w3], t))
247  { // -@@@@@@@??????-@
248  if (!C::eval(p[w3], t))
249  { // -@@@@@@@-?????-@
250  return false;
251  } // -@@@@@@@@?????-@
252  if (!C::eval(p[-1 + w3], t))
253  { // -@@@@@@@@-????-@
254  return false;
255  } // -@@@@@@@@@????-@
256  return true;
257  } // @@@@@@@@??????-@
258  return true;
259  } // ??????????????@@
260  if (!C::eval(p[-w3], t))
261  { // -?????????????@@
262  if (!C::eval(p[1 + w3], t))
263  { // -??????-??????@@
264  return false;
265  } // -??????@??????@@
266  if (!C::eval(p[-1 + w3], t))
267  { // -??????@?-????@@
268  return false;
269  } // -??????@?@????@@
270  if (!C::eval(p[w3], t))
271  { // -??????@-@????@@
272  return false;
273  } // -??????@@@????@@
274  if (!C::eval(p[-2 + 2 * w], t))
275  { // -??????@@@-???@@
276  if (!C::eval(p[2 + 2 * w], t))
277  { // -?????-@@@-???@@
278  return false;
279  } // -?????@@@@-???@@
280  if (!C::eval(p[3 + w], t))
281  { // -????-@@@@-???@@
282  return false;
283  } // -????@@@@@-???@@
284  if (!C::eval(p[1 - w3], t))
285  { // --???@@@@@-???@@
286  return false;
287  } // -@???@@@@@-???@@
288  if (!C::eval(p[2 - 2 * w], t))
289  { // -@-??@@@@@-???@@
290  return false;
291  } // -@@??@@@@@-???@@
292  if (!C::eval(p[3 - w], t))
293  { // -@@-?@@@@@-???@@
294  return false;
295  } // -@@@?@@@@@-???@@
296  if (!C::eval(p[3], t))
297  { // -@@@-@@@@@-???@@
298  return false;
299  } // -@@@@@@@@@-???@@
300  return true;
301  } // -??????@@@@???@@
302  if (!C::eval(p[-3 + w], t))
303  { // -??????@@@@-??@@
304  if (!C::eval(p[2 + 2 * w], t))
305  { // -?????-@@@@-??@@
306  return false;
307  } // -?????@@@@@-??@@
308  if (!C::eval(p[2 - 2 * w], t))
309  { // -?-???@@@@@-??@@
310  return false;
311  } // -?@???@@@@@-??@@
312  if (!C::eval(p[3 - w], t))
313  { // -?@-??@@@@@-??@@
314  return false;
315  } // -?@@??@@@@@-??@@
316  if (!C::eval(p[3], t))
317  { // -?@@-?@@@@@-??@@
318  return false;
319  } // -?@@@?@@@@@-??@@
320  if (!C::eval(p[3 + w], t))
321  { // -?@@@-@@@@@-??@@
322  return false;
323  } // -?@@@@@@@@@-??@@
324  return true;
325  } // -??????@@@@@??@@
326  if (!C::eval(p[-3], t))
327  { // -??????@@@@@-?@@
328  if (!C::eval(p[3 - w], t))
329  { // -??-???@@@@@-?@@
330  return false;
331  } // -??@???@@@@@-?@@
332  if (!C::eval(p[3], t))
333  { // -??@-??@@@@@-?@@
334  return false;
335  } // -??@@??@@@@@-?@@
336  if (!C::eval(p[3 + w], t))
337  { // -??@@-?@@@@@-?@@
338  return false;
339  } // -??@@@?@@@@@-?@@
340  if (!C::eval(p[2 + 2 * w], t))
341  { // -??@@@-@@@@@-?@@
342  return false;
343  } // -??@@@@@@@@@-?@@
344  return true;
345  } // -??????@@@@@@?@@
346  if (!C::eval(p[-3 - w], t))
347  { // -??????@@@@@@-@@
348  if (!C::eval(p[3], t))
349  { // -???-??@@@@@@-@@
350  return false;
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  return true;
361  } // -??????@@@@@@@@@
362  return true;
363  } // @?????????????@@
364  if (!C::eval(p[-3 - w], t))
365  { // @????????????-@@
366  if (!C::eval(p[2 + 2 * w], t))
367  { // @?????-??????-@@
368  return false;
369  } // @?????@??????-@@
370  if (!C::eval(p[3 + w], t))
371  { // @????-@??????-@@
372  return false;
373  } // @????@@??????-@@
374  if (!C::eval(p[3], t))
375  { // @???-@@??????-@@
376  return false;
377  } // @???@@@??????-@@
378  if (!C::eval(p[3 - w], t))
379  { // @??-@@@??????-@@
380  if (!C::eval(p[-3], t))
381  { // @??-@@@?????--@@
382  return false;
383  } // @??-@@@?????@-@@
384  if (!C::eval(p[-3 + w], t))
385  { // @??-@@@????-@-@@
386  return false;
387  } // @??-@@@????@@-@@
388  if (!C::eval(p[1 + w3], t))
389  { // @??-@@@-???@@-@@
390  return false;
391  } // @??-@@@@???@@-@@
392  if (!C::eval(p[w3], t))
393  { // @??-@@@@-??@@-@@
394  return false;
395  } // @??-@@@@@??@@-@@
396  if (!C::eval(p[-1 + w3], t))
397  { // @??-@@@@@-?@@-@@
398  return false;
399  } // @??-@@@@@@?@@-@@
400  if (!C::eval(p[-2 + 2 * w], t))
401  { // @??-@@@@@@-@@-@@
402  return false;
403  } // @??-@@@@@@@@@-@@
404  return true;
405  } // @??@@@@??????-@@
406  if (!C::eval(p[2 - 2 * w], t))
407  { // @?-@@@@??????-@@
408  if (!C::eval(p[-3 + w], t))
409  { // @?-@@@@????-?-@@
410  return false;
411  } // @?-@@@@????@?-@@
412  if (!C::eval(p[1 + w3], t))
413  { // @?-@@@@-???@?-@@
414  return false;
415  } // @?-@@@@@???@?-@@
416  if (!C::eval(p[w3], t))
417  { // @?-@@@@@-??@?-@@
418  return false;
419  } // @?-@@@@@@??@?-@@
420  if (!C::eval(p[-1 + w3], t))
421  { // @?-@@@@@@-?@?-@@
422  return false;
423  } // @?-@@@@@@@?@?-@@
424  if (!C::eval(p[-2 + 2 * w], t))
425  { // @?-@@@@@@@-@?-@@
426  return false;
427  } // @?-@@@@@@@@@?-@@
428  return true;
429  } // @?@@@@@??????-@@
430  if (!C::eval(p[1 - w3], t))
431  { // @-@@@@@??????-@@
432  if (!C::eval(p[1 + w3], t))
433  { // @-@@@@@-?????-@@
434  return false;
435  } // @-@@@@@@?????-@@
436  if (!C::eval(p[w3], t))
437  { // @-@@@@@@-????-@@
438  return false;
439  } // @-@@@@@@@????-@@
440  if (!C::eval(p[-1 + w3], t))
441  { // @-@@@@@@@-???-@@
442  return false;
443  } // @-@@@@@@@@???-@@
444  if (!C::eval(p[-2 + 2 * w], t))
445  { // @-@@@@@@@@-??-@@
446  return false;
447  } // @-@@@@@@@@@??-@@
448  return true;
449  } // @@@@@@@??????-@@
450  return true;
451  } // @????????????@@@
452  if (!C::eval(p[1 - w3], t))
453  { // @-???????????@@@
454  if (!C::eval(p[-2 + 2 * w], t))
455  { // @-????????-??@@@
456  return false;
457  } // @-????????@??@@@
458  if (!C::eval(p[-1 + w3], t))
459  { // @-???????-@??@@@
460  return false;
461  } // @-???????@@??@@@
462  if (!C::eval(p[w3], t))
463  { // @-??????-@@??@@@
464  return false;
465  } // @-??????@@@??@@@
466  if (!C::eval(p[-3 + w], t))
467  { // @-??????@@@-?@@@
468  if (!C::eval(p[1 + w3], t))
469  { // @-?????-@@@-?@@@
470  return false;
471  } // @-?????@@@@-?@@@
472  if (!C::eval(p[2 + 2 * w], t))
473  { // @-????-@@@@-?@@@
474  return false;
475  } // @-????@@@@@-?@@@
476  if (!C::eval(p[2 - 2 * w], t))
477  { // @--???@@@@@-?@@@
478  return false;
479  } // @-@???@@@@@-?@@@
480  if (!C::eval(p[3 - w], t))
481  { // @-@-??@@@@@-?@@@
482  return false;
483  } // @-@@??@@@@@-?@@@
484  if (!C::eval(p[3], t))
485  { // @-@@-?@@@@@-?@@@
486  return false;
487  } // @-@@@?@@@@@-?@@@
488  if (!C::eval(p[3 + w], t))
489  { // @-@@@-@@@@@-?@@@
490  return false;
491  } // @-@@@@@@@@@-?@@@
492  return true;
493  } // @-??????@@@@?@@@
494  if (!C::eval(p[-3], t))
495  { // @-??????@@@@-@@@
496  if (!C::eval(p[1 + w3], t))
497  { // @-?????-@@@@-@@@
498  return false;
499  } // @-?????@@@@@-@@@
500  if (!C::eval(p[3 - w], t))
501  { // @-?-???@@@@@-@@@
502  return false;
503  } // @-?@???@@@@@-@@@
504  if (!C::eval(p[3], t))
505  { // @-?@-??@@@@@-@@@
506  return false;
507  } // @-?@@??@@@@@-@@@
508  if (!C::eval(p[3 + w], t))
509  { // @-?@@-?@@@@@-@@@
510  return false;
511  } // @-?@@@?@@@@@-@@@
512  if (!C::eval(p[2 + 2 * w], t))
513  { // @-?@@@-@@@@@-@@@
514  return false;
515  } // @-?@@@@@@@@@-@@@
516  return true;
517  } // @-??????@@@@@@@@
518  return true;
519  } // @@???????????@@@
520  if (!C::eval(p[-3], t))
521  { // @@??????????-@@@
522  if (!C::eval(p[3 + w], t))
523  { // @@???-??????-@@@
524  return false;
525  } // @@???@??????-@@@
526  if (!C::eval(p[3], t))
527  { // @@??-@??????-@@@
528  return false;
529  } // @@??@@??????-@@@
530  if (!C::eval(p[3 - w], t))
531  { // @@?-@@??????-@@@
532  return false;
533  } // @@?@@@??????-@@@
534  if (!C::eval(p[2 - 2 * w], t))
535  { // @@-@@@??????-@@@
536  if (!C::eval(p[-3 + w], t))
537  { // @@-@@@?????--@@@
538  return false;
539  } // @@-@@@?????@-@@@
540  if (!C::eval(p[-2 + 2 * w], t))
541  { // @@-@@@????-@-@@@
542  return false;
543  } // @@-@@@????@@-@@@
544  if (!C::eval(p[2 + 2 * w], t))
545  { // @@-@@@-???@@-@@@
546  return false;
547  } // @@-@@@@???@@-@@@
548  if (!C::eval(p[1 + w3], t))
549  { // @@-@@@@-??@@-@@@
550  return false;
551  } // @@-@@@@@??@@-@@@
552  if (!C::eval(p[w3], t))
553  { // @@-@@@@@-?@@-@@@
554  return false;
555  } // @@-@@@@@@?@@-@@@
556  if (!C::eval(p[-1 + w3], t))
557  { // @@-@@@@@@-@@-@@@
558  return false;
559  } // @@-@@@@@@@@@-@@@
560  return true;
561  } // @@@@@@??????-@@@
562  return true;
563  } // @@??????????@@@@
564  if (!C::eval(p[2 - 2 * w], t))
565  { // @@-?????????@@@@
566  if (!C::eval(p[-1 + w3], t))
567  { // @@-??????-??@@@@
568  return false;
569  } // @@-??????@??@@@@
570  if (!C::eval(p[-2 + 2 * w], t))
571  { // @@-??????@-?@@@@
572  return false;
573  } // @@-??????@@?@@@@
574  if (!C::eval(p[-3 + w], t))
575  { // @@-??????@@-@@@@
576  return false;
577  } // @@-??????@@@@@@@
578  return true;
579  } // @@@?????????@@@@
580  if (!C::eval(p[-3 + w], t))
581  { // @@@????????-@@@@
582  if (!C::eval(p[3 - w], t))
583  { // @@@-???????-@@@@
584  return false;
585  } // @@@@???????-@@@@
586  if (!C::eval(p[3], t))
587  { // @@@@-??????-@@@@
588  return false;
589  } // @@@@@??????-@@@@
590  return true;
591  } // @@@????????@@@@@
592  if (!C::eval(p[3 - w], t))
593  { // @@@-???????@@@@@
594  if (!C::eval(p[-2 + 2 * w], t))
595  { // @@@-??????-@@@@@
596  return false;
597  } // @@@-??????@@@@@@
598  return true;
599  } // @@@@???????@@@@@
600  return true;
601 }
GLdouble GLdouble t
Definition: glext.h:3689
bool is_corner_9(const uint8_t *p, const int w, const int barrier)
Definition: corner_9.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