Public Types | Public Member Functions | List of all members
ecvl::View< DT > Class Template Reference

#include <image.h>

Inheritance diagram for ecvl::View< DT >:
ecvl::Image

Public Types

using basetype = typename TypeInfo< DT >::basetype
 

Public Member Functions

 View ()
 
 View (Image &img)
 
 View (Image &img, const std::vector< int > &start, const std::vector< int > &size)
 
basetypeoperator() (const std::vector< int > &coords)
 
void Create (std::vector< int > dims, std::string channels, ColorType colortype, uint8_t *ptr, const std::vector< float > &spacings=std::vector< float >(), Device dev=Device::CPU)
 
Iterator< basetypeBegin ()
 
Iterator< basetypeEnd ()
 
- Public Member Functions inherited from ecvl::Image
template<typename T >
Iterator< T > Begin ()
 Generic non-const Begin Iterator. More...
 
template<typename T >
Iterator< T > End ()
 Generic non-const End Iterator. More...
 
template<typename T >
ConstIterator< T > Begin () const
 Generic const Begin Iterator. More...
 
template<typename T >
ConstIterator< T > End () const
 Generic const End Iterator. More...
 
template<typename T >
ContiguousIterator< T > ContiguousBegin ()
 Contiguous non-const Begin Iterator. More...
 
template<typename T >
ContiguousIterator< T > ContiguousEnd ()
 Contiguous non-const End Iterator. More...
 
template<typename T >
ConstContiguousIterator< T > ContiguousBegin () const
 Contiguous const Begin Iterator. More...
 
template<typename T >
ConstContiguousIterator< T > ContiguousEnd () const
 Contiguous const End Iterator. More...
 
 Image ()
 Default constructor. More...
 
 Image (const std::vector< int > &dims, DataType elemtype, std::string channels, ColorType colortype, const std::vector< float > &spacings=std::vector< float >(), Device dev=Device::CPU)
 Initializing constructor. More...
 
 Image (const Image &img)
 Copy constructor. More...
 
 Image (Image &&img)
 Move constructor. More...
 
Imageoperator= (const Image &rhs)
 
Imageoperator= (Image &&rhs)
 
void To (Device dev)
 
void Create (const std::vector< int > &dims, DataType elemtype, std::string channels, ColorType colortype, const std::vector< float > &spacings=std::vector< float >(), Device dev=Device::CPU)
 Allocates new contiguous data if needed. More...
 
 ~Image ()
 Destructor. More...
 
bool IsEmpty () const
 To check whether the Image contains data or not, regardless of the owning status. More...
 
bool IsOwner () const
 To check whether the Image is owner of the data. More...
 
int Channels () const
 Returns the number of channels. More...
 
int Width () const
 Returns the width of Image. More...
 
int Height () const
 Returns the height of Image. More...
 
uint8_t * Ptr (const std::vector< int > &coords)
 Returns a non-const pointer to data at given coordinates. More...
 
const uint8_t * Ptr (const std::vector< int > &coords) const
 Returns a const pointer to data at given coordinates. More...
 
void Neg ()
 In-place negation. More...
 
template<typename T >
void Add (const T &rhs, bool saturate=true)
 In-place addition. More...
 
template<typename T >
void Sub (const T &rhs, bool saturate=true)
 In-place subtraction. More...
 
template<typename T >
void Mul (const T &rhs, bool saturate=true)
 In-place multiplication. More...
 
template<typename T >
void Div (const T &rhs, bool saturate=true)
 In-place division. More...
 
template<typename T >
void SetTo (T value)
 Set Image value to rhs. More...
 
void ConvertTo (DataType dtype, bool saturate=true)
 Convert Image to another DataType. More...
 
Image operator- () const
 
Imageoperator+= (const Image &rhs)
 
Imageoperator-= (const Image &rhs)
 
Imageoperator *= (const Image &rhs)
 
Imageoperator/= (const Image &rhs)
 

Additional Inherited Members

- Public Attributes inherited from ecvl::Image
DataType elemtype_
 Type of Image pixels, must be one of the values available in DataType. More...
 
uint8_t elemsize_
 Size (in bytes) of Image pixels. More...
 
std::vector< int > dims_
 
std::vector< int > strides_
 Vector of Image strides. More...
 
std::string channels_
 String which describes how Image planes are organized. More...
 
ColorType colortype_
 Image ColorType. More...
 
std::vector< float > spacings_
 Space between pixels/voxels. More...
 
uint8_t * data_
 Pointer to Image data. More...
 
size_t datasize_
 Size of Image data in bytes. More...
 
bool contiguous_
 Whether the image is stored contiguously or not in memory. More...
 
MetaDatameta_
 Pointer to Image MetaData. More...
 
HardwareAbstractionLayerhal_
 Pointer to the HardwareAbstractionLayer employed by the Image. More...
 
Device dev_
 Identifier for the device on which the image data is. More...
 
- Protected Member Functions inherited from ecvl::Image
void SetDefaultStrides ()
 Sets default strides for contiguous memory layouts. More...
 
size_t GetDefaultDatasize ()
 Gets the default datasize for contiguous images. More...
 
void SetDefaultDatasize ()
 Sets the default datasize for contiguous images. More...
 

Detailed Description

template<DataType DT>
class ecvl::View< DT >

Examples
example_ecvl_eddl.cpp, and example_image_view.cpp.

Definition at line 64 of file image.h.

Member Typedef Documentation

◆ basetype

template<DataType DT>
using ecvl::View< DT >::basetype = typename TypeInfo<DT>::basetype

Definition at line 637 of file image.h.

Constructor & Destructor Documentation

◆ View() [1/3]

template<DataType DT>
ecvl::View< DT >::View ( )
inline

Definition at line 639 of file image.h.

◆ View() [2/3]

template<DataType DT>
ecvl::View< DT >::View ( Image img)
inline

Definition at line 641 of file image.h.

◆ View() [3/3]

template<DataType DT>
ecvl::View< DT >::View ( Image img,
const std::vector< int > &  start,
const std::vector< int > &  size 
)
inline

Definition at line 660 of file image.h.

Member Function Documentation

◆ Begin()

template<DataType DT>
Iterator<basetype> ecvl::View< DT >::Begin ( )
inline

Definition at line 689 of file image.h.

◆ Create()

template<DataType DT>
void ecvl::View< DT >::Create ( std::vector< int >  dims,
std::string  channels,
ColorType  colortype,
uint8_t *  ptr,
const std::vector< float > &  spacings = std::vector<float>(),
Device  dev = Device::CPU 
)
inline

Definition at line 670 of file image.h.

◆ End()

template<DataType DT>
Iterator<basetype> ecvl::View< DT >::End ( )
inline

Definition at line 690 of file image.h.

◆ operator()()

template<DataType DT>
basetype& ecvl::View< DT >::operator() ( const std::vector< int > &  coords)
inline

Definition at line 665 of file image.h.


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