
#include "ModificarImagen.h"

#include <cutil.h>


// Kernel Function which is executed in the Device.
__global__ void Modificar_Imagen(uchar3 *Imag,int N)
{
	int idx = blockIdx.x * blockDim.x + threadIdx.x;
	
	if (idx<N){
		if((Imag[idx].x+Imag[idx].y+Imag[idx].z)/3 > 250){
			Imag[idx].x=255;  //B
			Imag[idx].y=0;  //G
			Imag[idx].z=0;//R
		}
	} 
}


void CUDA_Modificar_Imagen(uchar3 *Image_dev,int N,dim3 grid,dim3 threads){
	Modificar_Imagen<<<grid,threads>>> (Image_dev,N);
}
