void sepia(int height, int width, RGBTRIPLE image[height][width])
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
float redS = .393 * (float) image[i][j].rgbtRed + .769 * (float) image[i][j].rgbtGreen + .189 * (float) image[i][j].rgbtBlue;
float greenS = .349 * (float) image[i][j].rgbtRed + .686 * (float) image[i][j].rgbtGreen + .168 * (float) image[i][j].rgbtBlue;
float blueS = .272 * (float) image[i][j].rgbtRed + .534 * (float) image[i][j].rgbtGreen + .131 * (float) image[i][j].rgbtBlue;
int r = round(redS);
int g = round(greenS);
int b = round(blueS);
image[i][j].rgbtRed = r;
image[i][j].rgbtGreen = g;
image[i][j].rgbtBlue = b;
}
}
return;
}
this is the code i wrote, but what check50 says:
:( sepia correctly filters more complex 3x3 image expected "25 22 17\n66 5...", not "25 22 17\n66 5..."
:( sepia correctly filters 4x4 image expected "25 22 17\n66 5...", not "25 22 17\n66 5..."