![]() |
![]() |
Gwyddion Drawing Library Reference Manual | ![]() |
|
---|---|---|---|---|
#define GWY_GL_MATERIAL_DEFAULT #define GWY_GL_MATERIAL_NONE GwyGLMaterial; GwyGLMaterialClass; const GwyRGBA* gwy_gl_material_get_ambient (GwyGLMaterial *gl_material); void gwy_gl_material_set_ambient (GwyGLMaterial *gl_material, const GwyRGBA *ambient); const GwyRGBA* gwy_gl_material_get_diffuse (GwyGLMaterial *gl_material); void gwy_gl_material_set_diffuse (GwyGLMaterial *gl_material, const GwyRGBA *diffuse); const GwyRGBA* gwy_gl_material_get_specular (GwyGLMaterial *gl_material); void gwy_gl_material_set_specular (GwyGLMaterial *gl_material, const GwyRGBA *specular); const GwyRGBA* gwy_gl_material_get_emission (GwyGLMaterial *gl_material); void gwy_gl_material_set_emission (GwyGLMaterial *gl_material, const GwyRGBA *emission); gdouble gwy_gl_material_get_shininess (GwyGLMaterial *gl_material); void gwy_gl_material_set_shininess (GwyGLMaterial *gl_material, gdouble shininess); void gwy_gl_material_sample_to_pixbuf (GwyGLMaterial *gl_material, GdkPixbuf *pixbuf); void gwy_gl_material_reset (GwyGLMaterial *gl_material); GwyInventory* gwy_gl_materials (void); GwyGLMaterial* gwy_gl_materials_get_gl_material (const gchar *name);
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()
.
#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.
typedef struct _GwyGLMaterial GwyGLMaterial;
The GwyGLMaterial struct contains private data only and should be accessed using the functions below.
typedef struct _GwyGLMaterialClass GwyGLMaterialClass;
GwyGLMaterialClass does not contain any public members.
const GwyRGBA* gwy_gl_material_get_ambient (GwyGLMaterial *gl_material);
Gets the ambient reflectance of a GL material.
gl_material : |
A GL material. |
Returns : | 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. |
Returns : | 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. |
Returns : | 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. |
Returns : | 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. |
Returns : | 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.
Returns : | 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 NULL to get the default GL material.
|
Returns : | GL material identified by name or the default GL material if name
does not exist.
|