Mail Archives: djgpp/1999/07/13/17:23:04
> void flip_image(int array[], int rows, int cols)
> {
> int row_count, col_count, total_pixelsp;
>
> for(row_count = 0; row_count < rows; row_count++)
> {
> for(col_count = 0; col_count < cols; col_count++)
> {
> array[???] = array[???];
> }
> }
> }
think:
there should be something like:
for(i=0;i<row/2;i++)
for(j=0;j<col;j++)
{
a=array[i*bytes_per_line+j];
array[i*bytes_per_line+j]=array[(i+1)*bytes_per_line-j];
array[(i+1)*bytes_per_line-j]=a;
}
now try to undertand the code.
- Raw text -