Update Portuguese translation
[gegl.git] / opencl / hue-chroma.cl
blob2550f2b9aac7c23aaa00cb8dbf7b8b7e47493648
1 #define EPSILON 1e-4f
3 __kernel void gegl_hue_chroma (__global const float4 *in,
4 __global float4 *out,
5 float hue,
6 float chroma,
7 float lightness)
9 int gid = get_global_id(0);
10 float4 in_v = in [gid];
11 float4 out_v;
13 if (fabs (in_v.y) > EPSILON)
15 out_v.y = in_v.y + chroma;
16 out_v.z = in_v.z + hue;
18 else
20 out_v.y = in_v.y;
21 out_v.z = in_v.z;
24 out_v.x = in_v.x + lightness;
25 out_v.y = clamp (out_v.y, 0.f, 300.f);
26 out_v.w = in_v.w;
27 out[gid] = out_v;