summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/gamma/Gamma.cl
diff options
context:
space:
mode:
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