aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/gamma/Gamma.cl
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-02-03 23:13:42 +0100
committerMichael Bien <[email protected]>2011-02-03 23:13:42 +0100
commitdbe93d1e40a7bc9fbea7c5be3d59bf84e8a20ecb (patch)
tree3a451adf79f605d32c818a49ea2f71d4db8969fb /src/com/jogamp/opencl/demos/gamma/Gamma.cl
parent992963009a1f551808e8da786b6b9d7b701f7a34 (diff)
new simple gamma correction OpenCL example featuring lenna.
Diffstat (limited to 'src/com/jogamp/opencl/demos/gamma/Gamma.cl')
-rw-r--r--src/com/jogamp/opencl/demos/gamma/Gamma.cl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/demos/gamma/Gamma.cl b/src/com/jogamp/opencl/demos/gamma/Gamma.cl
new file mode 100644
index 0000000..69b0618
--- /dev/null
+++ b/src/com/jogamp/opencl/demos/gamma/Gamma.cl
@@ -0,0 +1,10 @@
+ /**
+ * gamma correction kernel
+ */
+ kernel void gamma(global float* image, const float gamma, const float scale, const int max) {
+ int index = get_global_id(0);
+ if (index >= max) {
+ return;
+ }
+ image[index] = pow(image[index], gamma) * scale;
+ } \ No newline at end of file