Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/util/color.h')
-rw-r--r--intern/cycles/kernel/util/color.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/kernel/util/color.h b/intern/cycles/kernel/util/color.h
index 95b6b33795d..28978d873d6 100644
--- a/intern/cycles/kernel/util/color.h
+++ b/intern/cycles/kernel/util/color.h
@@ -14,6 +14,15 @@ ccl_device float3 xyz_to_rgb(KernelGlobals kg, float3 xyz)
dot(float4_to_float3(kernel_data.film.xyz_to_b), xyz));
}
+ccl_device float3 rec709_to_rgb(KernelGlobals kg, float3 rec709)
+{
+ return (kernel_data.film.is_rec709) ?
+ rec709 :
+ make_float3(dot(float4_to_float3(kernel_data.film.rec709_to_r), rec709),
+ dot(float4_to_float3(kernel_data.film.rec709_to_g), rec709),
+ dot(float4_to_float3(kernel_data.film.rec709_to_b), rec709));
+}
+
ccl_device float linear_rgb_to_gray(KernelGlobals kg, float3 c)
{
return dot(c, float4_to_float3(kernel_data.film.rgb_to_y));