struct screen {
        
        unsigned char red;
        unsigned char green;  
        unsigned char blue;
        unsigned char alpha;
};

__kernel void AlphaKernel(__global struct screen *cl_input1, __global struct screen *cl_input2, __global struct screen *cl_output)
{
	size_t x = (get_group_id(0) * get_local_size(0)) + get_local_id(0);
	
	float p1, p2, p3;
	
	p1 = cl_input1[x].red + cl_input2[x].red; 
	p2 = cl_input1[x].green + cl_input2[x].green;
	p3 = cl_input1[x].blue + cl_input2[x].blue;


        cl_output[x].red = p1 / 2;
        cl_output[x].green = p2 / 2;
        cl_output[x].blue = p3 / 2;
}
