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

Partition aest.colors:oklab: the perceptual spaces OKLab and OKLCH by Björn Ottosson. More...

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

Go to the source code of this file.

Classes

class  aest::colors::OKLab
 A color in OKLab, the perceptual space by Björn Ottosson. More...
class  aest::colors::OKLCH
 A color in OKLCH: OKLab in polar form, as lightness, chroma and hue. More...
struct  aest::colors::ParentSpace< OKLab >
 OKLab converts through XYZ, by way of the LMS cone responses. More...
struct  aest::colors::ParentSpace< OKLCH >
 OKLCH converts through OKLab, of which it is the polar form. More...
struct  aest::colors::Converter< OKLab, XYZ >
 Converts XYZ to OKLab. More...
struct  aest::colors::Converter< XYZ, OKLab >
 Converts OKLab to XYZ. More...
struct  aest::colors::Converter< OKLCH, OKLab >
 Converts OKLab to OKLCH, its polar form. More...
struct  aest::colors::Converter< OKLab, OKLCH >
 Converts OKLCH to OKLab. More...

Variables

constexpr Matrix3 aest::colors::XYZ_TO_LMS
 Matrix from XYZ, D65, to the LMS cone responses of OKLab, as recomputed by CSS Color 4 so that D65 white has no chroma.
constexpr Matrix3 aest::colors::LMS_TO_OKLAB
 Matrix from the cube roots of LMS to OKLab, from CSS Color 4.
constexpr Matrix3 aest::colors::LMS_TO_XYZ = blas::inverse(XYZ_TO_LMS)
 Matrix from LMS back to XYZ, D65.
constexpr Matrix3 aest::colors::OKLAB_TO_LMS = blas::inverse(LMS_TO_OKLAB)
 Matrix from OKLab back to the cube roots of LMS.

Detailed Description

Partition aest.colors:oklab: the perceptual spaces OKLab and OKLCH by Björn Ottosson.

Author
Davide Pierotti

Definition in file OkLab.cppm.

Variable Documentation

◆ LMS_TO_OKLAB

Matrix3 aest::colors::LMS_TO_OKLAB
constexpr
Initial value:
= {{
{0.2104542683093140, 0.7936177747023054, -0.0040720430116193},
{1.9779985324311684, -2.4285922420485799, 0.4505937096174110},
{0.0259040424655478, 0.7827717124575296, -0.8086757549230774},
}}

Matrix from the cube roots of LMS to OKLab, from CSS Color 4.

Definition at line 32 of file OkLab.cppm.

◆ LMS_TO_XYZ

Matrix3 aest::colors::LMS_TO_XYZ = blas::inverse(XYZ_TO_LMS)
constexpr

Matrix from LMS back to XYZ, D65.

Definition at line 39 of file OkLab.cppm.

◆ OKLAB_TO_LMS

Matrix3 aest::colors::OKLAB_TO_LMS = blas::inverse(LMS_TO_OKLAB)
constexpr

Matrix from OKLab back to the cube roots of LMS.

Definition at line 42 of file OkLab.cppm.

◆ XYZ_TO_LMS

Matrix3 aest::colors::XYZ_TO_LMS
constexpr
Initial value:
= {{
{0.8190224379967030, 0.3619062600528904, -0.1288737815209879},
{0.0329836539323885, 0.9292868615863434, 0.0361446663506424},
{0.0481771893596242, 0.2642395317527308, 0.6335478284694309},
}}

Matrix from XYZ, D65, to the LMS cone responses of OKLab, as recomputed by CSS Color 4 so that D65 white has no chroma.

Definition at line 25 of file OkLab.cppm.