Blender V4.3
COM_ocio_color_space_conversion_shader.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <cstdint>
8#include <string>
9
11
13
14class Context;
15
16/* ------------------------------------------------------------------------------------------------
17 * OCIO Color Space Conversion Shader Key.
18 */
20 public:
21 std::string source;
22 std::string target;
23 std::string config_cache_id;
24
26 const std::string &target,
27 const std::string &config_cache_id);
28
29 uint64_t hash() const;
30};
31
34
36
37/* -------------------------------------------------------------------------------------------------
38 * OCIO Color Space Conversion Shader.
39 *
40 * A cached resource that creates and caches a GPU shader that converts the source OCIO color space
41 * of an image into a different target OCIO color space. */
43 private:
44 std::shared_ptr<GPUShaderCreator> shader_creator_;
45
46 public:
47 OCIOColorSpaceConversionShader(Context &context, std::string source, std::string target);
48
50
52
53 const char *input_sampler_name();
54
55 const char *output_image_name();
56};
57
58/* ------------------------------------------------------------------------------------------------
59 * OCIO Color Space Conversion Shader Container.
60 */
62 private:
64
65 public:
66 void reset() override;
67
68 /* Check if there is an available OCIOColorSpaceConversionShader cached resource with the given
69 * parameters in the container, if one exists, return it, otherwise, return a newly created one
70 * and add it to the container. In both cases, tag the cached resource as needed to keep it
71 * cached for the next evaluation. */
72 OCIOColorSpaceConversionShader &get(Context &context, std::string source, std::string target);
73};
74
75} // namespace blender::realtime_compositor
struct GPUShader GPUShader
OCIOColorSpaceConversionShader & get(Context &context, std::string source, std::string target)
OCIOColorSpaceConversionShaderKey(const std::string &source, const std::string &target, const std::string &config_cache_id)
OCIOColorSpaceConversionShader(Context &context, std::string source, std::string target)
local_group_size(16, 16) .push_constant(Type b
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
unsigned __int64 uint64_t
Definition stdint.h:90