|
aest 0.1.0
Collection of C++ utility libraries
|
Partition aest.colors:distance: distance metrics between colors, Euclidean and the CIE color difference formulas. More...
Go to the source code of this file.
Classes | |
| struct | aest::colors::Euclidean< BasicRGB< Gamut, Transfer > > |
| Euclidean distance in an RGB space: between the encoded values of encoded spaces, between the light of linear ones. More... | |
| struct | aest::colors::Euclidean< OKLab > |
| Euclidean distance in OKLab: ΔE_OK, the color difference of CSS Color 4, where equal distances look about equally different. More... | |
| struct | aest::colors::Euclidean< CIELab > |
| Euclidean distance in CIELab: ΔE*ab, the CIE 1976 color difference that de_76() measures. More... | |
Concepts | |
| concept | aest::colors::EuclideanSpace |
| A color space in which euclidean() can measure distances through Euclidean. | |
Enumerations | |
| enum class | aest::colors::CIE94Application : std::uint8_t { graphic_arts , textiles } |
| The application whose weights de_94() uses, as CIE 116-1995 defines them. More... | |
Functions | |
| template<ColorType Space> | |
| float | aest::colors::channel_distance (const Space &color1, const Space &color2) |
| Euclidean distance between the three channels of two colors, ignoring alpha. | |
| template<EuclideanSpace Space = OKLab, ColorType Color1, ColorType Color2> requires ConvertibleTo<Space, Color1> && ConvertibleTo<Space, Color2> | |
| float | aest::colors::euclidean (const Color1 &color1, const Color2 &color2, In< Space > space={}) |
| Euclidean distance between two colors. | |
| template<ColorType Color1, ColorType Color2> requires ConvertibleTo<CIELab, Color1> && ConvertibleTo<CIELab, Color2> | |
| float | aest::colors::de_76 (const Color1 &color1, const Color2 &color2) |
| The CIE 1976 color difference ΔE*ab: the Euclidean distance in CIELab. | |
| template<ColorType Color1, ColorType Color2> requires ConvertibleTo<CIELab, Color1> && ConvertibleTo<CIELab, Color2> | |
| float | aest::colors::de_94 (const Color1 &reference, const Color2 &sample, const CIE94Application application=CIE94Application::graphic_arts) |
| The CIE 1994 color difference ΔE*94. | |
| double | aest::colors::ciede2000_hue (const double a, const double b) |
| Hue angle of a CIEDE2000 a', b' pair. | |
| double | aest::colors::ciede2000_chroma_weight (const double chroma) |
| The CIEDE2000 chroma weight sqrt(C^7 / (C^7 + 25^7)). | |
| template<ColorType Color1, ColorType Color2> requires ConvertibleTo<CIELab, Color1> && ConvertibleTo<CIELab, Color2> | |
| float | aest::colors::de_2000 (const Color1 &color1, const Color2 &color2) |
| The CIEDE2000 color difference ΔE00, the current CIE formula. | |
Partition aest.colors:distance: distance metrics between colors, Euclidean and the CIE color difference formulas.
Definition in file Distance.cppm.
|
exportstrong |
The application whose weights de_94() uses, as CIE 116-1995 defines them.
| Enumerator | |
|---|---|
| graphic_arts | kL = 1, K1 = 0.045, K2 = 0.015: images, prints and screens. |
| textiles | kL = 2, K1 = 0.048, K2 = 0.014: lightness counts half as much. |
Definition at line 178 of file Distance.cppm.
| float aest::colors::channel_distance | ( | const Space & | color1, |
| const Space & | color2 ) |
Euclidean distance between the three channels of two colors, ignoring alpha.
| Space | A color space whose channels form Cartesian coordinates |
| [in] | color1 | First color |
| [in] | color2 | Second color |
Definition at line 33 of file Distance.cppm.
| double aest::colors::ciede2000_chroma_weight | ( | const double | chroma | ) |
The CIEDE2000 chroma weight sqrt(C^7 / (C^7 + 25^7)).
| [in] | chroma | A mean chroma |
Definition at line 250 of file Distance.cppm.
| double aest::colors::ciede2000_hue | ( | const double | a, |
| const double | b ) |
Hue angle of a CIEDE2000 a', b' pair.
| [in] | a | The a' channel, a* rescaled by CIEDE2000 |
| [in] | b | The b* channel |
Definition at line 237 of file Distance.cppm.
|
export |
The CIEDE2000 color difference ΔE00, the current CIE formula.
It refines de_94() to follow the eye more closely: it rescales a* so that grays are judged evenly, weights lightness by its distance from the mid-gray, weights hue by the hue itself, and rotates the chroma and hue differences against each other around blue, where CIELab is least even. Unlike de_94(), it is symmetric. The parametric factors kL, kC and kH are all 1, the CIE reference conditions. This follows CIE 142-2001, with the hue rules that Sharma, Wu and Dalal (2005) made exact.
| Color1 | Color type of color1 |
| Color2 | Color type of color2 |
| [in] | color1 | First color |
| [in] | color2 | Second color |
Definition at line 279 of file Distance.cppm.
|
export |
The CIE 1976 color difference ΔE*ab: the Euclidean distance in CIELab.
The first CIE formula and the simplest: it overstates differences between saturated colors, which de_94() and de_2000() correct. It is euclidean<CIELab>(color1, color2).
| Color1 | Color type of color1 |
| Color2 | Color type of color2 |
| [in] | color1 | First color |
| [in] | color2 | Second color |
Definition at line 169 of file Distance.cppm.
|
export |
The CIE 1994 color difference ΔE*94.
It weights the differences in lightness, chroma and hue of CIELCH: the chroma and hue differences count less as the chroma of reference grows, where the eye tells them apart less. The weights depend on reference alone, so the formula is not symmetric: swapping the colors gives another result unless their chromas are equal.
| Color1 | Color type of reference |
| Color2 | Color type of sample |
| [in] | reference | The reference color, whose chroma sets the weights |
| [in] | sample | The color compared to reference |
| [in] | application | The weights to use, those for graphic arts by default |
Definition at line 202 of file Distance.cppm.
|
export |
Euclidean distance between two colors.
Both colors are converted to Space and the distance between their channels is measured there, ignoring alpha. The default, OKLab, gives ΔE_OK, where equal distances look about equally different; euclidean<SRGB>(color1, color2) measures the encoded values, and euclidean<LinSRGB>(color1, color2) the difference in light.
| Space | The color space the distance is measured in |
| Color1 | Color type of color1 |
| Color2 | Color type of color2 |
| [in] | color1 | First color |
| [in] | color2 | Second color |
| [in] | space | The working space, e.g. in<LinSRGB>; OKLab when omitted |
Definition at line 147 of file Distance.cppm.