NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::IIndex_canvas Class Referenceabstract

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...
 

Detailed Description

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.

Member Enumeration Documentation

 Frame_buffer_layer_type

Frame buffer layer types that are or will be supported by a canvas layer.

Enumerator
FB_LAYER_UNDEFINED 

Undefined frame buffer.

FB_LAYER_RGB8 

Not supported yet // 8-bit per rgb component.

FB_LAYER_RGBA8 

8-bit per rgba component.

FB_LAYER_RGBE 

Not supported yet // RGBe hdr support.

FB_LAYER_DEPTH16 

Not supported yet // 16-bit depth.

FB_LAYER_DEPTH32 

32-bit depth in float.

FB_LAYER_UINT8 

Not supported yet // 8-bit unsigned int enabling index encoding.

FB_LAYER_UINT32 

Not supported yet // 32-bit unsigned int enabling index encoding.

FB_LAYER_FLOAT32 

Not supported yet // 32-bit float enabling scalar value encoding.

Member Function Documentation

 finish()

virtual void nv::index::IIndex_canvas::finish ( )
pure virtual

This method is called after all tiles are rendered, i.e, after all call to receive_tile().

 get_canvas()

virtual mi::neuraylib::ICanvas * nv::index::IIndex_canvas::get_canvas ( ) const
pure virtual

Returns the canvas that hosts the rendered pixels.

Returns
The main memory canvas that contains the rendered image.

 get_layer_type()

virtual Frame_buffer_layer_type nv::index::IIndex_canvas::get_layer_type ( mi::Uint32  layer_id) const
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.

Parameters
[in]layer_idThe id of the layer.

 get_nb_frame_buffer_layers()

virtual mi::Uint32 nv::index::IIndex_canvas::get_nb_frame_buffer_layers ( ) const
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.

 get_resolution()

virtual mi::math::Vector_struct< mi::Uint32, 2 > nv::index::IIndex_canvas::get_resolution ( ) const
pure virtual

Returns the resolution of the canvas in pixels.

Returns
The resolution of the canvas in pixels.

 is_multi_thread_capable()

virtual bool nv::index::IIndex_canvas::is_multi_thread_capable ( ) const
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.

Returns
true when tile rendering is in parallel

 prepare()

virtual void nv::index::IIndex_canvas::prepare ( )
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().

 receive_tile()

virtual void nv::index::IIndex_canvas::receive_tile ( mi::Uint8 *  buffer,
mi::Uint32  buffer_size,
const mi::math::Bbox_struct< mi::Uint32, 2 > &  area 
)
pure virtual

This interface method receives multiple tiles.

The method is called for each tile and between prepare() and finish().

Note
This method must be thread safe since the library may call this method from different threads simultaneously.
Deprecated:
Parameters
[in]bufferThe image buffer that contains the rendering inside the tile area.
[in]buffer_sizeThe size of the tile's image buffer.
[in]areaThe 2D bounding box of the tile covered in the screen space.

 receive_tile_blend()

virtual void nv::index::IIndex_canvas::receive_tile_blend ( mi::Uint8 *  buffer,
mi::Uint32  buffer_size,
const mi::math::Bbox_struct< mi::Uint32, 2 > &  area 
)
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.

Note
This method must be thread safe since the library may call this method from different threads simultaneously.
Deprecated:
Parameters
[in]bufferThe image buffer that contains the rendering inside the tile area.
[in]buffer_sizeThe size of the tile's image buffer.
[in]areaThe 2D bounding box of the tile covered in the screen space.

 render_tile()

virtual void nv::index::IIndex_canvas::render_tile ( mi::Uint32  layer_id,
Frame_buffer_layer_type  layer_type,
const mi::math::Bbox_struct< mi::Uint32, 2 > &  area,
mi::Uint8 *  buffer 
)
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().

Note
This method must be thread safe since the library may call this method from different threads simultaneously.
Parameters
[in]layer_idThe id of the layer.
[in]layer_typeThe type of the layer.
[in]areaThe 2D bounding box of the tile covered in the screen space.
[in]bufferThe image buffer that contains the rendering inside the tile area.

The documentation for this class was generated from the following file: