Blender V5.0
brightness.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_color,
14 const uint out_color,
15 const uint node)
16{
17 uint bright_offset;
18 uint contrast_offset;
19 float3 color = stack_load_float3(stack, in_color);
20
21 svm_unpack_node_uchar2(node, &bright_offset, &contrast_offset);
22 const float brightness = stack_load_float(stack, bright_offset);
23 const float contrast = stack_load_float(stack, contrast_offset);
24
25 color = svm_brightness_contrast(color, brightness, contrast);
26
27 if (stack_valid(out_color)) {
28 stack_store_float3(stack, out_color, color);
29 }
30}
31
unsigned int uint
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_brightness(ccl_private float *stack, const uint in_color, const uint out_color, const uint node)
Definition brightness.h:12
ccl_device_inline float3 svm_brightness_contrast(float3 color, const float brightness, const float contrast)
Definition color_util.h:369
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_forceinline void svm_unpack_node_uchar2(const uint i, ccl_private uint *x, ccl_private uint *y)
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