Image Utilities (IU)
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Groups Pages
Public Types | Public Member Functions | Friends
iu::TensorCpu< PixelType > Class Template Reference

Host 4D tensor class. More...

#include <tensor_cpu.h>

Inheritance diagram for iu::TensorCpu< PixelType >:
iu::LinearHostMemory< PixelType, 1 > iu::LinearMemory< Ndim >

Public Types

typedef PixelType pixel_type
 
- Public Types inherited from iu::LinearHostMemory< PixelType, 1 >
typedef PixelType pixel_type
 

Public Member Functions

 TensorCpu ()
 
virtual ~TensorCpu ()
 
 TensorCpu (const unsigned int N, const unsigned int C, const unsigned int H, const unsigned int W)
 
 TensorCpu (PixelType *host_data, const unsigned int N, const unsigned int C, const unsigned int H, const unsigned int W, bool ext_data_pointer=false)
 
PixelType getPixel (unsigned int n, unsigned int c, unsigned int x, unsigned int y)
 
unsigned int samples () const
 
unsigned int channels () const
 
unsigned int height () const
 
unsigned int width () const
 
ndarray_ref< PixelType, 4 > ref () const
 
 TensorCpu (const ndarray_ref< PixelType, 4 > &x)
 
- Public Member Functions inherited from iu::LinearHostMemory< PixelType, 1 >
 LinearHostMemory ()
 
 LinearHostMemory (const Size< Ndim > &size)
 
 LinearHostMemory (const unsigned int &numel)
 
 LinearHostMemory (PixelType *host_data, const Size< Ndim > &size, bool ext_data_pointer=false)
 
 LinearHostMemory (PixelType *host_data, const unsigned int &numel, bool ext_data_pointer=false)
 
 LinearHostMemory (const ndarray_ref< PixelType, Ndim > &x)
 
 LinearHostMemory (boost::python::api::object &py_arr)
 
 LinearHostMemory (const mxArray_tag &mex_arr)
 
virtual ~LinearHostMemory ()
 
PixelType * data (unsigned int offset=0)
 
const PixelType * data (unsigned int offset=0) const
 
virtual size_t bytes () const
 
virtual unsigned int bitDepth () const
 
thrust::pointer< PixelType,
thrust::host_system_tag > 
begin (void)
 
thrust::pointer< PixelType,
thrust::host_system_tag > 
end (void)
 
virtual bool onDevice () const
 
PixelType & getPixel (const unsigned int &idx)
 
std::enable_if<(Ndim >
1), ResultType & >::type 
getPixel (const unsigned int &idx0, const unsigned int &idx1)
 
std::enable_if<(Ndim >
2), ResultType & >::type 
getPixel (const unsigned int &idx0, const unsigned int &idx1, const unsigned int &idx2)
 
std::enable_if<(Ndim >
3), ResultType & >::type 
getPixel (const unsigned int &idx0, const unsigned int &idx1, const unsigned int &idx2, const unsigned int &idx3)
 
std::enable_if<(Ndim >
4), ResultType & >::type 
getPixel (const unsigned int &idx0, const unsigned int &idx1, const unsigned int &idx2, const unsigned int &idx3, const unsigned int &idx4)
 
ndarray_ref< PixelType, Ndim > ref () const
 
- Public Member Functions inherited from iu::LinearMemory< Ndim >
 LinearMemory ()
 
 LinearMemory (const Size< Ndim > &size)
 
 LinearMemory (const unsigned int &numel)
 
bool sameType (const LinearMemory &from)
 
virtual ~LinearMemory ()
 
unsigned int numel () const
 
Size< Ndim > size () const
 
Size< Ndim > stride () const
 

Friends

std::ostream & operator<< (std::ostream &out, TensorCpu const &tensor)
 

Additional Inherited Members

- Protected Member Functions inherited from iu::LinearMemory< Ndim >
void computeStride ()
 
- Protected Attributes inherited from iu::LinearMemory< Ndim >
Size< Ndim > size_
 

Detailed Description

template<typename PixelType>
class iu::TensorCpu< PixelType >

Host 4D tensor class.

Member Typedef Documentation

template<typename PixelType >
typedef PixelType iu::TensorCpu< PixelType >::pixel_type

Define the current pixel type.

Constructor & Destructor Documentation

template<typename PixelType >
iu::TensorCpu< PixelType >::TensorCpu ( )
inline

Constructor.

template<typename PixelType >
virtual iu::TensorCpu< PixelType >::~TensorCpu ( )
inlinevirtual

Destructor.

template<typename PixelType >
iu::TensorCpu< PixelType >::TensorCpu ( const unsigned int  N,
const unsigned int  C,
const unsigned int  H,
const unsigned int  W 
)
inline

Special constructor.

Parameters
NNumber of samples
CNumber of channels
HHeight
WWidth
template<typename PixelType >
iu::TensorCpu< PixelType >::TensorCpu ( PixelType *  host_data,
const unsigned int  N,
const unsigned int  C,
const unsigned int  H,
const unsigned int  W,
bool  ext_data_pointer = false 
)
inline

Special constructor.

Parameters
host_dataHost data pointer
NNumber of samples
CNumber of channels
HHeight
WWidth
ext_data_pointerUse external data pointer as internal data pointer
Todo:
Check RGB inputs
template<typename PixelType >
iu::TensorCpu< PixelType >::TensorCpu ( const ndarray_ref< PixelType, 4 > &  x)

construct from ndarray_ref – include ndarray/ndarray_iu.h

Member Function Documentation

template<typename PixelType >
unsigned int iu::TensorCpu< PixelType >::channels ( ) const
inline

Returns the number of channels.

template<typename PixelType >
PixelType iu::TensorCpu< PixelType >::getPixel ( unsigned int  n,
unsigned int  c,
unsigned int  x,
unsigned int  y 
)
inline

Get Pixel value at position x,y.

template<typename PixelType >
unsigned int iu::TensorCpu< PixelType >::height ( ) const
inline

Returns the height.

template<typename PixelType >
ndarray_ref<PixelType,4> iu::TensorCpu< PixelType >::ref ( ) const

convert to ndarray_ref – include ndarray/ndarray_iu.h

template<typename PixelType >
unsigned int iu::TensorCpu< PixelType >::samples ( ) const
inline

Returns the number of samples.

template<typename PixelType >
unsigned int iu::TensorCpu< PixelType >::width ( ) const
inline

Returns the width.

Friends And Related Function Documentation

template<typename PixelType >
std::ostream& operator<< ( std::ostream &  out,
TensorCpu< PixelType > const &  tensor 
)
friend

Operator<< overloading. Output of TensorCpu class.


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