GwyGLMaterial — OpenGL material representation
const GwyRGBA * | gwy_gl_material_get_ambient () |
void | gwy_gl_material_set_ambient () |
const GwyRGBA * | gwy_gl_material_get_diffuse () |
void | gwy_gl_material_set_diffuse () |
const GwyRGBA * | gwy_gl_material_get_specular () |
void | gwy_gl_material_set_specular () |
const GwyRGBA * | gwy_gl_material_get_emission () |
void | gwy_gl_material_set_emission () |
gdouble | gwy_gl_material_get_shininess () |
void | gwy_gl_material_set_shininess () |
void | gwy_gl_material_sample_to_pixbuf () |
void | gwy_gl_material_reset () |
GwyInventory * | gwy_gl_materials () |
GwyGLMaterial * | gwy_gl_materials_get_gl_material () |
#define | GWY_GL_MATERIAL_DEFAULT |
#define | GWY_GL_MATERIAL_NONE |
struct | GwyGLMaterial |
struct | GwyGLMaterialClass |
GObject ╰── GwyResource ╰── GwyGLMaterial
#include <libdraw/gwydraw.h>
GwyGLMaterial 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 gwy_inventory_new_item()
on the
GwyInventory returned by gwy_gl_materials()
.
const GwyRGBA *
gwy_gl_material_get_ambient (GwyGLMaterial *gl_material
);
Gets the ambient reflectance of a GL material.
gl_material |
A GL material. |
Ambient reflectance (owned by GL material, must not be modified nor freed).
void gwy_gl_material_set_ambient (GwyGLMaterial *gl_material
,const GwyRGBA *ambient
);
Sets the ambient reflectance of a GL material.
gl_material |
A GL material. |
|
ambient |
Ambient reflectance. |
const GwyRGBA *
gwy_gl_material_get_diffuse (GwyGLMaterial *gl_material
);
Gets the diffuse reflectance of a GL material.
gl_material |
A GL material. |
Diffuse reflectance (owned by GL material, must not be modified nor freed).
void gwy_gl_material_set_diffuse (GwyGLMaterial *gl_material
,const GwyRGBA *diffuse
);
Sets the diffuse reflectance of a GL material.
gl_material |
A GL material. |
|
diffuse |
Diffuse reflectance. |
const GwyRGBA *
gwy_gl_material_get_specular (GwyGLMaterial *gl_material
);
Gets the specular reflectance of a GL material.
gl_material |
A GL material. |
Specular reflectance (owned by GL material, must not be modified nor freed).
void gwy_gl_material_set_specular (GwyGLMaterial *gl_material
,const GwyRGBA *specular
);
Sets the specular reflectance of a GL material.
gl_material |
A GL material. |
|
specular |
Specular reflectance. |
const GwyRGBA *
gwy_gl_material_get_emission (GwyGLMaterial *gl_material
);
Gets the emission component of a GL material.
gl_material |
A GL material. |
Emission component (owned by GL material, must not be modified nor freed).
void gwy_gl_material_set_emission (GwyGLMaterial *gl_material
,const GwyRGBA *emission
);
Sets the emission component of a GL material.
gl_material |
A GL material. |
|
emission |
Emission component. |
gdouble
gwy_gl_material_get_shininess (GwyGLMaterial *gl_material
);
Gets the shininess value of a GL material.
gl_material |
A GL material. |
The shininess value (in range 0..1, not 0..128).
void gwy_gl_material_set_shininess (GwyGLMaterial *gl_material
,gdouble shininess
);
Sets the shininess value of a GL material.
gl_material |
A GL material. |
|
shininess |
Shinniness value (in range 0..1, not 0..128). |
void gwy_gl_material_sample_to_pixbuf (GwyGLMaterial *gl_material
,GdkPixbuf *pixbuf
);
Samples GL material to a provided pixbuf.
gl_material |
A GL material to sample. |
|
pixbuf |
A pixbuf to sample gl_material to (in horizontal direction). |
void
gwy_gl_material_reset (GwyGLMaterial *gl_material
);
Resets a GL material to default values.
gl_material |
A GL material. |
GwyInventory *
gwy_gl_materials (void
);
Gets inventory with all the GL materials.
GL material inventory.
GwyGLMaterial *
gwy_gl_materials_get_gl_material (const gchar *name
);
Convenience function to get a GL material from gwy_gl_materials()
by name.
name |
GL material name. May be |
GL material identified by name
or the default GL material if name
does not exist.
#define GWY_GL_MATERIAL_DEFAULT "OpenGL-Default"
The name of the default OpenGL material.
It is guaranteed to always exist.
Note this is not the same as user's default material which corresponds to
the default item in gwy_gl_materials()
inventory and it change over time.
#define GWY_GL_MATERIAL_NONE "None"
The name of special void material with all characteristics zero.
It is guaranteed to exist, but you should rarely actually need it.
struct GwyGLMaterial;
The GwyGLMaterial struct contains private data only and should be accessed using the functions below.
struct GwyGLMaterialClass { };
GwyGLMaterialClass does not contain any public members.
Gwy3DView -- 3D data display widget, GwyRGBA -- representation of color components, GwyInventory -- the container holding all GL materials