Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IBaker Class Referenceabstract

Allows to bake a varying or uniform expression of a compiled material into a texture or constant. More...

Inheritance diagram for mi::neuraylib::IBaker:
mi::base::Interface_declare< 0x4dba1b1d, 0x8fce, 0x43d9, 0x80, 0xa7, 0xa2, 0x24, 0xf3, 0x1e, 0xdc, 0xe7 > mi::base::IInterface

Public Member Functions

virtual const char * get_pixel_type () const =0
 Returns the pixel type that matches the expression to be baked best. More...
 
virtual bool is_uniform () const =0
 Indicates whether the expression to be baked is uniform or varying. More...
 
virtual Sint32 bake_texture (ICanvas *texture, Uint32 samples=1) const =0
 Bakes the expression as texture. More...
 
virtual Sint32 bake_constant (IData *constant, Uint32 samples=1) const =0
 Bakes the expression as constant. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x4dba1b1d, 0x8fce, 0x43d9, 0x80, 0xa7, 0xa2, 0x24, 0xf3, 0x1e, 0xdc, 0xe7 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
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< 0x4dba1b1d, 0x8fce, 0x43d9, 0x80, 0xa7, 0xa2, 0x24, 0xf3, 0x1e, 0xdc, 0xe7 >
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

Allows to bake a varying or uniform expression of a compiled material into a texture or constant.

Member Function Documentation

virtual Sint32 mi::neuraylib::IBaker::bake_constant ( IData constant,
Uint32  samples = 1 
) const
pure virtual

Bakes the expression as constant.

Parameters
constantAn instance of mi::IData of suitable type such that the baked constant can be stored in this argument. For pixel types "Float32" and "Float32<3>" the type name of this argument needs to match the pixel type. For pixel type "Rgb_fp" this argument needs to have the type name "Color".
samplesThe (total) number of samples.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The transaction that is bound to this baker is no longer open.
  • -3: The execution of the MDL code failed.
  • -4: The type of constant does not match the pixel type corresponding to the expression to be baked.
virtual Sint32 mi::neuraylib::IBaker::bake_texture ( ICanvas texture,
Uint32  samples = 1 
) const
pure virtual

Bakes the expression as texture.

Parameters
textureThe baked texture will be stored in this canvas. If the pixel type of canvas does not match the pixel type of the expression to be baked (as indicated by get_pixel_type()), then the pixel data is converted as described in mi::neuraylib::IImage_api::convert().
samplesThe number of samples (per pixel).
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The transaction that is bound to this baker is no longer open.
  • -3: The execution of the MDL code failed.
virtual const char* mi::neuraylib::IBaker::get_pixel_type ( ) const
pure virtual

Returns the pixel type that matches the expression to be baked best.

virtual bool mi::neuraylib::IBaker::is_uniform ( ) const
pure virtual

Indicates whether the expression to be baked is uniform or varying.

Typically, varying expressions are baked into textures, and uniform expressions into constant. However, it is also possible to do it the other way round.