Blender V5.0
fallback_processor_cache.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
6
8
9namespace blender::ocio {
10
11std::shared_ptr<const CPUProcessor> FallbackProcessorCache::get(
12 const StringRefNull from_colorspace, const StringRefNull to_colorspace) const
13{
14 if (from_colorspace == to_colorspace) {
15 static auto noop_cpu_processor = std::make_shared<FallbackNOOPCPUProcessor>();
16 return noop_cpu_processor;
17 }
18
19 if (from_colorspace == "sRGB" && to_colorspace == "Linear") {
20 static auto srgb_to_linear_cpu_processor =
21 std::make_shared<FallbackSRGBToLinearRGBCPUProcessor>();
22 return srgb_to_linear_cpu_processor;
23 }
24
25 if (from_colorspace == "Linear" && to_colorspace == "sRGB") {
26 static auto linear_to_srgb_cpu_processor =
27 std::make_shared<FallbackLinearRGBToSRGBCPUProcessor>();
28 return linear_to_srgb_cpu_processor;
29 }
30
31 return nullptr;
32}
33
34} // namespace blender::ocio
std::shared_ptr< const CPUProcessor > get(StringRefNull from_colorspace, StringRefNull to_colorspace) const