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

Go to the source code of this file.

Classes

class  SPMeshNode
 
class  SPMeshPatchI
 
class  SPMeshNodeArray
 

Enumerations

enum  SPMeshType { SP_MESH_TYPE_COONS , SP_MESH_TYPE_BICUBIC }
 A group of classes and functions for manipulating mesh gradients. More...
 
enum  SPMeshGeometry { SP_MESH_GEOMETRY_NORMAL , SP_MESH_GEOMETRY_CONICAL }
 
enum  NodeType { MG_NODE_TYPE_UNKNOWN , MG_NODE_TYPE_CORNER , MG_NODE_TYPE_HANDLE , MG_NODE_TYPE_TENSOR }
 
enum  NodeEdge {
  MG_NODE_EDGE_NONE , MG_NODE_EDGE_TOP = 1 , MG_NODE_EDGE_LEFT = 2 , MG_NODE_EDGE_BOTTOM = 4 ,
  MG_NODE_EDGE_RIGHT = 8
}
 
enum  MeshCornerOperation {
  MG_CORNER_SIDE_TOGGLE , MG_CORNER_SIDE_ARC , MG_CORNER_TENSOR_TOGGLE , MG_CORNER_COLOR_SMOOTH ,
  MG_CORNER_COLOR_PICK , MG_CORNER_INSERT
}
 
enum  MeshNodeOperation { MG_NODE_NO_SCALE , MG_NODE_SCALE , MG_NODE_SCALE_HANDLE }
 

Enumeration Type Documentation

◆ MeshCornerOperation

Enumerator
MG_CORNER_SIDE_TOGGLE 
MG_CORNER_SIDE_ARC 
MG_CORNER_TENSOR_TOGGLE 
MG_CORNER_COLOR_SMOOTH 
MG_CORNER_COLOR_PICK 
MG_CORNER_INSERT 

Definition at line 78 of file sp-mesh-array.h.

◆ MeshNodeOperation

Enumerator
MG_NODE_NO_SCALE 
MG_NODE_SCALE 
MG_NODE_SCALE_HANDLE 

Definition at line 87 of file sp-mesh-array.h.

◆ NodeEdge

enum NodeEdge
Enumerator
MG_NODE_EDGE_NONE 
MG_NODE_EDGE_TOP 
MG_NODE_EDGE_LEFT 
MG_NODE_EDGE_BOTTOM 
MG_NODE_EDGE_RIGHT 

Definition at line 70 of file sp-mesh-array.h.

◆ NodeType

enum NodeType
Enumerator
MG_NODE_TYPE_UNKNOWN 
MG_NODE_TYPE_CORNER 
MG_NODE_TYPE_HANDLE 
MG_NODE_TYPE_TENSOR 

Definition at line 62 of file sp-mesh-array.h.

◆ SPMeshGeometry

Enumerator
SP_MESH_GEOMETRY_NORMAL 
SP_MESH_GEOMETRY_CONICAL 

Definition at line 57 of file sp-mesh-array.h.

◆ SPMeshType

enum SPMeshType

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.

Enumerator
SP_MESH_TYPE_COONS 
SP_MESH_TYPE_BICUBIC 

Definition at line 52 of file sp-mesh-array.h.