Enables rendering to a user-defined canvas. More...
#include <iindex_canvas.h>
Inherits mi::base::Interface_declare< 0x46c5a5f7, ... >.
Public Types | |
enum | Frame_buffer_layer_type { FB_LAYER_UNDEFINED = 0u , FB_LAYER_RGB8 = 1u , FB_LAYER_RGBA8 = 2u , FB_LAYER_RGBE = 3u , FB_LAYER_DEPTH16 = 4u , FB_LAYER_DEPTH32 = 5u , FB_LAYER_UINT8 = 6u , FB_LAYER_UINT32 = 7u , FB_LAYER_FLOAT32 = 8u } |
Frame buffer layer types that are or will be supported by a canvas layer. More... | |
Public Member Functions | |
virtual mi::Uint32 | get_nb_frame_buffer_layers () const =0 |
The number of layers hosted by the canvas' frame buffer. More... | |
virtual Frame_buffer_layer_type | get_layer_type (mi::Uint32 layer_id) const =0 |
Query the type of the frame buffer layer. More... | |
virtual void | prepare ()=0 |
Before rendering, a buffer typically needs to be flushed or front- and back buffers need to be swapped. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual void | finish ()=0 |
This method is called after all tiles are rendered, i.e, after all call to receive_tile() . More... | |
virtual bool | is_multi_thread_capable () const =0 |
The tiles can either be rendered in separate threads or in the main application thread. More... | |
virtual mi::math::Vector_struct< mi::Uint32, 2 > | get_resolution () const =0 |
Returns the resolution of the canvas in pixels. More... | |
virtual mi::neuraylib::ICanvas * | get_canvas () const =0 |
Returns the canvas that hosts the rendered pixels. More... | |
Enables rendering to a user-defined canvas.
Technically, the canvas wraps a frame buffer that contains one or more rendering targets or frame buffer layer. The NVIDIA IndeX library renders its rendering/visualization results into the associated frame buffer layers. Typical use cases include the rendering (blending) of all image tiles (a.k.a. horizontal spans) into an OpenGL framebuffer, into main memory or CUDA buffer for video-streaming, and into an image buffer or file.
The NVIDIA IndeX library ships the implementation of a main memory buffer and an OpenGL buffer based canvas classes as source code to ease the integration into a given application.
Frame buffer layer types that are or will be supported by a canvas layer.
|
pure virtual |
This method is called after all tiles are rendered, i.e, after all call to receive_tile()
.
|
pure virtual |
Returns the canvas that hosts the rendered pixels.
|
pure virtual |
Query the type of the frame buffer layer.
The layers are enumerated in sequential order and each layer is associated to an implicitly given layer id. The layer id allows querying the type of a layer contained in the frame buffer.
[in] | layer_id | The id of the layer. |
|
pure virtual |
The number of layers hosted by the canvas' frame buffer.
The frame buffer is logically defined by an array of the layers whereas each layer is accessible by a layer id.
|
pure virtual |
Returns the resolution of the canvas in pixels.
|
pure virtual |
The tiles can either be rendered in separate threads or in the main application thread.
In a multi-thread scenario the tile rendering machinery needs to be capable to be processed using multiple threads. For instance, OpenGL is single threaded and cannot run (easily) in multiple threads but a rendering into an image or a frame of a video stream can benefit from multi-threaded tile rendering.
|
pure virtual |
Before rendering, a buffer typically needs to be flushed or front- and back buffers need to be swapped.
This method is called right before any image tile is rendered into the canvas, i.e, before any call to receive_tile()
.
|
pure virtual |
This interface method receives multiple tiles.
The method is called for each tile and between prepare()
and finish()
.
[in] | buffer | The image buffer that contains the rendering inside the tile area. |
[in] | buffer_size | The size of the tile's image buffer. |
[in] | area | The 2D bounding box of the tile covered in the screen space. |
|
pure virtual |
This interface method receives multiple tiles.
The method is called for each tile and between prepare()
and finish()
.
This method blends the received image over existing image data.
[in] | buffer | The image buffer that contains the rendering inside the tile area. |
[in] | buffer_size | The size of the tile's image buffer. |
[in] | area | The 2D bounding box of the tile covered in the screen space. |
|
pure virtual |
This interface method receives multiple tiles for each layer.
The method is called for each tile and each layer between prepare()
and finish()
.
[in] | layer_id | The id of the layer. |
[in] | layer_type | The type of the layer. |
[in] | area | The 2D bounding box of the tile covered in the screen space. |
[in] | buffer | The image buffer that contains the rendering inside the tile area. |