Blender V5.0
gamma.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
8#include "kernel/svm/util.h"
9
11
13 const uint in_gamma,
14 const uint in_color,
15 const uint out_color)
16{
17 float3 color = stack_load_float3(stack, in_color);
18 const float gamma = stack_load_float(stack, in_gamma);
19
20 color = svm_math_gamma_color(color, gamma);
21
22 if (stack_valid(out_color)) {
23 stack_store_float3(stack, out_color, color);
24 }
25}
26
unsigned int uint
ccl_device_inline float stack_load_float(const ccl_private float *stack, const uint a)
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
ccl_device_inline bool stack_valid(const uint a)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(const ccl_private float *stack, const uint a)
#define ccl_private
#define ccl_device_noinline
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_gamma(ccl_private float *stack, const uint in_gamma, const uint in_color, const uint out_color)
Definition gamma.h:12
ccl_device_inline float3 svm_math_gamma_color(float3 color, const float gamma)
Definition math_util.h:241