Blender V5.0
white_point.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "white_point.hh"
6
7#include "BLI_math_color.hh"
8#include "BLI_math_matrix.hh"
9
10#include "OCIO_config.hh"
11
12namespace blender::ocio {
13
15 const float temperature,
16 const float tint)
17{
18 /* Compute white point of the scene space in XYZ. */
19 const float3x3 xyz_to_scene = config.get_xyz_to_scene_linear_matrix();
20 const float3x3 scene_to_xyz = math::invert(xyz_to_scene);
21 const float3 target = scene_to_xyz * float3(1.0f);
22
23 /* Add operations to the matrix.
24 * Note: Since we're multiplying from the right, the operations here will be performed in
25 * reverse list order (scene-to-XYZ, then adaption, then XYZ-to-scene, then exposure). */
26 float3x3 matrix = xyz_to_scene;
28 target);
29 matrix *= scene_to_xyz;
30
31 return matrix;
32}
33
34} // namespace blender::ocio
virtual float3x3 get_xyz_to_scene_linear_matrix() const =0
float3 whitepoint_from_temp_tint(float temperature, float tint)
CartesianBasis invert(const CartesianBasis &basis)
float3x3 chromatic_adaption_matrix(const float3 &from_XYZ, const float3 &to_XYZ)
float3x3 calculate_white_point_matrix(const Config &config, const float temperature, const float tint)
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3