DiCE API nvidia_logo_transpbg.gif Up
mi::neuraylib::ICanvas_cuda Class Referenceabstract

Abstract interface for a canvas with CUDA device memory storage. More...

#include <icanvas_cuda.h>

Inheritance diagram for mi::neuraylib::ICanvas_cuda:

Public Member Functions

virtual Sint32 get_cuda_device_id () const =0
 Returns the CUDA device id that owns the device memory storage for this canvas. More...
 
virtual Uint32 get_resolution_x () const =0
 Returns the number of pixels in x direction. More...
 
virtual Uint32 get_resolution_y () const =0
 Returns the number of pixels in y direction. More...
 
virtual const void * get_data (Uint32 layer=0) const =0
 Returns a pointer to the raw pixel data according to the pixel type of the canvas. More...
 
virtual void * get_data (Uint32 layer=0)=0
 Returns a pointer to the raw pixel data according to the pixel type of the canvas. More...
 
- Public Member Functions inherited from mi::neuraylib::ICanvas_base
virtual Uint32 get_resolution_x () const =0
 Returns the resolution of the canvas in x direction. More...
 
virtual Uint32 get_resolution_y () const =0
 Returns the resolution of the canvas in y direction. More...
 
virtual const char * get_type () const =0
 Returns the pixel type used by the canvas. More...
 
virtual Uint32 get_layers_size () const =0
 Returns the number of layers this canvas has. More...
 
virtual Float32 get_gamma () const =0
 Returns the gamma value. More...
 
virtual void set_gamma (Float32 gamma)=0
 Sets the gamma value. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x211963f4, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x649fc7bd, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x211963f4, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x649fc7bd, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

Abstract interface for a canvas with CUDA device memory storage.

This interface is similar to a mi::neuraylib::ICanvas interface with only a single tile, except that all memory resides in CUDA device memory for a single CUDA device identified by its CUDA device id.

Member Function Documentation

 get_cuda_device_id()

virtual Sint32 mi::neuraylib::ICanvas_cuda::get_cuda_device_id ( ) const
pure virtual

Returns the CUDA device id that owns the device memory storage for this canvas.

 get_data() [1/2]

virtual const void * mi::neuraylib::ICanvas_cuda::get_data ( Uint32  layer = 0) const
pure virtual

Returns a pointer to the raw pixel data according to the pixel type of the canvas.

This methods is used for fast, direct read access to the raw data. It is expected that the data is stored in row-major layout without any padding. In case of mi::Color, the components are expected to be stored in RGBA order.

The total size of the buffer in bytes is

x * y * bpp

where x is the result of get_resolution_x(), y is the result of get_resolution_y(), and bpp is the number of bytes per pixel. The number of bytes per pixel is the product of mi::neuraylib::IImage_api::get_components_per_pixel() and mi::neuraylib::IImage_api::get_bytes_per_component() when passing the result of get_type() as pixel type.

Parameters
layerThe layer of the pixel in the canvas.

 get_data() [2/2]

virtual void * mi::neuraylib::ICanvas_cuda::get_data ( Uint32  layer = 0)
pure virtual

Returns a pointer to the raw pixel data according to the pixel type of the canvas.

This methods is used for fast, direct write access to the raw data. It is expected that the data is stored in row-major layout without any padding. In case of mi::Color, the components are expected to be stored in RGBA order.

The total size of the buffer in bytes is

x * y * bpp

where x is the result of get_resolution_x(), y is the result of get_resolution_y(), and bpp is the number of bytes per pixel. The number of bytes per pixel is the product of mi::neuraylib::IImage_api::get_components_per_pixel() and mi::neuraylib::IImage_api::get_bytes_per_component() when passing the result of get_type() as pixel type.

Parameters
layerThe layer of the pixel in the canvas.

 get_resolution_x()

virtual Uint32 mi::neuraylib::ICanvas_cuda::get_resolution_x ( ) const
pure virtual

Returns the number of pixels in x direction.

Implements mi::neuraylib::ICanvas_base.

 get_resolution_y()

virtual Uint32 mi::neuraylib::ICanvas_cuda::get_resolution_y ( ) const
pure virtual

Returns the number of pixels in y direction.

Implements mi::neuraylib::ICanvas_base.