Module gwy :: Class GLMaterial
[hide private]
[frames] | no frames]

Class GLMaterial

source code

OpenGL material representation

GLMaterial represents an OpenGL material. Its properties directly map to corresponding OpenGL material characteristics, all are in the range [0,1].

Gradient objects can be obtained from gwy_gl_materials_get_gl_material(). New GL materials can be created with Inventory.new_item() on the Inventory returned by gwy_gl_materials().

Instance Methods [hide private]
 
get_ambient()
Gets the ambient reflectance of a GL material.
source code
 
set_ambient(ambient)
Sets the ambient reflectance of a GL material.
source code
 
get_diffuse()
Gets the diffuse reflectance of a GL material.
source code
 
set_diffuse(diffuse)
Sets the diffuse reflectance of a GL material.
source code
 
get_specular()
Gets the specular reflectance of a GL material.
source code
 
set_specular(specular)
Sets the specular reflectance of a GL material.
source code
 
get_emission()
Gets the emission component of a GL material.
source code
 
set_emission(emission)
Sets the emission component of a GL material.
source code
 
get_shininess()
Gets the shininess value of a GL material.
source code
 
set_shininess(shininess)
Sets the shininess value of a GL material.
source code
 
sample_to_pixbuf(pixbuf)
Samples GL material to a provided pixbuf.
source code
 
reset()
Resets a GL material to default values.
source code
Method Details [hide private]

get_ambient()

source code 

Gets the ambient reflectance of a GL material.

Returns:
Ambient reflectance (owned by GL material, must not be modified nor freed). (const-RGBA*)

set_ambient(ambient)

source code 

Sets the ambient reflectance of a GL material.

Parameters:
  • ambient - Ambient reflectance. (const-RGBA*)

get_diffuse()

source code 

Gets the diffuse reflectance of a GL material.

Returns:
Diffuse reflectance (owned by GL material, must not be modified nor freed). (const-RGBA*)

set_diffuse(diffuse)

source code 

Sets the diffuse reflectance of a GL material.

Parameters:
  • diffuse - Diffuse reflectance. (const-RGBA*)

get_specular()

source code 

Gets the specular reflectance of a GL material.

Returns:
Specular reflectance (owned by GL material, must not be modified nor freed). (const-RGBA*)

set_specular(specular)

source code 

Sets the specular reflectance of a GL material.

Parameters:
  • specular - Specular reflectance. (const-RGBA*)

get_emission()

source code 

Gets the emission component of a GL material.

Returns:
Emission component (owned by GL material, must not be modified nor freed). (const-RGBA*)

set_emission(emission)

source code 

Sets the emission component of a GL material.

Parameters:
  • emission - Emission component. (const-RGBA*)

get_shininess()

source code 

Gets the shininess value of a GL material.

Returns:
The shininess value (in range 0..1, not 0..128). (float)

set_shininess(shininess)

source code 

Sets the shininess value of a GL material.

Parameters:
  • shininess - Shinniness value (in range 0..1, not 0..128). (float)

sample_to_pixbuf(pixbuf)

source code 

Samples GL material to a provided pixbuf.

Parameters:
  • pixbuf - A pixbuf to sample gl_material to (in horizontal direction). (gdk.Pixbuf)