NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::ICanvas Class Referenceabstract

Abstract interface for a canvas represented by a rectangular array of tiles. More...

Inheritance diagram for mi::neuraylib::ICanvas:
Inheritance graph
[legend]

Public Member Functions

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...
 
virtual Uint32  get_tile_resolution_x () const =0
  Returns the tile size in x direction. More...
 
virtual Uint32  get_tile_resolution_y () const =0
  Returns the tile size in y direction. More...
 
virtual Uint32  get_tiles_size_x () const =0
  Returns the number of tiles in x direction. More...
 
virtual Uint32  get_tiles_size_y () const =0
  Returns the number of tiles in y direction. More...
 
virtual const ITile get_tile (Uint32 pixel_x, Uint32 pixel_y, Uint32 layer=0) const =0
  Returns the tile which contains a given pixel. More...
 
virtual ITile get_tile (Uint32 pixel_x, Uint32 pixel_y, Uint32 layer=0)=0
  Returns the tile which contains a given pixel. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x20e5d5de, 0x1f61, 0x441c, 0x88, 0x88, 0xff, 0x85, 0x89, 0x98, 0x7a, 0xfa, neuraylib::ICanvas_base >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
neuraylib::ICanvas_base
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x20e5d5de, 0x1f61, 0x441c, 0x88, 0x88, 0xff, 0x85, 0x89, 0x98, 0x7a, 0xfa, neuraylib::ICanvas_base >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Abstract interface for a canvas represented by a rectangular array of tiles.

A canvas represents a two-dimensional array of pixels. The size of this array is given by mi::neuraylib::ICanvas_base::get_resolution_x() and mi::neuraylib::ICanvas_base::get_resolution_y(). The pixels are grouped in rectangular tiles of size get_tile_resolution_x() and get_tile_resolution_y(). The number of tiles is given by get_tiles_size_x() and get_tiles_size_y() and it holds

If the left-hand side is strictly larger than the right hand side then there are excess pixels which might have any color.

A pixel at position (canvas_pixel_x, canvas_pixel_y) of the canvas belongs to the tile (tile_number_x, tile_number_y) where tile_number_x and tile_number_y are computed as follows:

tile_number_x = canvas_pixel_x / get_tile_resolution_x()
tile_number_y = canvas_pixel_y / get_tile_resolution_y()

Within this tile the pixel has the coordinates (tile_pixel_x, tile_pixel_y) which are computed as follows

tile_pixel_x = canvas_pixel_x % get_tile_resolution_x()
tile_pixel_y = canvas_pixel_y % get_tile_resolution_y()

Optionally, there can be multiple layers of such tile arrays. The number of these layers is given by get_layers_size(). The format a layer, i.e., the type of each pixel in that layer, is described by get_type().

The mi::neuraylib::IRender_target, mi::neuraylib::ICanvas, and mi::neuraylib::ITile classes are abstract interfaces which can to be implemented by the application. For example, this gives the application the ability to tailor the rendering process very specific to its needs. The render target has to be implemented by the application whereas default implementations for canvases and tiles are available from mi::neuraylib::IImage_api.

See Also
mi::neuraylib::ICanvas_base

Member Function Documentation

virtual Float32 mi::neuraylib::ICanvas::get_gamma ( ) const
pure virtual

Returns the gamma value.

The gamma value should be a positive number. Typical values are 2.2 for LDR pixel types, and 1.0 for HDR pixel types.

virtual Uint32 mi::neuraylib::ICanvas::get_layers_size ( ) const
pure virtual

Returns the number of layers this canvas has.

virtual const ITile* mi::neuraylib::ICanvas::get_tile ( Uint32  pixel_x,
Uint32  pixel_y,
Uint32  layer = 0 
) const
pure virtual

Returns the tile which contains a given pixel.

Parameters
pixel_x The x coordinate of pixel with respect to the canvas.
pixel_y The y coordinate of pixel with respect to the canvas.
layer The layer of the pixel in the canvas.
Returns
The tile that contains the pixel, or NULL in case of invalid parameters.
virtual ITile* mi::neuraylib::ICanvas::get_tile ( Uint32  pixel_x,
Uint32  pixel_y,
Uint32  layer = 0 
)
pure virtual

Returns the tile which contains a given pixel.

Parameters
pixel_x The x coordinate of pixel with respect to the canvas.
pixel_y The y coordinate of pixel with respect to the canvas.
layer The layer of the pixel in the canvas.
Returns
The tile that contains the pixel, or NULL in case of invalid parameters.
virtual Uint32 mi::neuraylib::ICanvas::get_tile_resolution_x ( ) const
pure virtual

Returns the tile size in x direction.

virtual Uint32 mi::neuraylib::ICanvas::get_tile_resolution_y ( ) const
pure virtual

Returns the tile size in y direction.

virtual Uint32 mi::neuraylib::ICanvas::get_tiles_size_x ( ) const
pure virtual

Returns the number of tiles in x direction.

virtual Uint32 mi::neuraylib::ICanvas::get_tiles_size_y ( ) const
pure virtual

Returns the number of tiles in y direction.

virtual void mi::neuraylib::ICanvas::set_gamma ( Float32  gamma)
pure virtual

Sets the gamma value.

Note
This method just sets the gamma value. It does not change the pixel data itself.