7#ifndef NVIDIA_INDEX_IINDEX_CANVAS_H
8#define NVIDIA_INDEX_IINDEX_CANVAS_H
31 public mi::base::Interface_declare<0x46c5a5f7,0x31de,0x468d,0x9b,0x6c,0xb0,0x35,0x77,0xed,0xfe,0x61>
84 const mi::math::Bbox_struct<mi::Uint32, 2>& area,
85 mi::Uint8* buffer) = 0;
102 mi::Uint32 buffer_size,
103 const mi::math::Bbox_struct<mi::Uint32, 2>& area) = 0;
122 mi::Uint32 buffer_size,
123 const mi::math::Bbox_struct<mi::Uint32, 2>& area) = 0;
161 public mi::base::Interface_declare<0x631ca66c,0x5ed7,0x4275,0xb7,0xb8,0x10,0x23,0x85,0xf8,0x36,0x55, nv::index::IIndex_canvas>
189 virtual void set_resolution(
const mi::math::Vector_struct<mi::Uint32, 2>& resolution) = 0;
198class Index_canvas :
public mi::base::Interface_implement<nv::index::IIndex_canvas>
229 Frame_buffer_layer_type layer_type,
230 const mi::math::Bbox_struct<mi::Uint32, 2>& area,
235 const mi::Uint32 x_range = area.max.x - area.min.x;
236 const mi::Uint32 y_range = area.max.y - area.min.y;
237 const mi::Uint32 buffer_size = (x_range * y_range);
241 this->receive_tile(buffer, buffer_size*3, area);
245 this->receive_tile_blend(buffer, buffer_size*4, area);
255 virtual mi::neuraylib::ICanvas*
get_canvas()
const {
return NULL; }
Enables rendering to a user-defined canvas.
Definition: iindex_canvas.h:32
virtual mi::Uint32 get_nb_frame_buffer_layers() const =0
The number of layers hosted by the canvas' frame buffer.
virtual mi::neuraylib::ICanvas * get_canvas() const =0
Returns the canvas that hosts the rendered pixels.
virtual void render_tile(mi::Uint32 layer_id, Frame_buffer_layer_type layer_type, const mi::math::Bbox_struct< mi::Uint32, 2 > &area, mi::Uint8 *buffer)=0
This interface method receives multiple tiles for each layer.
virtual Frame_buffer_layer_type get_layer_type(mi::Uint32 layer_id) const =0
Query the type of the frame buffer layer.
virtual mi::math::Vector_struct< mi::Uint32, 2 > get_resolution() const =0
Returns the resolution of the canvas in pixels.
virtual void receive_tile(mi::Uint8 *buffer, mi::Uint32 buffer_size, const mi::math::Bbox_struct< mi::Uint32, 2 > &area)=0
This interface method receives multiple tiles.
Frame_buffer_layer_type
Frame buffer layer types that are or will be supported by a canvas layer.
Definition: iindex_canvas.h:36
@ FB_LAYER_FLOAT32
Not supported yet // 32-bit float enabling scalar value encoding.
Definition: iindex_canvas.h:45
@ FB_LAYER_DEPTH32
32-bit depth in float.
Definition: iindex_canvas.h:42
@ FB_LAYER_RGBA8
8-bit per rgba component.
Definition: iindex_canvas.h:39
@ FB_LAYER_UNDEFINED
Undefined frame buffer.
Definition: iindex_canvas.h:37
@ FB_LAYER_DEPTH16
Not supported yet // 16-bit depth.
Definition: iindex_canvas.h:41
@ FB_LAYER_UINT8
Not supported yet // 8-bit unsigned int enabling index encoding.
Definition: iindex_canvas.h:43
@ FB_LAYER_RGB8
Not supported yet // 8-bit per rgb component.
Definition: iindex_canvas.h:38
@ FB_LAYER_UINT32
Not supported yet // 32-bit unsigned int enabling index encoding.
Definition: iindex_canvas.h:44
@ FB_LAYER_RGBE
Not supported yet // RGBe hdr support.
Definition: iindex_canvas.h:40
virtual void finish()=0
This method is called after all tiles are rendered, i.e, after all call to receive_tile().
virtual bool is_multi_thread_capable() const =0
The tiles can either be rendered in separate threads or in the main application thread.
virtual void receive_tile_blend(mi::Uint8 *buffer, mi::Uint32 buffer_size, const mi::math::Bbox_struct< mi::Uint32, 2 > &area)=0
This interface method receives multiple tiles.
virtual void prepare()=0
Before rendering, a buffer typically needs to be flushed or front- and back buffers need to be swappe...
CUDA-memory based canvas.
Definition: iindex_canvas.h:162
virtual mi::Sint32 get_device_id() const =0
The CUDA memory canvas is hosted on a CUDA device.
virtual mi::neuraylib::ICanvas_cuda * get_cuda_canvas() const =0
Returns the CUDA memory based canvas for external use, e.g., by a video encoder as input.
Mixin class for implementing the IIndex_canvas interface.
Definition: iindex_canvas.h:199
virtual void render_tile(mi::Uint32, Frame_buffer_layer_type layer_type, const mi::math::Bbox_struct< mi::Uint32, 2 > &area, mi::Uint8 *buffer)
Implemented render tile method of the canvas interface.
Definition: iindex_canvas.h:227
virtual mi::neuraylib::ICanvas * get_canvas() const
Returns the canvas that hosts the rendered pixels.
Definition: iindex_canvas.h:255
virtual Frame_buffer_layer_type get_layer_type(mi::Uint32) const
Return the frame buffer layer type.
Definition: iindex_canvas.h:214
virtual mi::Uint32 get_nb_frame_buffer_layers() const
Return number of layers.
Definition: iindex_canvas.h:205
Application managed interface class of a CUDA canvas implemented inside the NVIDIA IndeX library.
Definition: iindex_canvas.h:183
virtual void set_resolution(const mi::math::Vector_struct< mi::Uint32, 2 > &resolution)=0
Sets the resolution of the internal/built-in canvas.
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349