SurgSim::DataStructures::ImageMap< T > Class Template Reference

A class that behaves like an Image but maps an existing array of data. More...

`#include <SurgSim/DataStructures/ImageMap.h>`

Inheritance diagram for SurgSim::DataStructures::ImageMap< T >:

## Public Member Functions

| ImageMap (size_t width, size_t height, size_t channels, T *data)
| Constructor. More...
T *const | getData () override
| Get the pointer to the data. More...
const T *const | getData () const override
| Get the pointer to the data, constant version. More...
Public Member Functions inherited from SurgSim::DataStructures::ImageBase< T >
virtual | ~ImageBase ()
| Destructor. 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...
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...

## Private Attributes

T * | m_data

## Additional Inherited Members

Public Types inherited from SurgSim::DataStructures::ImageBase< T >
typedef Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | ChannelType
| 2D Channel Type; More...
typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > | VectorType
| 1D Vector Type; More...
Protected Member Functions inherited from SurgSim::DataStructures::ImageBase< T >
void | setSize (size_t width, size_t height, size_t channels)
| Set the Image size. More...

## Detailed Description

### template<class T>
class SurgSim::DataStructures::ImageMap< T >

A class that behaves like an Image but maps an existing array of data.

Template Parameters

  T | the data type of the image data

## Constructor & Destructor Documentation

## ImageMap()

template<class T >

SurgSim::DataStructures::ImageMap< T >::ImageMap | ( | size_t | width,
|  | size_t | height,
|  | size_t | channels,
|  | T * | data
| ) |  |

Constructor.

Parameters

  width | the image width
  height | the image height
  channels | the number of channels in the image
  data | pointer to the array to map

## Member Function Documentation

## getData() [1/2]

template<class T >

T *const SurgSim::DataStructures::ImageMap< T >::getData | ( |  | ) |

override virtual

Get the pointer to the data.

Returns
  the data

Implements SurgSim::DataStructures::ImageBase< T >.

## getData() [2/2]

template<class T >

const T *const SurgSim::DataStructures::ImageMap< T >::getData | ( |  | ) | const

override virtual

Get the pointer to the data, constant version.

Returns
  the data

Implements SurgSim::DataStructures::ImageBase< T >.

## Member Data Documentation

## m_data

template<class T >

T* SurgSim::DataStructures::ImageMap< T >::m_data

private

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

- SurgSim/DataStructures/ImageMap.h
- SurgSim/DataStructures/ImageMap-inl.h