libSBML C API
5.18.0
|
The gradient stop concept was more or less taken from the corresponding concept in SVG. A GradientStop_t object represents the color at a certain location in a linear or radial gradient. Each gradient should contain two or more gradient stops which mark the edges of a region within this region color are interpolated based on the distance of the location to the edges of the region.
A gradient stop has two attributes. The first attribute is an offset which determines the location for the gradient stop within the object the gradient is applied to. The offset can either be an absolute value or a relative value or a combination of absolute and relative value. For example, a value of "50%" for the offset means that the gradient stop is located at 50% of the gradient vector. For more information and examples, see the render extension specification or the SVG specification.
The second attribute defines the color for the gradient stop. The color can either be defined be a color value string or by the id of a ColorDefinition_t object.
Public Member Functions | |
GradientStop_t * | GradientStop_clone (const GradientStop_t *gs) |
Creates and returns a deep copy of this GradientStop_t object. More... | |
GradientStop_t * | GradientStop_create (unsigned int level, unsigned int version, unsigned int pkgVersion) |
Creates a new GradientStop_t using the given SBML Level, Version and “render” package version. More... | |
void | GradientStop_free (GradientStop_t *gs) |
Frees this GradientStop_t object. More... | |
const RelAbsVector_t * | GradientStop_getOffset (const GradientStop_t *gs) |
Returns the value of the "offset" element of this GradientStop_t. More... | |
char * | GradientStop_getStopColor (const GradientStop_t *gs) |
Returns the value of the "stop-color" attribute of this GradientStop_t. More... | |
int | GradientStop_hasRequiredAttributes (const GradientStop_t *gs) |
Predicate returning 1 (true) if all the required attributes for this GradientStop_t object have been set. More... | |
int | GradientStop_isSetOffset (const GradientStop_t *gs) |
Predicate returning 1 (true) if this GradientStop_t's "offset" element is set. More... | |
int | GradientStop_isSetStopColor (const GradientStop_t *gs) |
Predicate returning 1 (true) if this GradientStop_t's "stop-color" attribute is set. More... | |
int | GradientStop_setOffset (GradientStop_t *gs, const RelAbsVector_t &offset) |
Sets the value of the "offset" element of this GradientStop_t. More... | |
int | GradientStop_setStopColor (GradientStop_t *gs, const char *stopColor) |
Sets the value of the "stop-color" attribute of this GradientStop_t. More... | |
int | GradientStop_unsetOffset (GradientStop_t *gs) |
Unsets the value of the "offset" element of this GradientStop_t. More... | |
int | GradientStop_unsetStopColor (GradientStop_t *gs) |
Unsets the value of the "stop-color" attribute of this GradientStop_t. More... | |
GradientStop_t * GradientStop_clone | ( | const GradientStop_t * | gs | ) |
Creates and returns a deep copy of this GradientStop_t object.
gs | the GradientStop_t structure. |
GradientStop_t * GradientStop_create | ( | unsigned int | level, |
unsigned int | version, | ||
unsigned int | pkgVersion | ||
) |
Creates a new GradientStop_t using the given SBML Level, Version and “render” package version.
level | an unsigned int, the SBML Level to assign to this GradientStop_t. |
version | an unsigned int, the SBML Version to assign to this GradientStop_t. |
pkgVersion | an unsigned int, the SBML Render Version to assign to this GradientStop_t. |
void GradientStop_free | ( | GradientStop_t * | gs | ) |
Frees this GradientStop_t object.
gs | the GradientStop_t structure. |
const RelAbsVector_t * GradientStop_getOffset | ( | const GradientStop_t * | gs | ) |
Returns the value of the "offset" element of this GradientStop_t.
gs | the GradientStop_t structure whose offset is sought. |
char * GradientStop_getStopColor | ( | const GradientStop_t * | gs | ) |
Returns the value of the "stop-color" attribute of this GradientStop_t.
gs | the GradientStop_t structure whose stop-color is sought. |
int GradientStop_hasRequiredAttributes | ( | const GradientStop_t * | gs | ) |
Predicate returning 1
(true) if all the required attributes for this GradientStop_t object have been set.
gs | the GradientStop_t structure. |
1
(true) to indicate that all the required attributes of this GradientStop_t have been set, otherwise 0
(false) is returned.int GradientStop_isSetOffset | ( | const GradientStop_t * | gs | ) |
Predicate returning 1
(true) if this GradientStop_t's "offset" element is set.
gs | the GradientStop_t structure. |
1
(true) if this GradientStop_t's "offset" element has been set, otherwise 0
(false) is returned. int GradientStop_isSetStopColor | ( | const GradientStop_t * | gs | ) |
Predicate returning 1
(true) if this GradientStop_t's "stop-color" attribute is set.
gs | the GradientStop_t structure. |
1
(true) if this GradientStop_t's "stop-color" attribute has been set, otherwise 0
(false) is returned. int GradientStop_setOffset | ( | GradientStop_t * | gs, |
const RelAbsVector_t & | offset | ||
) |
Sets the value of the "offset" element of this GradientStop_t.
gs | the GradientStop_t structure. |
offset | RelAbsVector_t value of the "offset" element to be set. |
int GradientStop_setStopColor | ( | GradientStop_t * | gs, |
const char * | stopColor | ||
) |
Sets the value of the "stop-color" attribute of this GradientStop_t.
gs | the GradientStop_t structure. |
stopColor | const char * value of the "stop-color" attribute to be set. |
stopColor
= NULL
or an empty string is equivalent to calling GradientStop_unsetStopColor(). int GradientStop_unsetOffset | ( | GradientStop_t * | gs | ) |
Unsets the value of the "offset" element of this GradientStop_t.
gs | the GradientStop_t structure. |
int GradientStop_unsetStopColor | ( | GradientStop_t * | gs | ) |
Unsets the value of the "stop-color" attribute of this GradientStop_t.
gs | the GradientStop_t structure. |