Channel.hpp
Go to the documentation of this file.
1 
28 #pragma once
29 
30 #ifndef LVR2_TYPES_CHANNEL
31 #define LVR2_TYPES_CHANNEL
32 
33 #include "ElementProxy.hpp"
34 #include <memory>
35 #include <boost/optional.hpp>
36 #include <boost/shared_array.hpp>
37 #include <iostream>
38 
39 namespace lvr2 {
40 
41 template<typename T>
42 class Channel
43 {
44 public:
45  using Optional = boost::optional<Channel<T> >;
46  using Ptr = std::shared_ptr<Channel<T> >;
47  using DataType = T;
48  using DataPtr = boost::shared_array<T>;
49 
50  Channel();
51  Channel(size_t n, size_t width);
52  Channel(size_t n, size_t width, DataPtr ptr);
53 
54 
55  // clone
56  Channel<T> clone() const;
57 
58  ElementProxy<T> operator[](const unsigned& idx);
59  const ElementProxy<T> operator[](const unsigned& idx) const;
60 
61  size_t width() const;
62  size_t numElements() const;
63  const DataPtr dataPtr() const;
64  DataPtr dataPtr();
65 
66  friend std::ostream& operator<<(std::ostream& os, const Channel<T>& ch)
67  {
68  os << "size: [" << ch.numElements() << "," << ch.width() << "]";
69  return os;
70  }
71 
72 protected:
73  size_t m_numElements;
76 };
77 
78 template<typename T>
80 
81 template<typename T>
82 using ChannelPtr = typename Channel<T>::Ptr;
83 
84 template<typename T>
86 
90 
94 
98 
102 
103 
104 } // namespace lvr2
105 
106 #include "Channel.tcc"
107 
108 #endif // LVR2_TYPES_CHANNEL
lvr2::IndexChannelOptional
IndexChannel::Optional IndexChannelOptional
Definition: Channel.hpp:100
lvr2::FloatChannelPtr
FloatChannel::Ptr FloatChannelPtr
Definition: Channel.hpp:89
lvr2::UCharChannelOptional
UCharChannel::Optional UCharChannelOptional
Definition: Channel.hpp:96
lvr2::ElementProxy
Definition: ElementProxy.hpp:43
lvr2::Channel< float >::Optional
boost::optional< Channel< float > > Optional
Definition: Channel.hpp:45
lvr2::UCharChannelPtr
UCharChannel::Ptr UCharChannelPtr
Definition: Channel.hpp:97
lvr2::Channel::m_elementWidth
size_t m_elementWidth
Definition: Channel.hpp:74
lvr2::FloatChannelOptional
FloatChannel::Optional FloatChannelOptional
Definition: Channel.hpp:88
lvr2::Channel::m_numElements
size_t m_numElements
Definition: Channel.hpp:73
lvr2::IndexChannelPtr
IndexChannel::Ptr IndexChannelPtr
Definition: Channel.hpp:101
lvr2::ChannelOptional
typename Channel< T >::Optional ChannelOptional
Definition: Channel.hpp:85
lvr2::Channel< float >::Ptr
std::shared_ptr< Channel< float > > Ptr
Definition: Channel.hpp:46
lvr2::Channel::dataPtr
const DataPtr dataPtr() const
lvr2::Channel< float >::DataPtr
boost::shared_array< float > DataPtr
Definition: Channel.hpp:48
lvr2::Channel::clone
Channel< T > clone() const
lvr2::DoubleChannelOptional
DoubleChannel::Optional DoubleChannelOptional
Definition: Channel.hpp:92
lvr2::ChannelPtr
typename Channel< T >::Ptr ChannelPtr
Definition: Channel.hpp:82
lvr2::Channel
Definition: Channel.hpp:42
lvr2::Channel::m_data
DataPtr m_data
Definition: Channel.hpp:75
lvr2::Channel::Channel
Channel()
lvr2::Channel< float >::DataType
float DataType
Definition: Channel.hpp:47
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Channel::operator<<
friend std::ostream & operator<<(std::ostream &os, const Channel< T > &ch)
Definition: Channel.hpp:66
lvr2::Channel::width
size_t width() const
ElementProxy.hpp
lvr2::Channel::operator[]
ElementProxy< T > operator[](const unsigned &idx)
lvr2::DoubleChannelPtr
DoubleChannel::Ptr DoubleChannelPtr
Definition: Channel.hpp:93
lvr2::Channel::numElements
size_t numElements() const


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23