17 #ifndef SURGSIM_DATASTRUCTURES_IMAGE_INL_H 18 #define SURGSIM_DATASTRUCTURES_IMAGE_INL_H 24 namespace DataStructures
29 m_width(0), m_height(0), m_channels(0)
41 Image<T>::Image(
size_t width,
size_t height,
size_t channels,
const T*
const data) :
44 std::copy(data, data + width * height * channels,
m_data.get());
59 *
this = std::move(other);
69 if (newDataSize != oldDataSize)
71 m_data.reset(
new T[newDataSize]);
86 m_data = std::move(other.m_data);
126 return std::move(size);
150 #endif //SURGSIM_DATASTRUCTURES_IMAGE_INL_H Definition: DriveElementFromInputBehavior.cpp:27
std::unique_ptr< T[]> m_data
Definition: Image.h:110
A templated Image class.
Definition: Image.h:34
size_t getHeight() const
Get the Image height.
Definition: Image-inl.h:117
size_t m_width
Definition: Image.h:107
std::array< size_t, 3 > getSize() const
Get the Image size.
Definition: Image-inl.h:123
#define SURGSIM_ASSERT(condition)
Assert that condition is true.
Definition: Assert.h:77
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, 0, Eigen::InnerStride<> > ChannelType
Type of the channel returned by getChannel.
Definition: Image.h:91
Image< T > & operator=(const Image< T > &other)
Assignment Operator.
Definition: Image-inl.h:63
size_t m_height
Definition: Image.h:108
Image()
Default Constructor.
Definition: Image-inl.h:28
size_t m_channels
Definition: Image.h:109
The header that provides the assertion API.
size_t getWidth() const
Get the Image width.
Definition: Image-inl.h:111
virtual ~Image()
Destructor.
Definition: Image-inl.h:99
T *const getData()
Get the pointer to the data.
Definition: Image-inl.h:136
ChannelType getChannel(size_t channel)
Get the data in the channel as an eigen matrix.
Definition: Image-inl.h:104
size_t getNumChannels() const
Get the number of channels in this Image.
Definition: Image-inl.h:130