neuray API Programmer's Manual

mi::neuraylib::ICanvas_cuda Class Reference

[Rendering and Picking]

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.

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.
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...
virtual Uint32 get_resolution_x() const =0
Returns the number of pixels in x direction.
virtual Uint32 get_resolution_y() const =0
Returns the number of pixels in y direction.

Member Functions

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.

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

layer
The layer of the pixel in the canvas.
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

layer
The layer of the pixel in the canvas.
virtual Uint32 mi::​neuraylib::​ICanvas_cuda::get_resolution_x() const [pure virtual]

Returns the number of pixels in x direction.

virtual Uint32 mi::​neuraylib::​ICanvas_cuda::get_resolution_y() const [pure virtual]

Returns the number of pixels in y direction.