Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-gradient.cpp File Reference

SPGradient, SPStop, SPLinearGradient, SPRadialGradient, SPMeshGradient, SPMeshRow, SPMeshPatch. More...

Go to the source code of this file.

Functions

static SPGradientchase_hrefs (SPGradient *const src, bool(*match)(SPGradient const *))
 Returns the first of {src, src->ref->getObject(), src->ref->getObject()->ref->getObject(),...} for which match is true, or NULL if none found.
 
static bool has_stopsFN (SPGradient const *gr)
 True if gradient has stops.
 
static bool has_patchesFN (SPGradient const *gr)
 True if gradient has patches (i.e.
 
static bool has_spread_set (SPGradient const *gr)
 True if gradient has spread set.
 
static bool has_units_set (SPGradient const *gr)
 True if gradient has units set.
 
void sp_gradient_pattern_common_setup (cairo_pattern_t *cp, SPGradient *gr, Geom::OptRect const &bbox, double opacity)
 

Detailed Description

SPGradient, SPStop, SPLinearGradient, SPRadialGradient, SPMeshGradient, SPMeshRow, SPMeshPatch.

Definition in file sp-gradient.cpp.

Function Documentation

◆ chase_hrefs()

static SPGradient * chase_hrefs ( SPGradient *const  src,
bool(*)(SPGradient const *)  match 
)
static

Returns the first of {src, src->ref->getObject(), src->ref->getObject()->ref->getObject(),...} for which match is true, or NULL if none found.

The raison d'ĂȘtre of this routine is that it correctly handles cycles in the href chain (e.g., if a gradient gives itself as its href, or if each of two gradients gives the other as its href).

Precondition
is<SPGradient>(src).

Definition at line 773 of file sp-gradient.cpp.

References SPGradientReference::getObject(), and SPGradient::ref.

Referenced by SPGradient::fetchSpread(), SPGradient::fetchUnits(), SPGradient::getArray(), and SPGradient::getVector().

◆ has_patchesFN()

static bool has_patchesFN ( SPGradient const *  gr)
static

True if gradient has patches (i.e.

a mesh).

Definition at line 815 of file sp-gradient.cpp.

References SPGradient::hasPatches().

Referenced by SPGradient::getArray().

◆ has_spread_set()

static bool has_spread_set ( SPGradient const *  gr)
static

True if gradient has spread set.

Definition at line 823 of file sp-gradient.cpp.

References SPGradient::isSpreadSet().

Referenced by SPGradient::fetchSpread().

◆ has_stopsFN()

static bool has_stopsFN ( SPGradient const *  gr)
static

True if gradient has stops.

Definition at line 807 of file sp-gradient.cpp.

References SPGradient::hasStops().

Referenced by SPGradient::getVector().

◆ has_units_set()

static bool has_units_set ( SPGradient const *  gr)
static

True if gradient has units set.

Definition at line 832 of file sp-gradient.cpp.

References SPGradient::isUnitsSet().

Referenced by SPGradient::fetchUnits().

◆ sp_gradient_pattern_common_setup()