/*
5 * 2015 Alexei Boronine (
original idea, JavaScript implementation)
6 * 2015 Roger Tallada (Obj-C implementation)
7 * 2017 Martin Mitas (C implementation, based on Obj-C implementation)
8 * 2021 Massinissa Derriche (C++ implementation
for Inkscape, based on C implementation)
9 * 2023 Martin Owens (New
Color classes)
11 * Copyright (C) 2023 Authors
12 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
30static double dot_product(std::vector<double>
const &t1, std::vector<double>
const &t2)
32 return (t1[0] * t2[0] + t1[1] * t2[1] + t1[2] * t2[2]);
42 std::vector<double>
result = in_out;
43 for (
size_t i : {0, 1, 2}) {
56 std::vector<double>
result = in_out;
57 for (
size_t i : {0, 1, 2}) {
69std::string
XYZ::toString(std::vector<double>
const &values,
bool opacity)
const
73 if (opacity && values.size() == 4)
static void fromLinearRGB(std::vector< double > &output)
Convert from sRGB icc values to XYZ values.
std::string toString(std::vector< double > const &values, bool opacity=true) const override
Print the RGB color to a CSS Color module 4 xyz-d65 color.
static void toLinearRGB(std::vector< double > &output)
Convert a color from the the XYZ colorspace to the RGB colorspace.
const std::vector< double > d65_inv[3]
static double dot_product(std::vector< double > const &t1, std::vector< double > const &t2)
Calculate the dot product of the given arrays.
const std::vector< double > d65[3]
Helper class to stream background task notifications as a series of messages.