I'm trying to write the part of the code where the surrounding pixels around the main pixel are searched in order to make the average and later replace the main value for the average value. I am thinking about something like the code below. When I try to compile it I get:
error: expression result unused [-Werror,-Wunused-value] for ((x+i-1) ; x<2 ;x++)
Is it possible to use that expression (x+i-1)in a correct way?
void blur(int height, int width, RGBTRIPLE image[height][width])
RGBTRIPLE image_copy[height][width]
{
for (int i=0 ; i<height ; i++)
{
for (int j=0 ; j<width; j++)
{
int x=0;
int y=0;
image_copy[i][j].rgbtRed=image[i][j].rgbtRed
image_copy[i][j].rgbtBlue=image[i][j].rgbtBlue
image_copy[i][j].rgbtGreen=image[i][j].rgbtGreen
for (x+i-1 ; x<2 ; x++) // Searching loop for surrounding pixels
{
for (y+j-1 ; y<2 ; y++)
{
if(Not ouside boundaries)
{
//do average;
}
}
}
}
}
return;
}