Hi everyone , can someone please double check that this should work :
Code:
// A procedure that will scroll an image vertically and return back into matrix
void Image_vertical_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width)
{
int row, column, row_new;
int inverted_image[EP100_LIB_MAX_X][EP100_LIB_MAX_Y];
for (row=0;row<height;row++)
{
//We must loop the columns of the image's array , increasing it by 1 until the width of the image becomes the same as the height.
for (column=0;column<width;column++)
{
// Adding the scroll ammount
row_new = row + scroll;
while (row_new >= height) // Have to make sure that total is less than height
{
row_new = row_new - height;
}
inverted_image[row_new][column] = image_data[row][column];
}
}
}
I have no way to test this code . In theory it should work ?