Material Definition Language API nvidia_logo_transpbg.gif 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:
mi::base::Interface_declare< 0x20e5d5de, 0x1f61, 0x441c, 0x88, 0x88, 0xff, 0x85, 0x89, 0x98, 0x7a, 0xfa, neuraylib::ICanvas_base > mi::neuraylib::ICanvas_base mi::base::Interface_declare< 0x649fc7bd, 0xc021, 0x4aff, 0x9e, 0xa4, 0x5b, 0xab, 0x18, 0xb9, 0x25, 0x59 > mi::base::IInterface

Public Member Functions

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 ITileget_tile (Uint32 pixel_x, Uint32 pixel_y, Uint32 layer=0) const =0
 Returns the tile which contains a given pixel. More...
 
virtual ITileget_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- or three-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 mi::neuraylib::ICanvas_base::get_layers_size(). The format a layer, i.e., the type of each pixel in that layer, is described by mi::neuraylib::ICanvas_base::get_type().

See Also
mi::neuraylib::ICanvas_base

Member Function Documentation

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_xThe x coordinate of pixel with respect to the canvas.
pixel_yThe y coordinate of pixel with respect to the canvas.
layerThe 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_xThe x coordinate of pixel with respect to the canvas.
pixel_yThe y coordinate of pixel with respect to the canvas.
layerThe 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.