+4
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user