Inkscape
Vector Graphics Editor
|
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) |
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.
anonymous enum |
Enumerator | |
---|---|
ROW | |
COL |
Definition at line 77 of file sp-mesh-array.cpp.
|
static |
Find default color based on colors in existing fill.
Definition at line 1022 of file sp-mesh-array.cpp.
References SPStyle::fill, SPStop::getColor(), SPIPaint::getColor(), SPStyle::getFillPaintServer(), SPIPaint::isColor(), SPIPaint::isPaintserver(), item, and SPObject::style.
Referenced by SPMeshNodeArray::create(), Inkscape::UI::Dialog::get_export_bg_color(), SPIColor::getColor(), SPIPaint::getColor(), and Inkscape::UI::Widget::PrefColorPicker::init().
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().
void invert | ( | const double | v[16], |
double | alpha[16] | ||
) |
Definition at line 1513 of file sp-mesh-array.cpp.
Referenced by Inkscape::Extension::Internal::Wmf::add_bm16_image(), Inkscape::Extension::Internal::Wmf::add_dib_image(), Inkscape::Extension::Internal::Emf::add_image(), Inkscape::Extension::Internal::SvgBuilder::addImageMask(), SPMeshNodeArray::bicubic(), Inkscape::Extension::Internal::Wmf::common_bm16_to_image(), Inkscape::Extension::Internal::Wmf::common_dib_to_image(), Inkscape::Extension::Internal::Emf::common_image_extraction(), Shape::ConvertToShape(), PdfParser::doShowText(), Path::Fill(), Inkscape::Extension::Internal::Filter::ChannelPaint::get_filter_text(), Inkscape::Extension::Internal::Filter::ChannelTransparency::get_filter_text(), SPDocument::prunePages(), Inkscape::UI::ControlPointSelection::selectArea(), and sp_edit_select_all_full().
double sum | ( | const double | alpha[16], |
const double & | x, | ||
const double & | y | ||
) |
Definition at line 1543 of file sp-mesh-array.cpp.
References result.
Referenced by Inkscape::Filters::_make_kernel(), SPMeshNodeArray::bicubic(), Inkscape::calculate_font_weight(), Inkscape::Trace::Siox::colorSignatureStage2(), cola::ConstrainedMajorizationLayout::compute_stress(), Inkscape::Filters::filter2D_FIR(), InkscapeApplication::get_number_of_windows(), Inkscape::Trace::grayMapCanny(), Inkscape::Trace::grayMapGaussian(), Inkscape::LivePathEffect::LPEPts2Ellipse::is_ccw(), SysEq::multiply(), SysEq::multiply(), Inkscape::Trace::quantizeBand(), FloatLigne::RemainingValAt(), and robust_timer().