Created
November 10, 2017 23:54
-
-
Save NikitaShkaruba/bc86bdc05163aba3e270193112601ffc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t width = image.height; | |
size_t height = image.width3; | |
char** pixels = (char**) calloc(height, sizeof(char*)); | |
for (int i = 0; i < width; i ++) { | |
pixels[i] = (char*) calloc(width, sizeof(char)); | |
} | |
for (int i = 0; i < height; i++) { | |
for (int j = 0; j < width; j++) { | |
int y = height - i - 1; | |
int x = width - j - 1; | |
pixels[y][x] = image.array[width * i - 1 + j] //initial_pixels[i][j]; | |
} | |
} | |
for (int i = 0; i < height; i++) { | |
for (int j = 0; j < width; j++) { | |
image.array[width * i -1 + j] = pixels[i][j]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment