summaryrefslogtreecommitdiff
path: root/opencl/levels.cl.h
blob: 88e38763b126ee6a93f0d55b562d09cc3f5acdf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
static const char* levels_cl_source =
"__kernel void kernel_levels(__global const float4     *in,                    \n"
"                            __global       float4     *out,                   \n"
"                            float in_offset,                                  \n"
"                            float out_offset,                                 \n"
"                            float scale)                                      \n"
"{                                                                             \n"
"  int gid = get_global_id(0);                                                 \n"
"  float4 in_v  = in[gid];                                                     \n"
"  float4 out_v;                                                               \n"
"  out_v.xyz = (in_v.xyz - in_offset) * scale + out_offset;                    \n"
"  out_v.w   =  in_v.w;                                                        \n"
"  out[gid]  =  out_v;                                                         \n"
"}                                                                             \n"
;