i am missing something here...but not sure what... it doesn't work on normal images... check50 passes for 1X2 and 1X3 images but fails for 3x3 and 4x4 images (so i guess it is an issue of iterating through the rows ..but that`s what the first for loop does ...i m confused.. :(
void reflect(int height, int width, RGBTRIPLE image[height][width])
{
//loop through the rows
for (int i = 0; i < height; i++)
{
int hwidth = round(width / 2);
//swap the first half of pixels with last half
for (int j = 0; j < hwidth; j++, width--)
{
RGBTRIPLE temp = image[i][j];
image[i][j] = image[i][width - 1 - j];
image[i][width - 1 - j] = temp;
}
}
return;
}