Update Portuguese translation
[gegl.git] / opencl / texturize-canvas.cl
blobc2d316529872998deb013c940924e2ff7cd7c8cd
1 __kernel void cl_texturize_canvas(__global const float * in,
2 __global float * out,
3 __global float * sdata,
4 const int x,
5 const int y,
6 const int xm,
7 const int ym,
8 const int offs,
9 const float mult,
10 const int components,
11 const int has_alpha)
13 int col = get_global_id(0);
14 int row = get_global_id(1);
15 int step = components + has_alpha;
16 int index = step * (row * get_global_size(0) + col);
17 int canvas_index = ((x + col) & 127) * xm +
18 ((y + row) & 127) * ym + offs;
19 float color;
20 int i;
21 float tmp = mult * sdata[canvas_index];
22 for(i=0; i<components; ++i)
24 color = tmp + in[index];
25 out[index++] = clamp(color,0.0f,1.0f);
27 if(has_alpha)
28 out[index] = in[index];