aest 0.1.0
Collection of C++ utility libraries
Loading...
Searching...
No Matches
CieLab.cppm File Reference

Partition aest.colors:cie_lab: the CIE 1976 L*a*b* space and its polar form, relative to D50 as in CSS Color 4. More...

#include <cmath>
#include <string_view>
import aest.colors:gamut;
import aest.blas;

Go to the source code of this file.

Classes

class  aest::colors::CIELab
 A color in CIELab, the CIE 1976 L*a*b* space, relative to D50. More...
class  aest::colors::CIELCH
 A color in CIELCH: CIELab in polar form, as lightness, chroma and hue. More...
struct  aest::colors::ParentSpace< CIELab >
 CIELab converts through XYZ, adapted to its D50 white. More...
struct  aest::colors::ParentSpace< CIELCH >
 CIELCH converts through CIELab, of which it is the polar form. More...
struct  aest::colors::Converter< CIELab, XYZ >
 Converts XYZ to CIELab. More...
struct  aest::colors::Converter< XYZ, CIELab >
 Converts CIELab to XYZ. More...
struct  aest::colors::Converter< CIELCH, CIELab >
 Converts CIELab to CIELCH, its polar form. More...
struct  aest::colors::Converter< CIELab, CIELCH >
 Converts CIELCH to CIELab. More...

Functions

double aest::colors::lab_compress (const double ratio)
 The CIELab compression of a ratio to the white: a cube root, with a line near black.
constexpr double aest::colors::lab_expand (const double value)
 Inverse of lab_compress() for the X and Z ratios.

Variables

constexpr Matrix3 aest::colors::D50_TO_D65 = bradford_to_d65(D50)
 Matrix adapting XYZ, D50, to XYZ, D65, with the Bradford transform.
constexpr Matrix3 aest::colors::D65_TO_D50 = blas::inverse(D50_TO_D65)
 Matrix adapting XYZ, D65, to XYZ, D50, with the Bradford transform.
constexpr Vector3 aest::colors::D50_WHITE = xyz_of(D50)
 XYZ of the D50 white at luminance Y = 1, the reference white of CIELab.
constexpr double aest::colors::LAB_EPSILON = 216.0 / 24389.0
 CIE ε, 216 / 24389: below it, CIELab follows a line instead of the cube root.
constexpr double aest::colors::LAB_KAPPA = 24389.0 / 27.0
 CIE κ, 24389 / 27: the slope of the line near black.

Detailed Description

Partition aest.colors:cie_lab: the CIE 1976 L*a*b* space and its polar form, relative to D50 as in CSS Color 4.

Author
Davide Pierotti

Definition in file CieLab.cppm.

Function Documentation

◆ lab_compress()

double aest::colors::lab_compress ( const double ratio)

The CIELab compression of a ratio to the white: a cube root, with a line near black.

Parameters
[in]ratioA tristimulus value divided by the one of the white
Returns
cbrt(ratio) above LAB_EPSILON, (κ * ratio + 16) / 116 below.
Note
Not constexpr: std::cbrt is constexpr only since C++26.

Definition at line 42 of file CieLab.cppm.

◆ lab_expand()

double aest::colors::lab_expand ( const double value)
constexpr

Inverse of lab_compress() for the X and Z ratios.

Parameters
[in]valueThe compressed value
Returns
The ratio to the white: the cube of value above the cube root of LAB_EPSILON, (116 * value - 16) / κ below.

Definition at line 53 of file CieLab.cppm.

Variable Documentation

◆ D50_TO_D65

Matrix3 aest::colors::D50_TO_D65 = bradford_to_d65(D50)
constexpr

Matrix adapting XYZ, D50, to XYZ, D65, with the Bradford transform.

Definition at line 21 of file CieLab.cppm.

◆ D50_WHITE

Vector3 aest::colors::D50_WHITE = xyz_of(D50)
constexpr

XYZ of the D50 white at luminance Y = 1, the reference white of CIELab.

Definition at line 27 of file CieLab.cppm.

◆ D65_TO_D50

Matrix3 aest::colors::D65_TO_D50 = blas::inverse(D50_TO_D65)
constexpr

Matrix adapting XYZ, D65, to XYZ, D50, with the Bradford transform.

Definition at line 24 of file CieLab.cppm.

◆ LAB_EPSILON

double aest::colors::LAB_EPSILON = 216.0 / 24389.0
constexpr

CIE ε, 216 / 24389: below it, CIELab follows a line instead of the cube root.

Definition at line 30 of file CieLab.cppm.

◆ LAB_KAPPA

double aest::colors::LAB_KAPPA = 24389.0 / 27.0
constexpr

CIE κ, 24389 / 27: the slope of the line near black.

Definition at line 33 of file CieLab.cppm.