1 2 3 4 5 6 7 8 9 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; }