Public Types | Public Member Functions | Private Attributes | List of all members
SurgSim::DataStructures::Image< T > Class Template Reference

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
 

Detailed Description

template<class T>
class SurgSim::DataStructures::Image< T >

A templated Image class.

Template Parameters
Tthe data type stored in the Image

Member Typedef Documentation

template<class T>
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.

Constructor & Destructor Documentation

template<class T >
SurgSim::DataStructures::Image< T >::Image ( )

Default Constructor.

template<class T >
SurgSim::DataStructures::Image< T >::Image ( size_t  width,
size_t  height,
size_t  channels 
)

Constructor.

Parameters
widththe image width
heightthe image height
channelsthe number of channels in the image
template<class T >
SurgSim::DataStructures::Image< T >::Image ( size_t  width,
size_t  height,
size_t  channels,
const T *const  data 
)

Copy constructor from a data pointer.

Parameters
widththe image width
heightthe image height
channelsthe number of channels in the image
datapointer to the data to copy from
template<class T >
SurgSim::DataStructures::Image< T >::Image ( const Image< T > &  other)

Copy constructor.

Parameters
otherImage to copy from
template<class T >
SurgSim::DataStructures::Image< T >::Image ( Image< T > &&  other)

Move constructor.

Parameters
otherImage to move data from
template<class T >
SurgSim::DataStructures::Image< T >::~Image ( )
virtual

Destructor.

Member Function Documentation

template<class T >
Image< T >::ChannelType SurgSim::DataStructures::Image< T >::getChannel ( size_t  channel)

Get the data in the channel as an eigen matrix.

Parameters
channelthe channel number
Returns
an eigen matrix
template<class T >
T *const SurgSim::DataStructures::Image< T >::getData ( )

Get the pointer to the data.

Returns
the data
template<class T >
const T *const SurgSim::DataStructures::Image< T >::getData ( ) const

Get the pointer to the data, constant version.

Returns
the data
template<class T >
size_t SurgSim::DataStructures::Image< T >::getHeight ( ) const

Get the Image height.

Returns
the height
template<class T >
size_t SurgSim::DataStructures::Image< T >::getNumChannels ( ) const

Get the number of channels in this Image.

Returns
the number of channels
template<class T >
std::array< size_t, 3 > SurgSim::DataStructures::Image< T >::getSize ( ) const

Get the Image size.

Returns
the image size as (width, height, channels)
template<class T >
size_t SurgSim::DataStructures::Image< T >::getWidth ( ) const

Get the Image width.

Returns
the width
template<class T >
Image< T > & SurgSim::DataStructures::Image< T >::operator= ( const Image< T > &  other)

Assignment Operator.

Parameters
otherThe Image to copy from
Returns
The Image that was assigned into
template<class T >
Image< T > & SurgSim::DataStructures::Image< T >::operator= ( Image< T > &&  other)

Move Assignment Operator.

Parameters
otherThe Image to move data from
Returns
The Image that was assigned into

Member Data Documentation

template<class T>
size_t SurgSim::DataStructures::Image< T >::m_channels
private
template<class T>
std::unique_ptr<T[]> SurgSim::DataStructures::Image< T >::m_data
private
template<class T>
size_t SurgSim::DataStructures::Image< T >::m_height
private
template<class T>
size_t SurgSim::DataStructures::Image< T >::m_width
private

The documentation for this class was generated from the following files: