MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mve::Image< T > Class Template Reference

Multi-channel image class of arbitrary but homogenous data type. More...

#include <image.h>

Collaboration diagram for mve::Image< T >:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< Image< T > const > ConstPtr
 
typedef std::vector< T > ImageData
 
typedef std::shared_ptr< Image< T > > Ptr
 
typedef T ValueType
 
- Public Types inherited from mve::TypedImageBase< T >
typedef std::shared_ptr< TypedImageBase< T > const > ConstPtr
 
typedef std::vector< T > ImageData
 
typedef std::shared_ptr< TypedImageBase< T > > Ptr
 
typedef T ValueType
 
- Public Types inherited from mve::ImageBase
typedef std::shared_ptr< ImageBase const > ConstPtr
 
typedef std::shared_ptr< ImageBasePtr
 

Public Member Functions

 Image (Image< T > const &other)
 Copy constructor.
 
 Image (int64_t width, int64_t height, int64_t channels)
 Allocating constructor.
 
 Image (void)=default
 Default constructor creates an empty image.
 
void add_channels (int64_t amount, T const &value=T(0))
 Adds 'amount' channels to the back with default value 'value'.
 
T & at (int64_t index)
 Linear indexing of image data.
 
T const & at (int64_t index) const
 Linear indexing of image data.
 
T & at (int64_t index, int64_t channel)
 Linear indexing of channel data.
 
T const & at (int64_t index, int64_t channel) const
 Linear indexing of channel data.
 
T & at (int64_t x, int64_t y, int64_t channel)
 2D indexing of image data, more expensive.
 
T const & at (int64_t x, int64_t y, int64_t channel) const
 2D indexing of image data, more expensive.
 
void copy_channel (int64_t src, int64_t dest)
 Copies channel from src to dest.
 
void delete_channel (int64_t channel)
 Deletes a channel from the image.
 
Ptr duplicate (void) const
 Duplicates the image.
 
void fill_color (T const *color)
 Fills every pixel of the image with the given color.
 
linear_at (float x, float y, int64_t channel) const
 Linear interpolation (more expensive) for a single color channel.
 
void linear_at (float x, float y, T *px) const
 Linear interpolation (more expensive) for all color channels.
 
T & operator() (int64_t index)
 
T const & operator() (int64_t index) const
 
T & operator() (int64_t index, int64_t channel)
 
T const & operator() (int64_t index, int64_t channel) const
 
T & operator() (int64_t x, int64_t y, int64_t channel)
 
T const & operator() (int64_t x, int64_t y, int64_t channel) const
 
T & operator[] (int64_t index)
 
T const & operator[] (int64_t index) const
 
void swap_channels (int64_t c1, int64_t c2)
 Swaps channels 'c1' and 'c2'.
 
- Public Member Functions inherited from mve::TypedImageBase< T >
 TypedImageBase (TypedImageBase< T > const &other)
 Copy constructor duplicates another image.
 
 TypedImageBase (void)=default
 Default constructor creates an empty image.
 
virtual ~TypedImageBase (void)=default
 
void allocate (int64_t width, int64_t height, int64_t chans)
 Allocates new image space, clearing previous content.
 
T * begin (void)
 Returns data pointer to beginning.
 
T const * begin (void) const
 Returns const data pointer to beginning.
 
virtual void clear (void)
 Clears the image data from memory.
 
virtual ImageBase::Ptr duplicate_base (void) const
 Duplicates the image.
 
T * end (void)
 Returns data pointer to end.
 
T const * end (void) const
 Returns const data pointer to end.
 
void fill (T const &value)
 Fills the data with a constant value.
 
char * get_byte_pointer (void)
 Returns the char pointer to the data.
 
char const * get_byte_pointer (void) const
 Returns the char pointer to the data.
 
std::size_t get_byte_size (void) const
 Returns the size of the image in bytes (w * h * c * BPV).
 
ImageDataget_data (void)
 Returns the data vector for the image.
 
ImageData const & get_data (void) const
 Returns the data vector for the image.
 
T * get_data_pointer (void)
 Returns the data pointer.
 
T const * get_data_pointer (void) const
 Returns the data pointer.
 
int64_t get_pixel_amount (void) const
 Returns the amount of pixels in the image (w * h).
 
virtual ImageType get_type (void) const
 Value type information by template specialization.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
ImageType get_type (void) const
 Value type information.
 
char const * get_type_string (void) const
 Returns a string representation of the image data type.
 
int64_t get_value_amount (void) const
 Returns the amount of values in the image (w * h * c).
 
void resize (int64_t width, int64_t height, int64_t chans)
 Resizes the underlying image data vector.
 
void swap (TypedImageBase< T > &other)
 Swaps the contents of the images.
 
- Public Member Functions inherited from mve::ImageBase
 ImageBase (void)=default
 Initializes members with 0.
 
virtual ~ImageBase (void)=default
 
int64_t channels (void) const
 Returns the amount of channels in the image.
 
int64_t height (void) const
 Returns the height of the image.
 
bool reinterpret (int64_t new_w, int64_t new_h, int64_t new_c)
 Re-interprets the dimensions of the image.
 
bool valid (void) const
 Returns false if one of width, height or channels is 0.
 
int64_t width (void) const
 Returns the width of the image.
 

Static Public Member Functions

static Ptr create (Image< T > const &other)
 Smart pointer image copy constructor.
 
static Ptr create (int64_t width, int64_t height, int64_t channels)
 Allocating smart pointer image constructor.
 
static Ptr create (void)
 Smart pointer image constructor.
 
- Static Public Member Functions inherited from mve::ImageBase
static ImageType get_type_for_string (std::string const &type_string)
 Returns the type for a valid type string, otherwise UNKNOWN.
 

Additional Inherited Members

- Protected Attributes inherited from mve::TypedImageBase< T >
ImageData data
 
- Protected Attributes inherited from mve::ImageBase
int64_t c = 0
 
int64_t h = 0
 
int64_t w = 0
 

Detailed Description

template<typename T>
class mve::Image< T >

Multi-channel image class of arbitrary but homogenous data type.

Image data is interleaved, i.e. "RGBRGB...", not planar "RR..GG..BB..".

Definition at line 39 of file image.h.

Member Typedef Documentation

◆ ConstPtr

template<typename T >
typedef std::shared_ptr<Image<T> const> mve::Image< T >::ConstPtr

Definition at line 43 of file image.h.

◆ ImageData

template<typename T >
typedef std::vector<T> mve::Image< T >::ImageData

Definition at line 44 of file image.h.

◆ Ptr

template<typename T >
typedef std::shared_ptr<Image<T> > mve::Image< T >::Ptr

Definition at line 42 of file image.h.

◆ ValueType

template<typename T >
typedef T mve::Image< T >::ValueType

Definition at line 45 of file image.h.

Constructor & Destructor Documentation

◆ Image() [1/3]

template<typename T >
mve::Image< T >::Image ( void  )
default

Default constructor creates an empty image.

◆ Image() [2/3]

template<typename T >
mve::Image< T >::Image ( int64_t  width,
int64_t  height,
int64_t  channels 
)
inline

Allocating constructor.

Definition at line 177 of file image.h.

◆ Image() [3/3]

template<typename T >
mve::Image< T >::Image ( Image< T > const &  other)
inline

Copy constructor.

Definition at line 184 of file image.h.

Member Function Documentation

◆ add_channels()

template<typename T >
void mve::Image< T >::add_channels ( int64_t  amount,
T const &  value = T(0) 
)

Adds 'amount' channels to the back with default value 'value'.

Definition at line 227 of file image.h.

◆ at() [1/6]

template<typename T >
T & mve::Image< T >::at ( int64_t  index)
inline

Linear indexing of image data.

Definition at line 330 of file image.h.

◆ at() [2/6]

template<typename T >
T const & mve::Image< T >::at ( int64_t  index) const
inline

Linear indexing of image data.

Definition at line 307 of file image.h.

◆ at() [3/6]

template<typename T >
T & mve::Image< T >::at ( int64_t  index,
int64_t  channel 
)
inline

Linear indexing of channel data.

Definition at line 337 of file image.h.

◆ at() [4/6]

template<typename T >
T const & mve::Image< T >::at ( int64_t  index,
int64_t  channel 
) const
inline

Linear indexing of channel data.

Definition at line 314 of file image.h.

◆ at() [5/6]

template<typename T >
T & mve::Image< T >::at ( int64_t  x,
int64_t  y,
int64_t  channel 
)
inline

2D indexing of image data, more expensive.

Definition at line 345 of file image.h.

◆ at() [6/6]

template<typename T >
T const & mve::Image< T >::at ( int64_t  x,
int64_t  y,
int64_t  channel 
) const
inline

2D indexing of image data, more expensive.

Definition at line 322 of file image.h.

◆ copy_channel()

template<typename T >
void mve::Image< T >::copy_channel ( int64_t  src,
int64_t  dest 
)

Copies channel from src to dest.

"-1" for dest creates new channel.

Definition at line 265 of file image.h.

◆ create() [1/3]

template<typename T >
Image< T >::Ptr mve::Image< T >::create ( Image< T > const &  other)
inlinestatic

Smart pointer image copy constructor.

Definition at line 205 of file image.h.

◆ create() [2/3]

template<typename T >
Image< T >::Ptr mve::Image< T >::create ( int64_t  width,
int64_t  height,
int64_t  channels 
)
inlinestatic

Allocating smart pointer image constructor.

Definition at line 198 of file image.h.

◆ create() [3/3]

template<typename T >
Image< T >::Ptr mve::Image< T >::create ( void  )
inlinestatic

Smart pointer image constructor.

Definition at line 191 of file image.h.

◆ delete_channel()

template<typename T >
void mve::Image< T >::delete_channel ( int64_t  channel)

Deletes a channel from the image.

Definition at line 288 of file image.h.

◆ duplicate()

template<typename T >
Image< T >::Ptr mve::Image< T >::duplicate ( void  ) const
inline

Duplicates the image.

Definition at line 212 of file image.h.

◆ fill_color()

template<typename T >
void mve::Image< T >::fill_color ( T const *  color)
inline

Fills every pixel of the image with the given color.

Definition at line 219 of file image.h.

◆ linear_at() [1/2]

template<typename T >
T mve::Image< T >::linear_at ( float  x,
float  y,
int64_t  channel 
) const

Linear interpolation (more expensive) for a single color channel.

Definition at line 409 of file image.h.

◆ linear_at() [2/2]

template<typename T >
void mve::Image< T >::linear_at ( float  x,
float  y,
T *  px 
) const

Linear interpolation (more expensive) for all color channels.

The method generates one value for each color channel and places the result in the buffer provided by 'px'.

Definition at line 438 of file image.h.

◆ operator()() [1/6]

template<typename T >
T & mve::Image< T >::operator() ( int64_t  index)
inline

Definition at line 388 of file image.h.

◆ operator()() [2/6]

template<typename T >
T const & mve::Image< T >::operator() ( int64_t  index) const
inline

Definition at line 367 of file image.h.

◆ operator()() [3/6]

template<typename T >
T & mve::Image< T >::operator() ( int64_t  index,
int64_t  channel 
)
inline

Definition at line 395 of file image.h.

◆ operator()() [4/6]

template<typename T >
T const & mve::Image< T >::operator() ( int64_t  index,
int64_t  channel 
) const
inline

Definition at line 374 of file image.h.

◆ operator()() [5/6]

template<typename T >
T & mve::Image< T >::operator() ( int64_t  x,
int64_t  y,
int64_t  channel 
)
inline

Definition at line 402 of file image.h.

◆ operator()() [6/6]

template<typename T >
T const & mve::Image< T >::operator() ( int64_t  x,
int64_t  y,
int64_t  channel 
) const
inline

Definition at line 381 of file image.h.

◆ operator[]() [1/2]

template<typename T >
T & mve::Image< T >::operator[] ( int64_t  index)
inline

Definition at line 353 of file image.h.

◆ operator[]() [2/2]

template<typename T >
T const & mve::Image< T >::operator[] ( int64_t  index) const
inline

Definition at line 360 of file image.h.

◆ swap_channels()

template<typename T >
void mve::Image< T >::swap_channels ( int64_t  c1,
int64_t  c2 
)

Swaps channels 'c1' and 'c2'.

Definition at line 250 of file image.h.


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