Could someone explain me why there is a difference when you use float in front of image[i][j] compare to not using it. Because if I'm not mistaken, image[i][j].rgbtRed or the 2 others are already integers so I don't get why it needs to be a float. I have question for the blur filter. thx for your answers.
// Convert image to grayscale
void grayscale(int height, int width, RGBTRIPLE image[height][width])
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
int average = round(((float)image[i][j].rgbtRed + (float)image[i][j].rgbtGreen + (float)image[i][j].rgbtBlue) / 3);
image[i][j].rgbtGreen = image[i][j].rgbtBlue = image[i][j].rgbtRed = average;
}
}
return;
}