This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320DM6437: TMS320DM6437 image gradient coding

Part Number: TMS320DM6437

Tool/software: Code Composer Studio

I need help with coding for image gradient filter.

Does anyone know how to start the code?

Below is for gray filter, I need help with gradient filtering. thank you

void ConvertGrayscale()
{
int x, y;
unsigned char r, g, b, gray;
for (y=0; y<YSIZE; y++)
{
for (x=0; x<XSIZE; x++)
{
r = *(((unsigned char*)imgBuffer) + (((y * XSIZE) + x ) * 4) + 3);
g = *(((unsigned char*)imgBuffer) + (((y * XSIZE) + x ) * 4) + 2);
b = *(((unsigned char*)imgBuffer) + (((y * XSIZE) + x ) * 4) + 1);
gray = (unsigned char)(0.299 * r + 0.587 * g + 0.114 * b);

*(((unsigned char*)imgGray) + (((y * XSIZE) + x ) * 4) + 3) = gray ;
*(((unsigned char*)imgGray) + (((y * XSIZE) + x ) * 4) + 2) = gray ;
*(((unsigned char*)imgGray) + (((y * XSIZE) + x ) * 4) + 1) = gray ;

}
}
}