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

A group of classes and functions for manipulating mesh gradients. More...

Go to the source code of this file.

Enumerations

enum  { ROW , COL }
 

Functions

static Inkscape::Colors::Color default_color (SPItem *item)
 Find default color based on colors in existing fill.
 
double find_slope1 (double const p0, double const p1, double const p2, double const d01, double const d12)
 
void invert (const double v[16], double alpha[16])
 
double sum (const double alpha[16], const double &x, const double &y)
 

Detailed Description

A group of classes and functions for manipulating mesh gradients.

A mesh is made up of an array of patches. Each patch has four sides and four corners. The sides can be shared between two patches and the corners between up to four.

The order of the points for each side always goes from left to right or top to bottom. For sides 2 and 3 the points must be reversed when used (as in calls to cairo functions).

Two patches: (C=corner, S=side, H=handle, T=tensor)

                  C0   H1  H2 C1 C0 H1  H2  C1
                   + ---------- + ---------- +
                   |     S0     |     S0     |
                H1 |  T0    T1  |H1 T0   T1  | H1
                   |S3        S1|S3        S1|
                H2 |  T3    T2  |H2 T3   T2  | H2
                   |     S2     |     S2     |
                   + ---------- + ---------- +
                  C3   H1  H2 C2 C3 H1  H2   C2

The mesh is stored internally as an array of nodes that includes the tensor nodes.

Note: This code uses tensor points which are not part of the SVG2 plan at the moment. Including tensor points was motivated by a desire to experiment with their usefulness in smoothing color transitions. There doesn't seem to be much advantage for that purpose. However including them internally allows for storing all the points in an array which simplifies things like inserting new rows or columns.

Definition in file sp-mesh-array.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ROW 
COL 

Definition at line 77 of file sp-mesh-array.cpp.

Function Documentation

◆ default_color()

◆ find_slope1()

double find_slope1 ( double const  p0,
double const  p1,
double const  p2,
double const  d01,
double const  d12 
)

Definition at line 1455 of file sp-mesh-array.cpp.

Referenced by SPMeshNodeArray::bicubic().

◆ invert()

◆ sum()