MDL SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::ITexture Class Referenceabstract

Textures add image processing options to images. More...

#include <itexture.h>

Inheritance diagram for mi::neuraylib::ITexture:

Public Member Functions

Methods related to the referenced image
virtual Sint32 set_image (const char *name)=0
 Sets the referenced image. More...
 
virtual const char * get_image () const =0
 Returns the referenced image. More...
 
virtual Sint32 set_volume (const char *name)=0
 
virtual const char * get_volume () const =0
 
Methods related to the gamma value
virtual void set_gamma (Float32 gamma)=0
 Sets the gamma value of this texture. More...
 
virtual Float32 get_gamma () const =0
 Returns the gamma value of this texture. More...
 
virtual Float32 get_effective_gamma (Size frame_id, Size uvtile_id) const =0
 Returns the effective gamma value. More...
 
Miscellaneous methods
virtual const char * get_selector () const =0
 Returns the selector (or NULL). More...
 
virtual void set_compression (Texture_compression compression)=0
 Sets the texture compression method. More...
 
virtual Texture_compression get_compression () const =0
 Returns the texture compression method. More...
 
- Public Member Functions inherited from mi::neuraylib::IScene_element
virtual Element_type get_element_type () const =0
 Indicates the actual scene element represented by interfaces derived from this interface. More...
 
- Public Member Functions inherited from mi::neuraylib::IAttribute_set
virtual IDatacreate_attribute (const char *name, const char *type)=0
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name, const char *type)
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name)
 Creates a new attribute name of the type T. More...
 
virtual bool destroy_attribute (const char *name)=0
 Destroys the attribute name. More...
 
virtual const IDataaccess_attribute (const char *name) const =0
 Returns a const pointer to the attribute name. More...
 
template<class T>
const T * access_attribute (const char *name) const
 Returns a const pointer to the attribute name. More...
 
virtual IDataedit_attribute (const char *name)=0
 Returns a mutable pointer to the attribute name. More...
 
template<class T>
T * edit_attribute (const char *name)
 Returns a mutable pointer to the attribute name. More...
 
virtual bool is_attribute (const char *name) const =0
 Indicates existence of an attribute. More...
 
virtual const char * get_attribute_type_name (const char *name) const =0
 Returns the type of an attribute. More...
 
virtual Sint32 set_attribute_propagation (const char *name, Propagation_type value)=0
 Sets the propagation type of the attribute name. More...
 
virtual Propagation_type get_attribute_propagation (const char *name) const =0
 Returns the propagation type of the attribute name. More...
 
virtual const char * enumerate_attributes (Sint32 index) const =0
 Returns the name of the attribute indicated by index. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x012c847c, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x012c847c, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

Textures add image processing options to images.

A texture appears in the scene as an argument of an MDL function call (see mi::neuraylib::IFunction_call) or default argument of an MDL function definition (see mi::neuraylib::IFunction_definition). The type of such an argument is mi::neuraylib::IType_texture or an alias of it.

See also
mi::neuraylib::IImage

Member Function Documentation

 get_compression()

virtual Texture_compression mi::neuraylib::ITexture::get_compression ( ) const
pure virtual

Returns the texture compression method.

Note
This setting does not affect the referenced image itself, it only affects image data that has been processed by the render modes. For example, in order to save GPU memory processed image data can be compressed before being uploaded to the GPU.
See also
mi::neuraylib::Texture_compression

 get_effective_gamma()

virtual Float32 mi::neuraylib::ITexture::get_effective_gamma ( Size  frame_id,
Size  uvtile_id 
) const
pure virtual

Returns the effective gamma value.

Returns the gamma value of this texture, unless no override is set. In this case the gamma value of the underlying image at the given frame and uvtile index is returned. If no such image exists, 0.0 is returned.

Parameters
frame_idThe frame ID of the mipmap the gamma value is requested for when no override is set.
uvtile_idThe uv-tile id of the mipmap the gamma value is requested for when no override is set.
See also
set_gamma(), get_gamma()

 get_gamma()

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

Returns the gamma value of this texture.

See also
set_gamma(), get_effective_gamma()

 get_image()

virtual const char * mi::neuraylib::ITexture::get_image ( ) const
pure virtual

Returns the referenced image.

Returns
The referenced image, or NULL if no image is referenced.

 get_selector()

virtual const char * mi::neuraylib::ITexture::get_selector ( ) const
pure virtual

Returns the selector (or NULL).

 get_volume()

virtual const char * mi::neuraylib::ITexture::get_volume ( ) const
pure virtual

 set_compression()

virtual void mi::neuraylib::ITexture::set_compression ( Texture_compression  compression)
pure virtual

Sets the texture compression method.

Note
This setting does not affect the referenced image itself, it only affects image data that has been processed by the render modes. For example, in order to save GPU memory processed image data can be compressed before being uploaded to the GPU.
See also
mi::neuraylib::Texture_compression

 set_gamma()

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

Sets the gamma value of this texture.

The gamma value of the texture is an override for the gamma value of the underlying image. The special value 0.0 means that the override is not set.

This override value is also used when MDL source code is to be generated:

  • a value of 1.0 is converted to "::tex::gamma_linear",
  • a value of 2.2 is converted to "::tex::gamma_srgb", and
  • all other values are converted to "::tex::gamma_default". Therefore, if you want to avoid "::tex::gamma_default" in generated MDL source code, it makes sense to replicate the gamma value of the underlying image here (instead of not using the override).
See also
get_gamma(), get_effective_gamma()

 set_image()

virtual Sint32 mi::neuraylib::ITexture::set_image ( const char *  name)
pure virtual

Sets the referenced image.

Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be referenced because it is in a more private scope than the texture.
  • -4: The element is not an image.

 set_volume()

virtual Sint32 mi::neuraylib::ITexture::set_volume ( const char *  name)
pure virtual