SLAMflex SE  0.1.0
SLAMflex provides detection and tracking of dominant planes for smartphone devices. This plane can then be used to show AR content relative to the plane orientation. The detection of plane is performed in the field of view of the smartphone camera. In subsequent frames it is tracked. The interface returns the plane position and orientation.
la.h
Go to the documentation of this file.
1 /*
2  This file is part of the CVD Library.
3 
4  Copyright (C) 2005 The Authors
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc.,
19  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 #ifndef CVD_LA_H
22 #define CVD_LA_H
23 
24 #include <iostream>
25 #include "is_pod.h"
26 
27 namespace CVD {
28 
29 
31  // CVD::La
32  // Template class to represent luminance and alpha components
33  //
37  template <typename T>
38  class La
39  {
40  public:
42  La() {}
46  La(T l, T a) : luminance(l), alpha(a) {}
47 
49  T alpha;
50 
53  La<T>& operator=(const La<T>& c)
54  {luminance = c.luminance; alpha = c.alpha; return *this;}
55 
58  template <typename T2>
59  La<T>& operator=(const La<T2>& c){
60  luminance = static_cast<T>(c.luminance);
61  alpha = static_cast<T>(c.alpha);
62  return *this;
63  }
64 
67  bool operator==(const La<T>& c) const
68  {return luminance == c.luminance && alpha == c.alpha;}
69 
72  bool operator!=(const La<T>& c) const
73  {return luminance != c.luminance || alpha != c.alpha;}
74 
75  };
76 
81  template <typename T>
82  std::ostream& operator <<(std::ostream& os, const La<T>& x)
83  {
84  return os << "(" << x.luminance << "," << x.alpha << ")";
85  }
86 
91  inline std::ostream& operator <<(std::ostream& os, const La<unsigned char>& x)
92  {
93  return os << "(" << static_cast<unsigned int>(x.luminance) << ","
94  << static_cast<unsigned int>(x.alpha) << ")";
95  }
96 
97  namespace Internal
98  {
99  template<class C> struct is_POD<La<C> >
100  {
102  };
103  }
104 
105 
106 
107 } // end namespace
108 #endif
109 
La()
Default constructor. Does nothing.
Definition: la.h:42
La< T > & operator=(const La< T2 > &c)
Definition: la.h:59
T alpha
The alpha component.
Definition: la.h:49
bool operator!=(const La< T > &c) const
Definition: la.h:72
Definition: abs.h:24
La(T l, T a)
Definition: la.h:46
T luminance
The luminance component.
Definition: la.h:48
bool operator==(const La< T > &c) const
Definition: la.h:67
La< T > & operator=(const La< T > &c)
Definition: la.h:53
Definition: la.h:38