fix: monochrome (#9)

* fix: monochrome

* update doc

* update doc
This commit is contained in:
2025-06-05 12:05:49 +02:00
committed by GitHub
parent 0172286d9a
commit 8f7d7aaaaa
4 changed files with 38 additions and 23 deletions
+4 -2
View File
@@ -7,6 +7,8 @@
#include <stdlib.h>
#include <time.h>
#define BMP_COLOR_DEPTH 3
parameters global_params;
float slope;
unsigned char color_depth;
@@ -47,7 +49,7 @@ void generate_bmp_line(unsigned short y, unsigned char *data_buffer,
generate_line();
}
for (i = 0; i < len; i++) {
x = i / (color_depth * global_params.size);
x = i / (BMP_COLOR_DEPTH * global_params.size);
data_buffer[(global_params.rotation / 2) == 1 ? i : (len - i - 1)] =
current_line[x * color_depth + (i % color_depth)];
}
@@ -106,7 +108,7 @@ void generate(parameters params) {
}
clock_t start = clock();
init(params);
bmp_generate(params.width, params.height, color_depth,
bmp_generate(params.width, params.height, BMP_COLOR_DEPTH,
params.rotation % 2 == 1, params.file_path, generate_bmp_line);
clean();
print_time(params, start);