We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f462df3 commit 96e0e07Copy full SHA for 96e0e07
bmp.c
@@ -68,13 +68,13 @@ unsigned char* loadBMP(char* filename, DIBHeader* DIBitmapHeader) {
68
bitmapImage[imageIdx + 2] = tempRGB;
69
}
70
71
- // Rotate 180 Degrees
+ // Reverse the rows
72
const int32_t rows = DIBitmapHeader->imgHeight;
73
const int32_t cols = DIBitmapHeader->imgWidth;
74
for (int j = 0; j < rows / 2 ; j++) {
75
for (int i = 0; i < cols; i++) {
76
int idxFrom = (j * cols + i) * increment;
77
- int idxTo = ((rows - j - 1) * cols + (cols - i - 1)) * increment;
+ int idxTo = ((rows - j - 1) * cols + i) * increment;
78
79
int offset;
80
for (offset = 0; offset < increment; offset++) {
0 commit comments