I have been working on PSET4 and understood the code and the tasks fine. But my compilation does not change the image and I cannot figure out why it will not work for the life of me. I have checked and rechecked it a million times with other codes.
Thanks so much!
void sepia(int height, int width, RGBTRIPLE image[height][width])
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
int sepiaRed=round(.393 * image[i][j].rgbtRed+ .769 * image[i][j].rgbtGreen+ .189 * image[i][j].rgbtBlue);
int sepiaGreen=round(.349 * image[i][j].rgbtRed+ .686 * image[i][j].rgbtGreen+ .168 * image[i][j].rgbtBlue);
int sepiaBlue=round(.272 * image[i][j].rgbtRed+ .534 * image[i][j].rgbtGreen+ .131 * image[i][j].rgbtBlue);
if (sepiaRed > 255)
{
image[i][j].rgbtRed = 255;
}
else
{
image[i][j].rgbtRed = sepiaRed;
}
if (sepiaGreen > 255)
{
image[i][j].rgbtGreen = 255;
}
else
{
image[i][j].rgbtGreen = sepiaGreen;
}
if(sepiaBlue > 255)
{
image[i][j].rgbtBlue = 255;
}
else
{
image[i][j].rgbtBlue=sepiaBlue;
}
}
return;
}
}`