I am trying to rotate a bmp image by 90(-270), 180(-180), 270(-90) degrees. But I am not sure how to go about it. I know I have to manipulate the rows and columns for the bitmap. But I am unsure how to. I don't want the answer, just some guidance so I can get there ... Here is what I have:
Code:
int rotate(PIXEL* original, int rows, int cols, int rotation,
PIXEL** new, int* newrows, int* newcols)
{
int c,r;
*newrows = cols;
*newcols = rows;
PIXEL *o;
PIXEL *n;
//for 90 or -270 degrees
if(rotation == 90 || rotation == -270 )
{
for(r = 0; r < rows; r++)
{
for(c = 0; c < cols; c++ )
{
//not sure what to do
}//end of for
}//end of for
}//end of if
return 0;
}