Inkscape
Vector Graphics Editor
|
Classes | |
class | AnySpace |
class | CMS |
struct | Component |
class | Components |
class | DeviceCMYK |
This sRGB based DeviceCMYK space is uncalibrated and fixed to the sRGB icc profile. More... | |
class | Gray |
class | HSL |
class | HSLuv |
class | HSV |
class | Lab |
class | Lch |
class | LinearRGB |
class | Luv |
class | NamedColor |
A named color is still a purely RGB color, it's just formatted so it can be written back out as a named color faithfully. More... | |
class | OkHsl |
class | OkHsv |
class | OkLab |
class | OkLch |
class | RGB |
class | XYZ |
Typedefs | |
using | Matrix = const double[3][3] |
Two-dimensional array to store a constant 3x3 matrix. | |
Enumerations | |
enum class | Traits { None = 0 , Picker = 1 , Internal = 2 , CMS = 4 } |
enum class | Unit { EightBit , Percent , Degree , Linear1024 , Chroma40 } |
enum class | Type { NONE , Gray , RGB , linearRGB , HSL , HSV , HWB , CMYK , CMY , XYZ , YXY , LUV , LCH , LAB , HSLUV , OKHSL , OKHSV , OKLCH , OKLAB , YCbCr , CSSNAME , CMS } |
Functions | |
static const std::vector< Components > | get_color_spaces () |
std::map< Type, Components > | _build (bool alpha) |
Traits | operator& (const Traits lhs, const Traits rhs) |
Traits | operator| (const Traits lhs, const Traits rhs) |
static float | hue_2_rgb (float v1, float v2, float h) |
static double | max_chroma_for_lh (double l, double h) |
Calculate the maximum in gamut chromaticity for the given luminance and hue. | |
double | from_linear (double c) |
Convenience function used for RGB conversions. | |
double | to_linear (double c) |
Convenience function used for RGB conversions. | |
static double | y2l (double y) |
Utility function used to convert from the XYZ colorspace to CIELuv. | |
static double | l2y (double l) |
Utility function used to convert from CIELuv colorspace to XYZ. | |
template<typename A1 , typename A2 > | |
constexpr double | dot3 (const A1 &a1, const A2 &a2) |
Compute the dot-product between two 3D-vectors. | |
static std::array< double, 4 > | component_coefficients (unsigned index, ConstraintMonomials const &m) |
Find the coefficients of the cubic polynomial expressing the linear R, G or B component as a function of OKLch chroma. | |
uint8_t const * | render_hue_scale (double s, double l, std::array< uint8_t, 4 *1024 > *map) |
uint8_t const * | render_saturation_scale (double h, double l, std::array< uint8_t, 4 *1024 > *map) |
uint8_t const * | render_lightness_scale (double h, double s, std::array< uint8_t, 4 *1024 > *map) |
static double | dot_product (std::vector< double > const &t1, std::vector< double > const &t2) |
Calculate the dot product of the given arrays. | |
Variables | |
static cmsUInt32Number | customSigOKLabData = 0x4f4b4c42 |
static std::map< cmsUInt32Number, Space::Type > | _lcmssig_to_space |
constexpr double | LUMA_SCALE = 100 |
constexpr double | MIN_SCALE = -128 |
constexpr double | MAX_SCALE = 128 |
constexpr double | MIN_CSS_SCALE = -125 |
constexpr double | MAX_CSS_SCALE = 125 |
constexpr double | CHROMA_SCALE = 150 |
constexpr double | HUE_SCALE = 360 |
constexpr double | REF_U = 0.19783000664283680764 |
constexpr double | REF_V = 0.46831999493879100370 |
constexpr double | MIN_U = -100 |
constexpr double | MAX_U = 200 |
constexpr double | MIN_V = -200 |
constexpr double | MAX_V = 120 |
constexpr double | KAPPA = 903.29629629629629629630 |
constexpr double | EPSILON = 0.00885645167903563082 |
Matrix | LRGB2CONE |
Matrix of the linear transformation from linear RGB space to linear cone responses, used in the first step of RGB to OKLab conversion. | |
Matrix | CONE2LRGB |
The inverse of the matrix LRGB2CONE. | |
Matrix | M2 |
The matrix M2 used in the second step of RGB to OKLab conversion. | |
Matrix | M2_INVERSE |
The inverse of the matrix M2. | |
ChromaLineCoefficients const | LAB_BOUNDS [] |
unsigned const | COLOR_SCALE_INTERVALS = 32 |
How many intervals a color scale should be subdivided into for the chroma bounds probing. | |
const std::vector< double > | illuminant_d65 = {0.9504, 1.0000, 1.0888} |
const std::vector< double > | d65 [3] |
const std::vector< double > | d65_inv [3] |
using Inkscape::Colors::Space::Matrix = typedef const double[3][3] |
|
strong |
Enumerator | |
---|---|
None | |
Picker | |
Internal | |
CMS |
Definition at line 26 of file components.h.
|
strong |
|
strong |
Enumerator | |
---|---|
EightBit | |
Percent | |
Degree | |
Linear1024 | |
Chroma40 |
Definition at line 42 of file components.h.
std::map< Type, Components > Inkscape::Colors::Space::_build | ( | bool | alpha | ) |
Definition at line 225 of file components.cpp.
References get_color_spaces(), index, key, Percent, and Inkscape::Colors::Space::Component::type.
Referenced by Inkscape::Colors::Space::Components::get().
|
static |
Find the coefficients of the cubic polynomial expressing the linear R, G or B component as a function of OKLch chroma.
The returned polynomial gives R(c), G(c) or B(c) for all values of c and fixed values of luminance and hue.
index | The index of the component to evaluate (0 for R, 1 for G, 2 for B). |
m | The monomials in L, cos(hue) and sin(hue) needed for the calculation. |
Definition at line 173 of file oklch.cpp.
References index, LAB_BOUNDS, and result.
Referenced by Inkscape::Colors::Space::OkLch::max_chroma().
|
inlineconstexpr |
Compute the dot-product between two 3D-vectors.
Definition at line 77 of file oklab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::fromLinearRGB(), and Inkscape::Colors::Space::OkLab::toLinearRGB().
|
static |
Calculate the dot product of the given arrays.
t1 | The first array. |
t2 | The second array. |
Definition at line 30 of file xyz.cpp.
Referenced by Inkscape::Colors::Space::XYZ::fromLinearRGB(), and Inkscape::Colors::Space::XYZ::toLinearRGB().
double Inkscape::Colors::Space::from_linear | ( | double | c | ) |
Convenience function used for RGB conversions.
c | Value. |
Definition at line 26 of file linear-rgb.cpp.
References c.
Referenced by Inkscape::Colors::Space::LinearRGB::toRGB().
|
static |
|
static |
Definition at line 19 of file hsl.cpp.
Referenced by Inkscape::Colors::Space::HSL::spaceToProfile().
|
static |
|
static |
Calculate the maximum in gamut chromaticity for the given luminance and hue.
l | Luminance. |
h | Hue. |
Definition at line 61 of file hsluv.cpp.
References Inkscape::Colors::Space::HSLuv::get_bounds(), and len.
Referenced by Inkscape::Colors::Space::HSLuv::fromLch(), and Inkscape::Colors::Space::HSLuv::toLch().
Definition at line 32 of file components.h.
Definition at line 36 of file components.h.
uint8_t const * Inkscape::Colors::Space::render_hue_scale | ( | double | s, |
double | l, | ||
std::array< uint8_t, 4 *1024 > * | map | ||
) |
Definition at line 265 of file oklch.cpp.
References c, COLOR_SCALE_INTERVALS, data, Geom::lerp(), Inkscape::Colors::Space::OkLch::max_chroma(), OKLCH, RGB, rgb, and SP_COLOR_F_TO_U().
uint8_t const * Inkscape::Colors::Space::render_lightness_scale | ( | double | h, |
double | s, | ||
std::array< uint8_t, 4 *1024 > * | map | ||
) |
Definition at line 324 of file oklch.cpp.
References c, COLOR_SCALE_INTERVALS, data, Geom::lerp(), Inkscape::Colors::Space::OkLch::max_chroma(), OKLCH, RGB, rgb, and SP_COLOR_F_TO_U().
uint8_t const * Inkscape::Colors::Space::render_saturation_scale | ( | double | h, |
double | l, | ||
std::array< uint8_t, 4 *1024 > * | map | ||
) |
Definition at line 296 of file oklch.cpp.
References c, data, Inkscape::Colors::Space::OkLch::max_chroma(), OKLCH, RGB, rgb, and SP_COLOR_F_TO_U().
double Inkscape::Colors::Space::to_linear | ( | double | c | ) |
Convenience function used for RGB conversions.
c | Value. |
Definition at line 41 of file linear-rgb.cpp.
References c.
Referenced by Inkscape::Colors::Space::LinearRGB::fromRGB().
|
static |
Utility function used to convert from the XYZ colorspace to CIELuv.
https://en.wikipedia.org/wiki/CIELUV
y | Y component of the XYZ color. |
Definition at line 73 of file luv.cpp.
References EPSILON, and KAPPA.
Referenced by Inkscape::Colors::Space::Luv::fromXYZ().
|
static |
|
constexpr |
Definition at line 24 of file lch.cpp.
Referenced by Inkscape::Colors::Space::Lch::Parser::parse(), Inkscape::Colors::Space::OkLch::Parser::parse(), Inkscape::Colors::Space::Lch::scaleDown(), Inkscape::Colors::Space::Lch::scaleUp(), Inkscape::Colors::Space::Lch::toString(), and Inkscape::Colors::Space::OkLch::toString().
unsigned const Inkscape::Colors::Space::COLOR_SCALE_INTERVALS = 32 |
How many intervals a color scale should be subdivided into for the chroma bounds probing.
The reason this constant exists is because probing chroma bounds requires solving 6 cubic equations, which would not be feasible for all 1024 pixels on a scale without slowing down the UI. To speed things up, we subdivide the scale into COLOR_SCALE_INTERVALS intervals and linearly interpolate the chroma bound on each interval. Note that the actual color interpolation is still done in the OKLab space, but the computed absolute chroma may be slightly off in the middle of each interval (hopefully, in an imperceptible way).
Definition at line 263 of file oklch.cpp.
Referenced by render_hue_scale(), and render_lightness_scale().
Matrix Inkscape::Colors::Space::CONE2LRGB |
The inverse of the matrix LRGB2CONE.
Definition at line 53 of file oklab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::toLinearRGB().
|
static |
|
inline |
Definition at line 23 of file xyz.h.
Referenced by Inkscape::Colors::Space::HSLuv::get_bounds(), and Inkscape::Colors::Space::XYZ::toLinearRGB().
|
inline |
Definition at line 27 of file xyz.h.
Referenced by Inkscape::Colors::Space::XYZ::fromLinearRGB().
|
constexpr |
Definition at line 20 of file luv.h.
Referenced by Inkscape::Colors::Space::HSLuv::get_bounds(), and y2l().
|
constexpr |
Definition at line 25 of file lch.cpp.
Referenced by Inkscape::Colors::Space::OkLch::fromOkLab(), Inkscape::Colors::Space::Lch::Parser::parse(), Inkscape::Colors::Space::OkLch::Parser::parse(), Inkscape::Colors::Space::Lch::scaleDown(), Inkscape::Colors::Space::Lch::scaleUp(), Inkscape::Colors::Space::OkLch::toOkLab(), Inkscape::Colors::Space::Lch::toString(), and Inkscape::Colors::Space::OkLch::toString().
|
inline |
Definition at line 20 of file xyz.h.
Referenced by Inkscape::Colors::Space::Lab::fromXYZ(), and Inkscape::Colors::Space::Lab::toXYZ().
|
constexpr |
Definition at line 19 of file luv.h.
Referenced by Inkscape::Colors::Space::HSLuv::get_bounds(), l2y(), and y2l().
ChromaLineCoefficients const Inkscape::Colors::Space::LAB_BOUNDS[] |
Definition at line 88 of file oklch.cpp.
Referenced by component_coefficients().
Matrix Inkscape::Colors::Space::LRGB2CONE |
Matrix of the linear transformation from linear RGB space to linear cone responses, used in the first step of RGB to OKLab conversion.
Definition at line 48 of file oklab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::fromLinearRGB().
|
constexpr |
Definition at line 20 of file lab.cpp.
Referenced by Inkscape::Colors::Space::Lab::Parser::parse(), Inkscape::Colors::Space::Lch::Parser::parse(), Inkscape::Colors::Space::Lab::scaleDown(), Inkscape::Colors::Space::Lch::scaleDown(), Inkscape::Colors::Space::Luv::scaleDown(), Inkscape::Colors::Space::Lab::scaleUp(), Inkscape::Colors::Space::Lch::scaleUp(), Inkscape::Colors::Space::Luv::scaleUp(), Inkscape::Colors::Space::Lab::toString(), and Inkscape::Colors::Space::Lch::toString().
Matrix Inkscape::Colors::Space::M2 |
The matrix M2 used in the second step of RGB to OKLab conversion.
Taken from https://bottosson.github.io/posts/oklab/ (retrieved 2022).
Definition at line 62 of file oklab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::fromLinearRGB().
Matrix Inkscape::Colors::Space::M2_INVERSE |
The inverse of the matrix M2.
The first column looks like it wants to be 1 but this form is closer to the actual inverse (due to numerics).
Definition at line 68 of file oklab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::toLinearRGB().
|
constexpr |
Definition at line 26 of file lab.cpp.
Referenced by Inkscape::Colors::Space::Lab::Parser::parse(), and Inkscape::Colors::Space::Lab::toString().
|
constexpr |
Definition at line 24 of file lab.cpp.
Referenced by Inkscape::Colors::Space::OkLab::Parser::parse(), Inkscape::Colors::Space::Lab::scaleDown(), Inkscape::Colors::Space::OkLab::scaleDown(), Inkscape::Colors::Space::Lab::scaleUp(), Inkscape::Colors::Space::OkLab::scaleUp(), and Inkscape::Colors::Space::OkLab::toString().
|
constexpr |
Definition at line 28 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::scaleDown(), and Inkscape::Colors::Space::Luv::scaleUp().
|
constexpr |
Definition at line 30 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::scaleDown(), and Inkscape::Colors::Space::Luv::scaleUp().
|
constexpr |
Definition at line 25 of file lab.cpp.
Referenced by Inkscape::Colors::Space::Lab::toString().
|
constexpr |
Definition at line 23 of file lab.cpp.
Referenced by Inkscape::Colors::Space::Lab::scaleDown(), Inkscape::Colors::Space::OkLab::scaleDown(), Inkscape::Colors::Space::Lab::scaleUp(), Inkscape::Colors::Space::OkLab::scaleUp(), and Inkscape::Colors::Space::OkLab::toString().
|
constexpr |
Definition at line 27 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::scaleDown(), and Inkscape::Colors::Space::Luv::scaleUp().
|
constexpr |
Definition at line 29 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::scaleDown(), and Inkscape::Colors::Space::Luv::scaleUp().
|
constexpr |
Definition at line 21 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::fromXYZ(), and Inkscape::Colors::Space::Luv::toXYZ().
|
constexpr |
Definition at line 22 of file luv.cpp.
Referenced by Inkscape::Colors::Space::Luv::fromXYZ(), and Inkscape::Colors::Space::Luv::toXYZ().