Blender  V3.3
brightness.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
7 
9 
11  ccl_private ShaderData *sd, ccl_private float *stack, uint in_color, uint out_color, uint node)
12 {
13  uint bright_offset, contrast_offset;
14  float3 color = stack_load_float3(stack, in_color);
15 
16  svm_unpack_node_uchar2(node, &bright_offset, &contrast_offset);
17  float brightness = stack_load_float(stack, bright_offset);
18  float contrast = stack_load_float(stack, contrast_offset);
19 
20  color = svm_brightness_contrast(color, brightness, contrast);
21 
22  if (stack_valid(out_color))
23  stack_store_float3(stack, out_color, color);
24 }
25 
unsigned int uint
Definition: BLI_sys_types.h:67
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_brightness(ccl_private ShaderData *sd, ccl_private float *stack, uint in_color, uint out_color, uint node)
Definition: brightness.h:10
ccl_device_inline float3 svm_brightness_contrast(float3 color, float brightness, float contrast)
Definition: color_util.h:298
#define ccl_private
Definition: cuda/compat.h:48
#define ccl_device_noinline
Definition: cuda/compat.h:40
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
OperationNode * node
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(ccl_private float *stack, uint a)
ccl_device_forceinline void svm_unpack_node_uchar2(uint i, ccl_private uint *x, ccl_private uint *y)
ccl_device_inline float stack_load_float(ccl_private float *stack, uint a)
ccl_device_inline bool stack_valid(uint a)
ShaderData
Definition: kernel/types.h:925