#include <image.hpp>
Public Member Functions | |
Image () | |
Default constructor. | |
Image (HostType *inputHost) | |
Constructor. | |
Image (DeviceType *inputDevice) | |
Constructor. | |
Image (HostType *inputHost, DeviceType *inputDevice) | |
Constructor. | |
void | updateHostBuffer (unsigned char *data, int width, int height, uint widthStep=0) |
Updates the data on the host side - also works for reference structures (data is copied!). | |
HostType * | getHostEntity () |
Get the CudaTemplates reprensetation of the host memory. | |
DeviceType * | getDeviceEntity () |
Get the CudaTemplates reprensetation of the device memory. | |
PixelType * | getHostBuffer () |
Get the templated pixel reprensetation of the host memory. | |
PixelType * | getDeviceBuffer () |
Get the templated pixel reprensetation of the device memory. | |
Cuda::Size< 2 > | getSize () const |
Get size. | |
Cuda::Size< 2 > | getStride () const |
Get stride. | |
size_t | getPitch () const |
Get pitch. | |
bool | imageAvailable () const |
Get flag if an image is available. | |
bool | hostModified () const |
Get flag if host instance was modified. | |
bool | deviceModified () const |
Get flag if device instance was modified. | |
uint | getNChannels () const |
Get Number of channels. | |
bool | interleaved () const |
Get flag if channels are saved interleaved. | |
Public Attributes | |
uint | nChannels_ |
Number of channels saved in the image structure. | |
bool | interleaved_ |
Flag if color channels are interleaved or planar. | |
Protected Member Functions | |
void | updateHostEntity () |
Updates the host memory with the device memory. | |
void | updateDeviceEntity () |
Updates the device memory with the host memory. | |
Protected Attributes | |
HostType * | hostEntity_ |
CudaTemplate representation of host memory. | |
DeviceType * | deviceEntity_ |
CudaTemplate representation of device memory. | |
bool | imageAvailable_ |
Flag if host and device representations are available. | |
bool | hostModified_ |
Flag if host representation was modified. | |
bool | deviceModified_ |
Flag if device representation was modified. |
Image representation or similar data structures on device and host memory.
This is the base class for all kind of data structures that are needed on both, the host and the device.
The class is templeted over the type of host and device memory representation and the type of elements.
BE AWARE that there is no possibility to create Reference types of the CudaTemplates library due to the lack of partial specialization of member functions (here the constructor). As soon as a workaround is found the functionality will be implemented. If you need a reference type by now, please build it yourself.
Cuda::Image< HostType, DeviceType, PixelType >::Image | ( | ) | [inline] |
Default constructor.
Cuda::Image< HostType, DeviceType, PixelType >::Image | ( | HostType * | inputHost | ) | [inline] |
Constructor.
Takes a CudaTemplates representation of host memory and automatically creates the correspsonding device representation.
inputHost | CudaTemplate representation of host memory |
Cuda::Image< HostType, DeviceType, PixelType >::Image | ( | DeviceType * | inputDevice | ) | [inline] |
Constructor.
Takes a CudaTemplates representation of device memory and automatically creates the correspsonding host representation.
inputDevice | CudaTemplate representation of Device memory |
Cuda::Image< HostType, DeviceType, PixelType >::Image | ( | HostType * | inputHost, | |
DeviceType * | inputDevice | |||
) | [inline] |
Constructor.
Takes a CudaTemplate representation of host and device memory.
inputHost | CudaTemplate representation of host memory | |
inputDevice | CudaTemplate representation of device memory |
void Cuda::Image< HostType, DeviceType, PixelType >::updateHostBuffer | ( | unsigned char * | data, | |
int | width, | |||
int | height, | |||
uint | widthStep = 0 | |||
) | [inline] |
Updates the data on the host side - also works for reference structures (data is copied!).
[in] | data | pixel data. (e.g. of an IplImage) |
[in] | width | image width. |
[in] | height | image height. |
[in] | widthStep | row size (default = width). (e.g. IplImage::widthStep if used as OpenCV connector) |
HostType* Cuda::Image< HostType, DeviceType, PixelType >::getHostEntity | ( | ) | [inline] |
Get the CudaTemplates reprensetation of the host memory.
The memory is automatically synchronized if the device memory was modified.
DeviceType* Cuda::Image< HostType, DeviceType, PixelType >::getDeviceEntity | ( | ) | [inline] |
Get the CudaTemplates reprensetation of the device memory.
The memory is automatically synchronized if the host memory was modified.
PixelType* Cuda::Image< HostType, DeviceType, PixelType >::getHostBuffer | ( | ) | [inline] |
Get the templated pixel reprensetation of the host memory.
The memory is automatically synchronized if the device memory was modified.
PixelType* Cuda::Image< HostType, DeviceType, PixelType >::getDeviceBuffer | ( | ) | [inline] |
Get the templated pixel reprensetation of the device memory.
The memory is automatically synchronized if the device memory was modified.
Cuda::Size<2> Cuda::Image< HostType, DeviceType, PixelType >::getSize | ( | ) | const [inline] |
Get size.
Cuda::Size<2> Cuda::Image< HostType, DeviceType, PixelType >::getStride | ( | ) | const [inline] |
Get stride.
size_t Cuda::Image< HostType, DeviceType, PixelType >::getPitch | ( | ) | const [inline] |
Get pitch.
bool Cuda::Image< HostType, DeviceType, PixelType >::imageAvailable | ( | ) | const [inline] |
Get flag if an image is available.
bool Cuda::Image< HostType, DeviceType, PixelType >::hostModified | ( | ) | const [inline] |
Get flag if host instance was modified.
bool Cuda::Image< HostType, DeviceType, PixelType >::deviceModified | ( | ) | const [inline] |
Get flag if device instance was modified.
uint Cuda::Image< HostType, DeviceType, PixelType >::getNChannels | ( | ) | const [inline] |
Get Number of channels.
bool Cuda::Image< HostType, DeviceType, PixelType >::interleaved | ( | ) | const [inline] |
Get flag if channels are saved interleaved.
uint Cuda::Image< HostType, DeviceType, PixelType >::nChannels_ |
Number of channels saved in the image structure.
bool Cuda::Image< HostType, DeviceType, PixelType >::interleaved_ |
Flag if color channels are interleaved or planar.
HostType* Cuda::Image< HostType, DeviceType, PixelType >::hostEntity_ [protected] |
CudaTemplate representation of host memory.
DeviceType* Cuda::Image< HostType, DeviceType, PixelType >::deviceEntity_ [protected] |
CudaTemplate representation of device memory.
bool Cuda::Image< HostType, DeviceType, PixelType >::imageAvailable_ [protected] |
Flag if host and device representations are available.
bool Cuda::Image< HostType, DeviceType, PixelType >::hostModified_ [protected] |
Flag if host representation was modified.
bool Cuda::Image< HostType, DeviceType, PixelType >::deviceModified_ [protected] |
Flag if device representation was modified.