summaryrefslogtreecommitdiff
path: root/opencl/levels.cl
diff options
context:
space:
mode:
authorVictor Oliveira <victormatheus@gmail.com>2013-01-14 17:05:47 -0200
committerVictor Oliveira <victormatheus@gmail.com>2013-01-14 17:05:47 -0200
commita3b19bc8c3f5582818021453b24d269c0195e010 (patch)
treef34b7417bde54740718d01c867f7f27511681af7 /opencl/levels.cl
parent7548466e582f27fa714acc47464a1bee463d5011 (diff)
opencl: many changes
- splitting kernels from remaining filters - removing unnecessary opencl barriers - stop using cl_int to report GEGL errors (just opencl ones)
Diffstat (limited to 'opencl/levels.cl')
-rw-r--r--opencl/levels.cl13
1 files changed, 13 insertions, 0 deletions
diff --git a/opencl/levels.cl b/opencl/levels.cl
new file mode 100644
index 00000000..80b91d2f
--- /dev/null
+++ b/opencl/levels.cl
@@ -0,0 +1,13 @@
+__kernel void kernel_levels(__global const float4 *in,
+ __global float4 *out,
+ float in_offset,
+ float out_offset,
+ float scale)
+{
+ int gid = get_global_id(0);
+ float4 in_v = in[gid];
+ float4 out_v;
+ out_v.xyz = (in_v.xyz - in_offset) * scale + out_offset;
+ out_v.w = in_v.w;
+ out[gid] = out_v;
+}