2 #include <color/color.hpp>
3 #include <color/colorable.hpp>
4 #include <color/spd.hpp>
5 #include <color/specutils.hpp>
8 #include <math3d/vec3.hpp>
10 using namespace ptracey;
15 SpectrumType type = SpectrumType::RGB;
24 const path &path_to_csv,
25 const std::string &wave_col_name,
26 const std::string &power_col_name,
27 const char &sep =
',',
const uint stride = SPD_STRIDE,
28 SpectrumType stype = SpectrumType::Reflectance) {
29 spd csv_spect =
spd(path_to_csv, wave_col_name,
30 power_col_name, sep, stride);
32 get_cie_values(csv_spect, xyz);
33 vec3 rgb = xyz2rgb_cie(xyz);
38 vec3 to_xyz()
const override {
39 return rgb2xyz_cie(
vec3(x(), y(), z()));
41 vec3 to_vec3()
const {
return vec3(x(), y(), z()); }
42 vec3 to_rgb()
const override {
43 return vec3(x(), y(), z());
45 vec3 evaluate(
const WaveLength &w)
const {
46 return vec3(x(), y(), z());
48 void add(
const color &c,
const WaveLength &w) {
54 auto ps = to_vec3() * coeff;
58 void scale(Real coeff) {