Image Utilities (IU)
|
Linear host memory class. More...
#include <linearhostmemory.h>
Public Types | |
typedef PixelType | pixel_type |
Public Member Functions | |
LinearHostMemory () | |
virtual | ~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) | |
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) |
template<typename ResultType = PixelType> | |
std::enable_if<(Ndim > 1), ResultType & >::type | getPixel (const unsigned int &idx0, const unsigned int &idx1) |
template<typename ResultType = PixelType> | |
std::enable_if<(Ndim > 2), ResultType & >::type | getPixel (const unsigned int &idx0, const unsigned int &idx1, const unsigned int &idx2) |
template<typename ResultType = PixelType> | |
std::enable_if<(Ndim > 3), ResultType & >::type | getPixel (const unsigned int &idx0, const unsigned int &idx1, const unsigned int &idx2, const unsigned int &idx3) |
template<typename ResultType = PixelType> | |
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 |
LinearHostMemory (const ndarray_ref< PixelType, Ndim > &x) | |
LinearHostMemory (boost::python::api::object &py_arr) | |
LinearHostMemory (const mxArray_tag &mex_arr) | |
template<> | |
LinearHostMemory (const ndarray_ref< float, 1 > &x) | |
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 |
Additional Inherited Members | |
Protected Member Functions inherited from iu::LinearMemory< Ndim > | |
void | computeStride () |
Protected Attributes inherited from iu::LinearMemory< Ndim > | |
Size< Ndim > | size_ |
Linear host memory class.
typedef PixelType iu::LinearHostMemory< PixelType, Ndim >::pixel_type |
Define the current pixel type.
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
inline |
Special constructor.
size | size of linear memory |
|
inline |
Special constructor.
numel | number of elements of linear memory. Size[0] equals the number of elements, the other dimensions are set to 1. |
|
inline |
Special constructor.
host_data | Host data pointer |
size | size of the linear memory |
ext_data_pointer | Use external data pointer as internal data pointer |
|
inline |
Special constructor.
host_data | Host data pointer |
numel | Number of elements of the linear memory |
ext_data_pointer | Use external data pointer as internal data pointer |
iu::LinearHostMemory< PixelType, Ndim >::LinearHostMemory | ( | const ndarray_ref< PixelType, Ndim > & | x | ) |
construct from ndarray_ref – include ndarray/ndarray_iu.h
iu::LinearHostMemory< PixelType, Ndim >::LinearHostMemory | ( | boost::python::api::object & | py_arr | ) |
LinearHostMemory constructor from numpy array. It wraps the numpy data pointer i.e. does not perform a deep copy. This means that changes to the ImageCpu are transparent to python. Attention: It performs just a basic check if the datatyps are compatible: If you have a numpy array with uint8 and you try to construct a LinearHostMemory_32f_C1 from it, it will throw an exception. Constructing a LinearHostMemory_32u_C1 from a numpy float32 array will not give an error (both are 32-bit datatypes)!
include iuypthon.h!
py_arr | a boost::python::object representing a numpy array |
iu::LinearHostMemory< PixelType, Ndim >::LinearHostMemory | ( | const mxArray_tag & | mex_arr | ) |
LinearHostMemory constructor from mex arrays (matlab). The memory layout is changed from column-first to row-first order.
iu::LinearHostMemory< float, 1 >::LinearHostMemory | ( | const ndarray_ref< float, 1 > & | x | ) |
Template specialization. Construct from ndarray_ref.
|
inline |
Returns a thrust pointer that can be used in custom operators
|
inlinevirtual |
Returns the bit depth of the data pointer.
Reimplemented from iu::LinearMemory< Ndim >.
|
inlinevirtual |
Returns the total amount of bytes saved in the data buffer.
Reimplemented from iu::LinearMemory< Ndim >.
|
inline |
Returns a pointer to the device buffer. The pointer can be offset to position offset.
offset | Offset of the pointer array. |
|
inline |
Returns a const pointer to the device buffer. The pointer can be offset to position offset.
offset | Offset of the pointer array. |
|
inline |
Returns a thrust pointer that can be used in custom operators
|
inline |
Get pixel value at a certain position.
idx | Index |
|
inline |
Get pixel value at a certain position.
idx0 | Position at dimension 0 |
idx1 | Position at dimension 1 |
|
inline |
Get pixel value at a certain position.
idx0 | Position at dimension 0 |
idx1 | Position at dimension 1 |
idx2 | Position at dimension 2 |
|
inline |
Get pixel value at a certain position.
idx0 | Position at dimension 0 |
idx1 | Position at dimension 1 |
idx2 | Position at dimension 2 |
idx3 | Position at dimension 3 |
|
inline |
Get pixel value at a certain position.
idx0 | Position at dimension 0 |
idx1 | Position at dimension 1 |
idx2 | Position at dimension 2 |
idx3 | Position at dimension 3 |
idx4 | Position at dimension 4 |
|
inlinevirtual |
Returns flag if the image data resides on the device/GPU (TRUE) or host/GPU (FALSE)
Reimplemented from iu::LinearMemory< Ndim >.
ndarray_ref<PixelType, Ndim> iu::LinearHostMemory< PixelType, Ndim >::ref | ( | ) | const |
convert to ndarray_ref – include ndarray/ndarray_iu.h