Blender V5.3
libocio_display_processor.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 <cfloat>
6#include <optional>
7#include <sstream>
8
9#include "BLI_colorspace.hh"
10#include "BLI_math_matrix.hh"
11
12#include "OCIO_config.hh"
13#include "OCIO_matrix.hh"
14#include "OCIO_view.hh"
15
16#include "error_handling.hh"
17#include "libocio_config.hh"
18#include "libocio_display.hh"
20
21#include "../white_point.hh"
22
23#include "CLG_log.h"
24
25namespace blender::ocio {
26
27static CLG_LogRef LOG = {"color_management"};
28
30 const bool use_hdr_buffer)
31{
32#ifdef __APPLE__
33 /* The Metal backend always uses sRGB or extended sRGB buffer.
34 *
35 * How this will be decoded depends on the macOS display preset, but from testing
36 * on a MacBook P3 M3 it appears:
37 * - Apple XDR Display (P3 - 1600 nits): Decode with gamma 2.2
38 * - HDR Video (P3-ST 2084): Decode with sRGB. As we encode with the sRGB transfer
39 * function, this will be cancelled out, and linear values will be passed on
40 * effectively unmodified.
41 */
42 UNUSED_VARS(use_hdr_buffer, view);
44#elif defined(_WIN32)
45 /* The Vulkan backend uses either sRGB for SDR, or linear extended sRGB for HDR.
46 *
47 * - Windows HDR mode off: use_hdr_buffer will be false, and we encode with sRGB.
48 * By default Windows will decode with gamma 2.2.
49 * - Windows HDR mode on: use_hdr_buffer will be true, and we encode with sRGB.
50 * The Vulkan HDR swapchain blitting will decode with sRGB to cancel this out
51 * exactly, meaning we effectively pass on linear values unmodified.
52 *
53 * Note this means that both the user interface and SDR content will not be
54 * displayed the same in HDR mode off and on. However it is consistent with other
55 * software. To match, gamma 2.2 would have to be used.
56 */
57 UNUSED_VARS(use_hdr_buffer, view);
59#else
60 /* The Vulkan backend uses either sRGB for SDR, or linear extended sRGB for HDR.
61 *
62 * - When using a HDR swapchain and the display + view is HDR, ensure we pass on
63 * values linearly by doing gamma 2.2 encode here + gamma 2.2 decode in the
64 * Vulkan HDR swapchain blitting.
65 * - When using HDR swapain and the display + view is SDR, use sRGB encode to
66 * emulate what happens on a typical SDR monitor.
67 * - When using an SDR swapchain, the buffer is always sRGB.
68 */
69 return (use_hdr_buffer && view && view->is_hdr()) ? TransferFunction::Gamma22 :
71#endif
72}
73
74static OCIO_NAMESPACE::TransformRcPtr create_extended_srgb_transform(
75 const TransferFunction transfer_function)
76{
77 if (transfer_function == TransferFunction::sRGB) {
78 /* Piecewise sRGB transfer function. */
79 auto to_ui = OCIO_NAMESPACE::ExponentWithLinearTransform::Create();
80 to_ui->setGamma({2.4, 2.4, 2.4, 1.0});
81 to_ui->setOffset({0.055, 0.055, 0.055, 0.0});
82 /* Mirrored for negative as specified by scRGB and extended sRGB. */
83 to_ui->setNegativeStyle(OCIO_NAMESPACE::NEGATIVE_MIRROR);
84 to_ui->setDirection(OCIO_NAMESPACE::TRANSFORM_DIR_INVERSE);
85 return to_ui;
86 }
87
88 /* Pure gamma 2.2 function. */
89 auto to_ui = OCIO_NAMESPACE::ExponentTransform::Create();
90 to_ui->setValue({2.2, 2.2, 2.2, 1.0});
91 /* Mirrored for negative as specified by scRGB and extended sRGB. */
92 to_ui->setNegativeStyle(OCIO_NAMESPACE::NEGATIVE_MIRROR);
93 to_ui->setDirection(OCIO_NAMESPACE::TRANSFORM_DIR_INVERSE);
94 return to_ui;
95}
96
97static void adjust_for_hdr_image_file(const LibOCIOConfig &config,
98 OCIO_NAMESPACE::GroupTransformRcPtr &group,
99 StringRefNull display_name,
100 StringRefNull view_name)
101{
102 /* Convert HDR PQ and HLG images from 100 nits to 203 nits convention. */
103 const LibOCIODisplay *display = static_cast<const LibOCIODisplay *>(
104 config.get_display_by_name(display_name));
105 const LibOCIOView *view = (display) ? static_cast<const LibOCIOView *>(
106 display->get_view_by_name(view_name)) :
107 nullptr;
108 const LibOCIOColorSpace *display_colorspace = static_cast<const LibOCIOColorSpace *>(
109 view->display_colorspace());
110
111 if (display_colorspace == nullptr || !display_colorspace->is_display_referred()) {
112 return;
113 }
114
115 const ColorSpace *image_display_colorspace = config.get_color_space_for_hdr_image(
116 display_colorspace->name());
117 if (ELEM(image_display_colorspace, nullptr, display_colorspace)) {
118 return;
119 }
120
121 auto to_display_linear = OCIO_NAMESPACE::ColorSpaceTransform::Create();
122 to_display_linear->setSrc(display_colorspace->name().c_str());
123 to_display_linear->setDst(image_display_colorspace->name().c_str());
124 group->appendTransform(to_display_linear);
125}
126
127static void display_as_scope_space(const LibOCIOConfig &config,
128 OCIO_NAMESPACE::GroupTransformRcPtr &group,
129 StringRefNull display_name,
130 StringRefNull view_name)
131{
132 /* Convert display-encoded values to a normalized space for scopes,
133 * going from display space to display interchange to scope space. */
134 const LibOCIODisplay *display = static_cast<const LibOCIODisplay *>(
135 config.get_display_by_name(display_name));
136 const LibOCIOView *view = (display) ? static_cast<const LibOCIOView *>(
137 display->get_view_by_name(view_name)) :
138 nullptr;
139 if (view == nullptr) {
140 CLOG_WARN(&LOG,
141 "Unable to find display '%s' and view '%s', scope space not applied",
142 display_name.c_str(),
143 view_name.c_str());
144 return;
145 }
146
147 const LibOCIOColorSpace *display_colorspace = static_cast<const LibOCIOColorSpace *>(
148 view->display_colorspace());
149 if (display_colorspace == nullptr ||
150 !(display_colorspace->is_display_referred() || display_colorspace->is_data()))
151 {
153 "No display colorspace for view '%s', scope space normalization not applied",
154 view_name.c_str());
155 return;
156 }
157
158 const LibOCIOColorSpace *lin_cie_xyz_d65 = static_cast<const LibOCIOColorSpace *>(
159 config.get_color_space(OCIO_NAMESPACE::ROLE_INTERCHANGE_DISPLAY));
160
161 if (lin_cie_xyz_d65 == nullptr) {
163 "Failed to find %s colorspace, scope space normalization not applied",
164 OCIO_NAMESPACE::ROLE_INTERCHANGE_DISPLAY);
165 return;
166 }
167
168 view->append_scope_space_transforms(group, lin_cie_xyz_d65->name());
169}
170
171static void display_as_extended_srgb(const LibOCIOConfig &config,
172 OCIO_NAMESPACE::GroupTransformRcPtr &group,
173 StringRefNull display_name,
174 StringRefNull view_name,
175 const bool use_hdr_buffer)
176{
177 /* Emulate the user specified display on an extended sRGB display, conceptually:
178 * - Apply the view and display transform
179 * - Clamp colors to be within gamut
180 * - Convert to cie_xyz_d65_interchange
181 * - Convert to extended sRGB or gamma 2.2 scRGB
182 *
183 * When possible, we do equivalent but faster transforms. */
184
185 /* TODO: Optimization: Often the view transform will already clamp. Maybe we can have a
186 * few hardcoded checks for known view transforms? This helps eliminate a clamp and
187 * in some cases a matrix multiplication. */
188
189 const LibOCIODisplay *display = static_cast<const LibOCIODisplay *>(
190 config.get_display_by_name(display_name));
191 const LibOCIOView *view = (display) ? static_cast<const LibOCIOView *>(
192 display->get_view_by_name(view_name)) :
193 nullptr;
194 if (view == nullptr) {
195 CLOG_WARN(&LOG,
196 "Unable to find display '%s' and view '%s', display may be incorrect",
197 display_name.c_str(),
198 view_name.c_str());
199 return;
200 }
201
202 const TransferFunction target_transfer_function = system_extended_srgb_transfer_function(
203 view, use_hdr_buffer);
204
205 /* If we are already in the desired display colorspace, all we have to do is clamp. */
206 if ((view->transfer_function() == target_transfer_function ||
208 target_transfer_function == TransferFunction::sRGB)) &&
209 view->gamut() == Gamut::Rec709)
210 {
211 auto clamp = OCIO_NAMESPACE::RangeTransform::Create();
212 clamp->setStyle(OCIO_NAMESPACE::RANGE_CLAMP);
213 clamp->setMinInValue(0.0);
214 clamp->setMinOutValue(0.0);
216 clamp->setMaxInValue(1.0);
217 clamp->setMaxOutValue(1.0);
218 }
219 group->appendTransform(clamp);
220 return;
221 }
222
223 const LibOCIOColorSpace *lin_cie_xyz_d65 = static_cast<const LibOCIOColorSpace *>(
224 config.get_color_space(OCIO_NAMESPACE::ROLE_INTERCHANGE_DISPLAY));
225 const LibOCIOColorSpace *display_colorspace = static_cast<const LibOCIOColorSpace *>(
226 view->display_colorspace());
227
228 /* Verify if all conditions are met to do automatic display color management. */
229 if (lin_cie_xyz_d65 == nullptr) {
231 "Failed to find %s colorspace, disabling automatic display color management",
232 OCIO_NAMESPACE::ROLE_INTERCHANGE_DISPLAY);
233 return;
234 }
235 if (display_colorspace == nullptr) {
237 "Failed to find display colorspace for view %s, disabling automatic display color "
238 "management",
239 view_name.c_str());
240 return;
241 }
242 if (!display_colorspace->is_display_referred()) {
244 "Color space %s is not a display color space, disabling automatic display color "
245 "management",
246 display_colorspace->name().c_str());
247
248 if (!display->is_hdr()) {
249 /* This avoids it being blindingly bright on HDR monitor when selecting SDR,
250 * and also avoids the display doing any kind of misleading HDR tone mapping.
251 * For HDR we do not clamp as that is sometimes used for custom view/display
252 * transforms defined in the compositor. */
253 auto clamp = OCIO_NAMESPACE::RangeTransform::Create();
254 clamp->setStyle(OCIO_NAMESPACE::RANGE_CLAMP);
255 clamp->setMinInValue(0.0);
256 clamp->setMinOutValue(0.0);
257 clamp->setMaxInValue(1.0);
258 clamp->setMaxOutValue(1.0);
259 group->appendTransform(clamp);
260 }
261 return;
262 }
263
264 /* Find the matrix to convert to linear colorspace with gamut of the display colorspace. */
265 std::optional<double4x4> xyz_to_display_gamut;
266 switch (view->gamut()) {
267 case Gamut::Rec709: {
268 xyz_to_display_gamut = OCIO_XYZ_TO_REC709;
269 break;
270 }
271 case Gamut::P3D65: {
272 xyz_to_display_gamut = OCIO_XYZ_TO_P3;
273 break;
274 }
275 case Gamut::Rec2020: {
276 xyz_to_display_gamut = OCIO_XYZ_TO_REC2020;
277 break;
278 }
279 case Gamut::Unknown: {
280 break;
281 }
282 }
283
284 if (xyz_to_display_gamut.has_value() && view->transfer_function() != TransferFunction::Unknown) {
285 /* Optimized path for known gamut and transfer function. We want OpenColorIO to cancel out
286 * out the transfer function of the chosen display, but this is not possible when clamping
287 * happens in the middle of it.
288 *
289 * So here we transform to the linear colorspace with the gamut of the display colorspace,
290 * and clamp there. This means there will be only matrix multiplications, or nothing at
291 * all for Rec.709. */
292 auto to_cie_xyz_d65 = OCIO_NAMESPACE::ColorSpaceTransform::Create();
293 to_cie_xyz_d65->setSrc(display_colorspace->name().c_str());
294 to_cie_xyz_d65->setDst(lin_cie_xyz_d65->name().c_str());
295 group->appendTransform(to_cie_xyz_d65);
296
297 auto to_lin_gamut = OCIO_NAMESPACE::MatrixTransform::Create();
298 to_lin_gamut->setMatrix(math::transpose(xyz_to_display_gamut.value()).base_ptr());
299 group->appendTransform(to_lin_gamut);
300
301 /* Clamp colors to the chosen display colorspace, to emulate it on the actual display that
302 * may have a wider gamut or HDR. */
303 double clamp_max = 0.0;
304 switch (view->transfer_function()) {
310 clamp_max = 1.0;
311 break;
313 clamp_max = 100.0; /* 10000 peak nits / 100 nits. */
314 break;
316 clamp_max = 10.0; /* 1000 peak nits / 100 nits. */
317 break;
319 clamp_max = DBL_MAX; /* Allow HDR > 1.0. */
320 break;
322 break;
323 }
324
325 auto clamp = OCIO_NAMESPACE::RangeTransform::Create();
326 clamp->setStyle(OCIO_NAMESPACE::RANGE_CLAMP);
327 clamp->setMinInValue(0.0);
328 clamp->setMinOutValue(0.0);
329 if (clamp_max != DBL_MAX) {
330 clamp->setMaxInValue(clamp_max);
331 clamp->setMaxOutValue(clamp_max);
332 }
333 group->appendTransform(clamp);
334
335 /* Transform to linear Rec.709. */
336 if (view->gamut() != Gamut::Rec709) {
337 auto to_rec709 = OCIO_NAMESPACE::MatrixTransform::Create();
338 to_rec709->setMatrix(
339 math::transpose(OCIO_XYZ_TO_REC709 * math::invert(xyz_to_display_gamut.value()))
340 .base_ptr());
341 group->appendTransform(to_rec709);
342 }
343 }
344 else {
345 /* Clamp colors to the chosen display colorspace, to emulate it on the actual display that
346 * may have a wider gamut or HDR. Only do it for transfer functions where we know it's
347 * correct, if unknown we hope the view transform already did it. */
349 auto clamp = OCIO_NAMESPACE::RangeTransform::Create();
350 clamp->setStyle(OCIO_NAMESPACE::RANGE_CLAMP);
351 clamp->setMinInValue(0.0);
352 clamp->setMinOutValue(0.0);
354 clamp->setMaxInValue(1.0);
355 clamp->setMaxOutValue(1.0);
356 }
357 group->appendTransform(clamp);
358 }
359
360 /* Convert from display colorspace to linear Rec.709. */
361 auto to_cie_xyz_d65 = OCIO_NAMESPACE::ColorSpaceTransform::Create();
362 to_cie_xyz_d65->setSrc(display_colorspace->name().c_str());
363 to_cie_xyz_d65->setDst(lin_cie_xyz_d65->name().c_str());
364 group->appendTransform(to_cie_xyz_d65);
365
366 auto to_rec709 = OCIO_NAMESPACE::MatrixTransform::Create();
367 to_rec709->setMatrix(math::transpose(OCIO_XYZ_TO_REC709).base_ptr());
368 group->appendTransform(to_rec709);
369 }
370
371 group->appendTransform(create_extended_srgb_transform(target_transfer_function));
372}
373
374OCIO_NAMESPACE::TransformRcPtr create_ocio_display_transform(
375 const OCIO_NAMESPACE::ConstConfigRcPtr &ocio_config,
376 StringRefNull display,
377 StringRefNull view,
378 StringRefNull look,
379 StringRefNull from_colorspace)
380{
381 OCIO_NAMESPACE::GroupTransformRcPtr group = OCIO_NAMESPACE::GroupTransform::Create();
382
383 /* Add look transform. */
384 bool use_look = (look != nullptr && look[0] != '\0' && look != "None");
385 if (use_look) {
386 const char *look_output = nullptr;
387
388 try {
389 look_output = OCIO_NAMESPACE::LookTransform::GetLooksResultColorSpace(
390 ocio_config, ocio_config->getCurrentContext(), look.c_str());
391 }
392 catch (OCIO_NAMESPACE::Exception &exception) {
393 report_exception(exception);
394 return nullptr;
395 }
396
397 if (look_output != nullptr && look_output[0] != 0) {
398 OCIO_NAMESPACE::LookTransformRcPtr lt = OCIO_NAMESPACE::LookTransform::Create();
399 lt->setSrc(from_colorspace.c_str());
400
401 /* For raw view transform, transform to look colorspace is a no-op since it's data.
402 * But OpenColorIO only takes that into account in one direction, and still applies
403 * a conversion in the other direction. Work around that by ensuring it is skipped
404 * entirely. */
405 const char *view_colorspace_name = ocio_config->getDisplayViewColorSpaceName(display.c_str(),
406 view.c_str());
407 OCIO_NAMESPACE::ConstColorSpaceRcPtr view_colorspace = (view_colorspace_name) ?
408 ocio_config->getColorSpace(
409 view_colorspace_name) :
410 nullptr;
411
412 if (view_colorspace && view_colorspace->isData()) {
413 lt->setDst(from_colorspace.c_str());
414 }
415 else {
416 lt->setDst(look_output);
417 /* Make further transforms aware of the color space change. */
418 from_colorspace = look_output;
419 }
420
421 lt->setLooks(look.c_str());
422 group->appendTransform(lt);
423 }
424 else {
425 /* For empty looks, no output color space is returned. */
426 use_look = false;
427 }
428 }
429
430 /* Add view and display transform. */
431 OCIO_NAMESPACE::DisplayViewTransformRcPtr dvt = OCIO_NAMESPACE::DisplayViewTransform::Create();
432 dvt->setSrc(from_colorspace.c_str());
433 dvt->setLooksBypass(use_look);
434 dvt->setView(view.c_str());
435 dvt->setDisplay(display.c_str());
436 group->appendTransform(dvt);
437
438 return group;
439}
440
441static OCIO_NAMESPACE::TransformRcPtr create_untonemapped_ocio_display_transform(
442 const LibOCIOConfig &config,
443 StringRefNull display_name,
444 StringRefNull from_colorspace,
445 bool use_hdr_buffer)
446{
447 /* Convert to extended sRGB without any tone mapping. */
448 const auto group = OCIO_NAMESPACE::GroupTransform::Create();
449
450 const auto to_scene_linear = OCIO_NAMESPACE::ColorSpaceTransform::Create();
451 to_scene_linear->setSrc(from_colorspace.c_str());
452 to_scene_linear->setDst(OCIO_NAMESPACE::ROLE_SCENE_LINEAR);
453 group->appendTransform(to_scene_linear);
454
455 const auto to_rec709 = OCIO_NAMESPACE::MatrixTransform::Create();
456 to_rec709->setMatrix(math::transpose(double4x4(colorspace::scene_linear_to_rec709)).base_ptr());
457 group->appendTransform(to_rec709);
458
459 const LibOCIODisplay *display = static_cast<const LibOCIODisplay *>(
460 config.get_display_by_name(display_name));
461 const LibOCIOView *view = (display) ? static_cast<const LibOCIOView *>(
462 display->get_untonemapped_view()) :
463 nullptr;
464 group->appendTransform(create_extended_srgb_transform(
465 system_extended_srgb_transfer_function(view, use_hdr_buffer)));
466 return group;
467}
468
469OCIO_NAMESPACE::ConstProcessorRcPtr create_ocio_display_processor(
470 const LibOCIOConfig &config, const DisplayParameters &display_parameters)
471{
472 using namespace OCIO_NAMESPACE;
473
474 const ConstConfigRcPtr &ocio_config = config.get_ocio_config();
475
476 GroupTransformRcPtr group = GroupTransform::Create();
477
478 const char *from_colorspace = display_parameters.from_colorspace.c_str();
479
480 /* Linear transforms. */
481 if (display_parameters.scale != 1.0f || display_parameters.use_white_balance) {
482 /* Always apply exposure and/or white balance in scene linear. */
483 ColorSpaceTransformRcPtr ct = ColorSpaceTransform::Create();
484 ct->setSrc(from_colorspace);
485 ct->setDst(ROLE_SCENE_LINEAR);
486 group->appendTransform(ct);
487
488 /* Make further transforms aware of the color space change. */
489 from_colorspace = ROLE_SCENE_LINEAR;
490
491 /* Apply scale. */
492 MatrixTransformRcPtr mt = MatrixTransform::Create();
493 float3x3 matrix = float3x3::identity() * display_parameters.scale;
494
495 /* Apply white balance. */
496 if (display_parameters.use_white_balance) {
498 config, display_parameters.temperature, display_parameters.tint);
499 }
500
501 mt->setMatrix(double4x4(math::transpose(matrix)).base_ptr());
502 group->appendTransform(mt);
503 }
504
505 if (!display_parameters.view.is_empty()) {
506 /* Core display processor. */
507 group->appendTransform(create_ocio_display_transform(ocio_config,
508 display_parameters.display,
509 display_parameters.view,
510 display_parameters.look,
511 from_colorspace));
512 /* Gamma. */
513 if (display_parameters.exponent != 1.0f) {
514 ExponentTransformRcPtr et = ExponentTransform::Create();
515 const double value[4] = {display_parameters.exponent,
516 display_parameters.exponent,
517 display_parameters.exponent,
518 1.0};
519 et->setValue(value);
520 group->appendTransform(et);
521 }
522
523 if (display_parameters.is_image_output) {
525 config, group, display_parameters.display, display_parameters.view);
526 }
527
528 /* Convert to extended sRGB to match the system graphics buffer. */
529 if (display_parameters.use_display_emulation) {
531 group,
532 display_parameters.display,
533 display_parameters.view,
534 display_parameters.use_hdr_buffer);
535 }
536 else if (display_parameters.use_scope_space) {
537 display_as_scope_space(config, group, display_parameters.display, display_parameters.view);
538 }
539 }
540 else {
541 /* Un-tone-mapped case, directly to extended sRGB. */
542 group->appendTransform(create_untonemapped_ocio_display_transform(
543 config, display_parameters.display, from_colorspace, display_parameters.use_hdr_buffer));
544 }
545
546 if (display_parameters.inverse) {
547 group->setDirection(TRANSFORM_DIR_INVERSE);
548 }
549
551 std::stringstream sstream;
552 sstream << *group;
553 CLOG_TRACE(&LOG, "Creating display transform:\n%s", sstream.str().c_str());
554 }
555
556 /* Create processor from transform. This is the moment were OCIO validates the entire transform,
557 * no need to check for the validity of inputs above. */
558 ConstProcessorRcPtr p;
559 try {
560 p = ocio_config->getProcessor(group);
561 }
562 catch (Exception &exception) {
563 report_exception(exception);
564 return nullptr;
565 }
566
567 return p;
568}
569
570} // namespace blender::ocio
#define CLOG_DEBUG(clg_ref,...)
Definition CLG_log.h:191
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:189
#define CLOG_CHECK(clg_ref, verbose_level,...)
Definition CLG_log.h:147
@ CLG_LEVEL_TRACE
Definition CLG_log.h:64
#define CLOG_TRACE(clg_ref,...)
Definition CLG_log.h:192
#define UNUSED_VARS(...)
#define ELEM(...)
constexpr const char * c_str() const
constexpr bool is_empty() const
virtual StringRefNull name() const =0
StringRefNull name() const override
bool is_display_referred() const override
const ColorSpace * get_color_space_for_hdr_image(StringRefNull name) const override
const Display * get_display_by_name(StringRefNull name) const override
const ColorSpace * get_color_space(StringRefNull name) const override
const OCIO_NAMESPACE::ConstConfigRcPtr & get_ocio_config() const
bool is_hdr() const override
const View * get_untonemapped_view() const override
const View * get_view_by_name(StringRefNull name) const override
Gamut gamut() const override
bool is_hdr() const override
TransferFunction transfer_function() const override
const ColorSpace * display_colorspace() const override
void append_scope_space_transforms(OCIO_NAMESPACE::GroupTransformRcPtr &group, StringRefNull lin_cie_xyz_d65_name) const
constexpr T clamp(T, U, U) RET
BLI_INLINE ColorSceneLinear4f< eAlpha::Straight > to_scene_linear(const ColorTheme4f &theme4f)
Definition BLI_color.hh:126
float3x3 scene_linear_to_rec709
MatBase< T, NumCol, NumRow > transpose(const MatBase< T, NumRow, NumCol > &mat)
CartesianBasis invert(const CartesianBasis &basis)
static OCIO_NAMESPACE::TransformRcPtr create_untonemapped_ocio_display_transform(const LibOCIOConfig &config, StringRefNull display_name, StringRefNull from_colorspace, bool use_hdr_buffer)
float3x3 calculate_white_point_matrix(const Config &config, const float temperature, const float tint)
OCIO_NAMESPACE::ConstProcessorRcPtr create_ocio_display_processor(const LibOCIOConfig &config, const DisplayParameters &display_parameters)
static void display_as_scope_space(const LibOCIOConfig &config, OCIO_NAMESPACE::GroupTransformRcPtr &group, StringRefNull display_name, StringRefNull view_name)
static TransferFunction system_extended_srgb_transfer_function(const LibOCIOView *view, const bool use_hdr_buffer)
OCIO_NAMESPACE::TransformRcPtr create_ocio_display_transform(const OCIO_NAMESPACE::ConstConfigRcPtr &ocio_config, StringRefNull display, StringRefNull view, StringRefNull look, StringRefNull from_colorspace)
static CLG_LogRef LOG
static void display_as_extended_srgb(const LibOCIOConfig &config, OCIO_NAMESPACE::GroupTransformRcPtr &group, StringRefNull display_name, StringRefNull view_name, const bool use_hdr_buffer)
static void adjust_for_hdr_image_file(const LibOCIOConfig &config, OCIO_NAMESPACE::GroupTransformRcPtr &group, StringRefNull display_name, StringRefNull view_name)
void report_exception(const OCIO_NAMESPACE::Exception &exception)
static OCIO_NAMESPACE::TransformRcPtr create_extended_srgb_transform(const TransferFunction transfer_function)
MatBase< float, 3, 3 > float3x3
MatBase< double, 4, 4 > double4x4