int main() { int dim = 5, i; //unsigned char arr[] = {0x00, 0xff, 0xff, 0xff, 0x00, // 0x00, 0x00, 0x00, 0xff, 0x00, // 0x00, 0xff, 0xff, 0xff, 0x00, // 0x00, 0x00, 0x00, 0xff, 0x00, // 0x00, 0xff, 0xff, 0xff, 0x00}; // // unsigned char arr[] = {0xff, 0xff, 0xff, 0xff, 0x00, // 0xff, 0xff, 0xff, 0xff, 0x00, // 0xff, 0xff, 0xff, 0xff, 0x00, // 0xff, 0xff, 0xff, 0xff, 0x00, // 0xff, 0xff, 0xff, 0xff, 0x00}; // unsigned char arr[] = {0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff}; printf("Before flip:\n"); print_2D(arr, dim); flip_horizontal(arr, dim); printf("After flip:\n"); print_2D(arr, dim); return 0; }
/* Rotates the square array ARR by 90 degrees counterclockwise. */ void rotate_ccw_90(float *arr, int width) { flip_horizontal(arr, width); transpose(arr, width); }