![]() |
A templated Image class. More...
#include <SurgSim/DataStructures/Image.h>
Public Types | |
typedef Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic >, 0, Eigen::InnerStride<> > | ChannelType |
Type of the channel returned by getChannel. More... | |
Public Member Functions | |
Image () | |
Default Constructor. More... | |
Image (size_t width, size_t height, size_t channels) | |
Constructor. More... | |
Image (size_t width, size_t height, size_t channels, const T *const data) | |
Copy constructor from a data pointer. More... | |
Image (const Image< T > &other) | |
Copy constructor. More... | |
Image (Image< T > &&other) | |
Move constructor. More... | |
virtual | ~Image () |
Destructor. More... | |
Image< T > & | operator= (const Image< T > &other) |
Assignment Operator. More... | |
Image< T > & | operator= (Image< T > &&other) |
Move Assignment Operator. More... | |
size_t | getWidth () const |
Get the Image width. More... | |
size_t | getHeight () const |
Get the Image height. More... | |
std::array< size_t, 3 > | getSize () const |
Get the Image size. More... | |
size_t | getNumChannels () const |
Get the number of channels in this Image. More... | |
ChannelType | getChannel (size_t channel) |
Get the data in the channel as an eigen matrix. More... | |
T *const | getData () |
Get the pointer to the data. More... | |
const T *const | getData () const |
Get the pointer to the data, constant version. More... | |
Private Attributes | |
size_t | m_width |
size_t | m_height |
size_t | m_channels |
std::unique_ptr< T[]> | m_data |
A templated Image class.
T | the data type stored in the Image |
typedef Eigen::Map<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>, 0, Eigen::InnerStride<> > SurgSim::DataStructures::Image< T >::ChannelType |
Type of the channel returned by getChannel.
SurgSim::DataStructures::Image< T >::Image | ( | ) |
Default Constructor.
SurgSim::DataStructures::Image< T >::Image | ( | size_t | width, |
size_t | height, | ||
size_t | channels | ||
) |
Constructor.
width | the image width |
height | the image height |
channels | the number of channels in the image |
SurgSim::DataStructures::Image< T >::Image | ( | size_t | width, |
size_t | height, | ||
size_t | channels, | ||
const T *const | data | ||
) |
Copy constructor from a data pointer.
width | the image width |
height | the image height |
channels | the number of channels in the image |
data | pointer to the data to copy from |
SurgSim::DataStructures::Image< T >::Image | ( | const Image< T > & | other | ) |
Copy constructor.
other | Image to copy from |
SurgSim::DataStructures::Image< T >::Image | ( | Image< T > && | other | ) |
Move constructor.
other | Image to move data from |
|
virtual |
Destructor.
Image< T >::ChannelType SurgSim::DataStructures::Image< T >::getChannel | ( | size_t | channel | ) |
Get the data in the channel as an eigen matrix.
channel | the channel number |
T *const SurgSim::DataStructures::Image< T >::getData | ( | ) |
Get the pointer to the data.
const T *const SurgSim::DataStructures::Image< T >::getData | ( | ) | const |
Get the pointer to the data, constant version.
size_t SurgSim::DataStructures::Image< T >::getHeight | ( | ) | const |
Get the Image height.
size_t SurgSim::DataStructures::Image< T >::getNumChannels | ( | ) | const |
Get the number of channels in this Image.
std::array< size_t, 3 > SurgSim::DataStructures::Image< T >::getSize | ( | ) | const |
Get the Image size.
size_t SurgSim::DataStructures::Image< T >::getWidth | ( | ) | const |
Get the Image width.
Image< T > & SurgSim::DataStructures::Image< T >::operator= | ( | const Image< T > & | other | ) |
Image< T > & SurgSim::DataStructures::Image< T >::operator= | ( | Image< T > && | other | ) |
|
private |
|
private |
|
private |
|
private |