Hi, This is a small section of my code which is developed to get an image and store it in an array blah blah and flip the image horizontally and vertically (which works perfectly), however the program also needs to scroll the image horizontally and vertically which i dont know how to do,... can some one please let me know how to do that or at least point me towards the right direction?
(This program has a library code and a mainline code which calls the procedures and functions)
ta
Code:
//image flip vertically procedure
void image_process_flip_vertically(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y],int height,int width)
{
int row; // row count variable
int column; // column count variable
int temp_row; // inverse of row to flip image
int temp_array[height][width]; // temp array to store scrolled image
// flipping process
for (column = 0;column < width; column++) // column count loop
{
for (row = 0; row < height; row++) // row count loop
{
temp_row = height - 1 - row; // set temp row
temp_array [row][column] = image_data [temp_row][column];// place pixel into temp array in its new spot
}//endfor
}//endfor
// Returning temp array to image_data
for (column = 0; column < width; column++) // column count loop
{
for (row = 0; row < height; row++) // row count loop
{
image_data [row][column] = temp_array [row][column]; //returning flippeded image to image_data
}//endfor
}//endfor
}//endprocedure
//image flip horizontally procedure
void image_process_flip_horizontally(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y],int height,int width)
{
int row; // row count variable
int column; // column count variable
int temp_column; // inverse of cloumn to flip image
int temp_array[height][width]; //temp array to store scrolled image
// flipping process
for (row = 0; row < height; row++) // row count loop
{
for (column = 0; column < width; column++) // column count loop
{
temp_column = width - 1 - column; // set temp column
temp_array[row][column] = image_data[row][temp_column];// place pixel into temp arayy in its new spot
}//endfor
}//endfor
// Returning temp array to image_data
for (row = 0; row < height; row++) // row count loop
{
for(column = 0; column < width; column++) // column count loop
{
image_data[row][column]=temp_array[row][column]; //returning flipped image to image_data
}//endfor
}//endfor
}//endprocedure