opensurgsim
|
Base class for Image-like classes. More...
#include <ImageBase.h>
Public Types | |
typedef Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | ChannelType |
2D Channel Type; | |
typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > | VectorType |
1D Vector Type; | |
Public Member Functions | |
virtual | ~ImageBase () |
Destructor. | |
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... | |
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 > > | operator() (size_t x, size_t y) |
Get the pixel value at (x, y) More... | |
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 > > | operator() (size_t x, size_t y) const |
Get the pixel value at (x, y), constant version. More... | |
Eigen::Map< ChannelType, Eigen::Unaligned, Eigen::Stride<-1, -1 > > | getChannel (size_t index) |
Get the 2D image channel data. More... | |
Eigen::Map< const ChannelType, Eigen::Unaligned, Eigen::Stride<-1, -1 > > | getChannel (size_t index) const |
Get the 2D image channel data, constant version. More... | |
void | setChannel (size_t index, const Eigen::Ref< const ChannelType > &data) |
Set the image data in the channel. More... | |
Eigen::Map< VectorType, Eigen::Unaligned > | getAsVector () |
Get the data as a 1D Vector. More... | |
Eigen::Map< const VectorType, Eigen::Unaligned > | getAsVector () const |
Get the data as a 1D Vector, constant version. More... | |
void | setAsVector (const Eigen::Ref< const VectorType > &data) |
Set the image data as a 1D Vector. More... | |
virtual T *const | getData ()=0 |
Get the pointer to the data. More... | |
virtual const T *const | getData () const =0 |
Get the pointer to the data, constant version. More... | |
Protected Member Functions | |
void | setSize (size_t width, size_t height, size_t channels) |
Set the Image size. More... | |
Base class for Image-like classes.
T | the data type of the image data |
Eigen::Map< typename ImageBase< T >::VectorType, Eigen::Unaligned > SurgSim::DataStructures::ImageBase< T >::getAsVector | ( | ) |
Get the data as a 1D Vector.
Eigen::Map< const typename ImageBase< T >::VectorType, Eigen::Unaligned > SurgSim::DataStructures::ImageBase< T >::getAsVector | ( | ) | const |
Get the data as a 1D Vector, constant version.
Eigen::Map< typename ImageBase< T >::ChannelType, Eigen::Unaligned, Eigen::Stride<-1, -1 > > SurgSim::DataStructures::ImageBase< T >::getChannel | ( | size_t | index | ) |
Get the 2D image channel data.
index | the channel number |
Eigen::Map< const typename ImageBase< T >::ChannelType, Eigen::Unaligned, Eigen::Stride<-1, -1 > > SurgSim::DataStructures::ImageBase< T >::getChannel | ( | size_t | index | ) | const |
Get the 2D image channel data, constant version.
index | the channel number |
|
pure virtual |
Get the pointer to the data.
Implemented in SurgSim::DataStructures::Image< T >, and SurgSim::DataStructures::ImageMap< T >.
|
pure virtual |
Get the pointer to the data, constant version.
Implemented in SurgSim::DataStructures::Image< T >, and SurgSim::DataStructures::ImageMap< T >.
size_t SurgSim::DataStructures::ImageBase< T >::getHeight | ( | ) | const |
Get the Image height.
size_t SurgSim::DataStructures::ImageBase< T >::getNumChannels | ( | ) | const |
Get the number of channels in this Image.
std::array< size_t, 3 > SurgSim::DataStructures::ImageBase< T >::getSize | ( | ) | const |
Get the Image size.
size_t SurgSim::DataStructures::ImageBase< T >::getWidth | ( | ) | const |
Get the Image width.
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, 1 > > SurgSim::DataStructures::ImageBase< T >::operator() | ( | size_t | x, |
size_t | y | ||
) |
Get the pixel value at (x, y)
x | The horizontal image position |
y | The vertical image position |
Eigen::Map< const Eigen::Matrix< T, Eigen::Dynamic, 1 > > SurgSim::DataStructures::ImageBase< T >::operator() | ( | size_t | x, |
size_t | y | ||
) | const |
Get the pixel value at (x, y), constant version.
x | The horizontal position in the image |
y | The vertical position in the image |
void SurgSim::DataStructures::ImageBase< T >::setAsVector | ( | const Eigen::Ref< const VectorType > & | data | ) |
Set the image data as a 1D Vector.
data | the data as a compatible Eigen vector type |
void SurgSim::DataStructures::ImageBase< T >::setChannel | ( | size_t | index, |
const Eigen::Ref< const ChannelType > & | data | ||
) |
Set the image data in the channel.
index | the channel number |
data | the channel data as a compatible Eigen type |
|
protected |
Set the Image size.
width | the image width |
height | the image height |
channels | the number of channels in the image |