|
sphore 0.0.1
SPH openGL rendering engine
|
Code for managing colour ramps. More...
#include <math.h>#include <stdlib.h>#include <GL/gl.h>#include "colour-ramp.h"#include "sphore.h"#include "warning.h"#include "settings.h"Data Structures | |
| struct | _colour_ramp |
Functions | |
| colour_ramp_t * | colour_ramp_create () |
| Creates a new colour ramp. | |
| SREbool | colour_ramp_set (colour_ramp_t *cr, int n, float *controlPoints, float *red, float *green, float *blue) |
| Sets the colour ramp to the one given. | |
| void | colour_ramp_get_rgb (colour_ramp_t *cr, float pos, float *red, float *green, float *blue) |
| Gets the red, green and blue values from the given colour ramp at the given position. | |
| void | colour_ramp_destroy (colour_ramp_t *cr) |
| Frees the memory accosiated with a given colour ramp. | |
| void | colour_ramp_onto_device (colour_ramp_t *cr) |
Code for managing colour ramps.
| colour_ramp_t* colour_ramp_create | ( | ) |
Creates a new colour ramp.
The ramp will be initialised to a monochrome ramp.
| void colour_ramp_destroy | ( | colour_ramp_t * | cr | ) |
Frees the memory accosiated with a given colour ramp.
| [in] | cr | The colour ramp to destroy. |
| void colour_ramp_get_rgb | ( | colour_ramp_t * | cr, |
| float | pos, | ||
| float * | red, | ||
| float * | green, | ||
| float * | blue | ||
| ) |
Gets the red, green and blue values from the given colour ramp at the given position.
| [in] | cr | The ramp to query. |
| [in] | pos | The position on the ramp in normalised units. |
| [out] | red | Gets set to the red component at pos. |
| [out] | green | Gets set to the green component at pos. |
| [out] | blue | Gets set to the blue component at pos. |
| void colour_ramp_onto_device | ( | colour_ramp_t * | cr | ) |
| SREbool colour_ramp_set | ( | colour_ramp_t * | cr, |
| int | n, | ||
| float * | controlPoints, | ||
| float * | red, | ||
| float * | green, | ||
| float * | blue | ||
| ) |
Sets the colour ramp to the one given.
| [in] | cr | The colour ramp object to set |
| [in] | n | The number of control points to be used |
| [in] | controlPoints | The position of the control points on the ramp. in normalised units i.e. 0 at the begining, 1 at the end. |
| [in] | red | The value of the red component of the colour at each control point. |
| [in] | green | The value of the green component of the colour at each control point. |
| [in] | blue | The value of the blue component of the colour at each control point. |