Main MRPT website > C++ reference for MRPT 1.5.6
faster_corner_utilities.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 #ifndef MRPT_CVD_INTERNAL_INC_FAST_CORNER_UTILITIES_H
16 #define MRPT_CVD_INTERNAL_INC_FAST_CORNER_UTILITIES_H
17 
18 #include <mrpt/utils/SSE_types.h>
19 
20 namespace mrpt
21 {
22  struct Less
23  {
24  template <class T1, class T2> static bool eval(const T1 a, const T2 b)
25  {
26  return a < b;
27  }
28  static int prep_t(int pixel_val, int barrier)
29  {
30  return pixel_val - barrier;
31  }
32  };
33  struct Greater
34  {
35  template <class T1, class T2> static bool eval(const T1 a, const T2 b)
36  {
37  return a > b;
38  }
39  static int prep_t(int pixel_val, int barrier)
40  {
41  return pixel_val + barrier;
42  }
43  };
44 
45 #if MRPT_HAS_SSE2
46 
47  #define CHECK_BARRIER(lo, hi, other, flags) \
48  { \
49  __m128i diff = _mm_subs_epu8(lo, other); \
50  __m128i diff2 = _mm_subs_epu8(other, hi); \
51  __m128i z = _mm_setzero_si128(); \
52  diff = _mm_cmpeq_epi8(diff, z); \
53  diff2 = _mm_cmpeq_epi8(diff2, z); \
54  flags = ~(_mm_movemask_epi8(diff) | (_mm_movemask_epi8(diff2) << 16)); \
55  }
56 
57  template <bool Aligned> inline __m128i load_si128(const void* addr) { return _mm_loadu_si128((const __m128i*)addr); }
58  template <> inline __m128i load_si128<true>(const void* addr) { return _mm_load_si128((const __m128i*)addr); }
59 
60 #endif
61 
62 }
63 #endif
__m128i load_si128(const void *addr)
static bool eval(const T1 a, const T2 b)
static int prep_t(int pixel_val, int barrier)
__m128i load_si128< true >(const void *addr)
static bool eval(const T1 a, const T2 b)
GLubyte GLubyte b
Definition: glext.h:5575
static int prep_t(int pixel_val, int barrier)
GLenum const GLvoid * addr
Definition: glext.h:6306
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte a
Definition: glext.h:5575



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