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

Base class for images of arbitrary type. More...

#include <image_base.h>

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

Public Types

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

 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.
 

Protected Attributes

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

Additional Inherited Members

- 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.
 

Detailed Description

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

Base class for images of arbitrary type.

Image values are stored in a standard STL Vector. Type information is provided. This class makes no assumptions about the image structure, i.e. it provides no pixel access methods.

Definition at line 111 of file image_base.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 116 of file image_base.h.

◆ ImageData

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

Definition at line 117 of file image_base.h.

◆ Ptr

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

Definition at line 115 of file image_base.h.

◆ ValueType

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

Definition at line 114 of file image_base.h.

Constructor & Destructor Documentation

◆ TypedImageBase() [1/2]

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

Default constructor creates an empty image.

◆ TypedImageBase() [2/2]

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

Copy constructor duplicates another image.

Definition at line 297 of file image_base.h.

◆ ~TypedImageBase()

template<typename T >
virtual mve::TypedImageBase< T >::~TypedImageBase ( void  )
virtualdefault

Member Function Documentation

◆ allocate()

template<typename T >
void mve::TypedImageBase< T >::allocate ( int64_t  width,
int64_t  height,
int64_t  chans 
)
inline

Allocates new image space, clearing previous content.

Definition at line 395 of file image_base.h.

◆ begin() [1/2]

template<typename T >
T * mve::TypedImageBase< T >::begin ( void  )
inline

Returns data pointer to beginning.

Definition at line 472 of file image_base.h.

◆ begin() [2/2]

template<typename T >
T const * mve::TypedImageBase< T >::begin ( void  ) const
inline

Returns const data pointer to beginning.

Definition at line 479 of file image_base.h.

◆ clear()

template<typename T >
void mve::TypedImageBase< T >::clear ( void  )
inlinevirtual

Clears the image data from memory.

Definition at line 413 of file image_base.h.

◆ duplicate_base()

template<typename T >
ImageBase::Ptr mve::TypedImageBase< T >::duplicate_base ( void  ) const
inlinevirtual

Duplicates the image.

Data holders need to reimplement this.

Reimplemented from mve::ImageBase.

Definition at line 304 of file image_base.h.

◆ end() [1/2]

template<typename T >
T * mve::TypedImageBase< T >::end ( void  )
inline

Returns data pointer to end.

Definition at line 486 of file image_base.h.

◆ end() [2/2]

template<typename T >
T const * mve::TypedImageBase< T >::end ( void  ) const
inline

Returns const data pointer to end.

Definition at line 493 of file image_base.h.

◆ fill()

template<typename T >
void mve::TypedImageBase< T >::fill ( T const &  value)
inline

Fills the data with a constant value.

Definition at line 423 of file image_base.h.

◆ get_byte_pointer() [1/2]

template<typename T >
char * mve::TypedImageBase< T >::get_byte_pointer ( void  )
inlinevirtual

Returns the char pointer to the data.

Reimplemented from mve::ImageBase.

Definition at line 528 of file image_base.h.

◆ get_byte_pointer() [2/2]

template<typename T >
char const * mve::TypedImageBase< T >::get_byte_pointer ( void  ) const
inlinevirtual

Returns the char pointer to the data.

Reimplemented from mve::ImageBase.

Definition at line 521 of file image_base.h.

◆ get_byte_size()

template<typename T >
std::size_t mve::TypedImageBase< T >::get_byte_size ( void  ) const
inlinevirtual

Returns the size of the image in bytes (w * h * c * BPV).

Reimplemented from mve::ImageBase.

Definition at line 514 of file image_base.h.

◆ get_data() [1/2]

template<typename T >
TypedImageBase< T >::ImageData & mve::TypedImageBase< T >::get_data ( void  )
inline

Returns the data vector for the image.

Definition at line 440 of file image_base.h.

◆ get_data() [2/2]

template<typename T >
TypedImageBase< T >::ImageData const & mve::TypedImageBase< T >::get_data ( void  ) const
inline

Returns the data vector for the image.

Definition at line 447 of file image_base.h.

◆ get_data_pointer() [1/2]

template<typename T >
T * mve::TypedImageBase< T >::get_data_pointer ( void  )
inline

Returns the data pointer.

Definition at line 463 of file image_base.h.

◆ get_data_pointer() [2/2]

template<typename T >
T const * mve::TypedImageBase< T >::get_data_pointer ( void  ) const
inline

Returns the data pointer.

Definition at line 454 of file image_base.h.

◆ get_pixel_amount()

template<typename T >
int64_t mve::TypedImageBase< T >::get_pixel_amount ( void  ) const
inline

Returns the amount of pixels in the image (w * h).

Definition at line 500 of file image_base.h.

◆ get_type() [1/11]

template<typename T >
ImageType mve::TypedImageBase< T >::get_type ( void  ) const
inlinevirtual

Value type information by template specialization.

Reimplemented from mve::ImageBase.

Definition at line 311 of file image_base.h.

◆ get_type() [2/11]

ImageType mve::TypedImageBase< int8_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 318 of file image_base.h.

◆ get_type() [3/11]

ImageType mve::TypedImageBase< int16_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 325 of file image_base.h.

◆ get_type() [4/11]

ImageType mve::TypedImageBase< int32_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 332 of file image_base.h.

◆ get_type() [5/11]

ImageType mve::TypedImageBase< int64_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 339 of file image_base.h.

◆ get_type() [6/11]

ImageType mve::TypedImageBase< uint8_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 346 of file image_base.h.

◆ get_type() [7/11]

ImageType mve::TypedImageBase< uint16_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 353 of file image_base.h.

◆ get_type() [8/11]

ImageType mve::TypedImageBase< uint32_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 360 of file image_base.h.

◆ get_type() [9/11]

ImageType mve::TypedImageBase< uint64_t >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 367 of file image_base.h.

◆ get_type() [10/11]

ImageType mve::TypedImageBase< float >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 374 of file image_base.h.

◆ get_type() [11/11]

ImageType mve::TypedImageBase< double >::get_type ( void  ) const
inlinevirtual

Value type information.

Returns UNKNOWN if not overwritten.

Reimplemented from mve::ImageBase.

Definition at line 381 of file image_base.h.

◆ get_type_string()

template<typename T >
char const * mve::TypedImageBase< T >::get_type_string ( void  ) const
inlinevirtual

Returns a string representation of the image data type.

Reimplemented from mve::ImageBase.

Definition at line 388 of file image_base.h.

◆ get_value_amount()

template<typename T >
int64_t mve::TypedImageBase< T >::get_value_amount ( void  ) const
inline

Returns the amount of values in the image (w * h * c).

Definition at line 507 of file image_base.h.

◆ resize()

template<typename T >
void mve::TypedImageBase< T >::resize ( int64_t  width,
int64_t  height,
int64_t  chans 
)
inline

Resizes the underlying image data vector.

Note: This leaves the existing/remaining image data unchanged. Warning: If the image is shrunk, the data vector is resized but may still consume the original amount of memory. Use allocate() instead if the previous data is not important.

Definition at line 403 of file image_base.h.

◆ swap()

template<typename T >
void mve::TypedImageBase< T >::swap ( TypedImageBase< T > &  other)
inline

Swaps the contents of the images.

Definition at line 430 of file image_base.h.

Member Data Documentation

◆ data

template<typename T >
ImageData mve::TypedImageBase< T >::data
protected

Definition at line 189 of file image_base.h.


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