This commit is contained in:
2025-06-03 20:40:56 +02:00
parent f12754da21
commit 4af50e5aa6
3 changed files with 21 additions and 9 deletions
+5 -1
View File
@@ -1,7 +1,11 @@
#include "args.h" #include "args.h"
parameters parse_args(int argc, char **argv) { parameters parse_args(int argc, char **argv) {
parameters params; parameters params = EMPTY_PARAMS;
params.width = 1920;
params.height = 1080;
params.file_path = "output.bmp";
// TODO // TODO
+10 -3
View File
@@ -1,3 +1,6 @@
#include <stdio.h>
#include <string.h>
#ifndef ARGS_H #ifndef ARGS_H
#define ARGS_H #define ARGS_H
@@ -5,13 +8,17 @@ struct Parameters {
unsigned long width; unsigned long width;
unsigned long height; unsigned long height;
char *file_path; char *file_path;
unsigned char start[3]; unsigned int size;
unsigned char slope[2]; float slope;
unsigned char var[3]; float start[3];
float var[3];
}; };
typedef struct Parameters parameters; typedef struct Parameters parameters;
parameters parse_args(int argc, char **argv); parameters parse_args(int argc, char **argv);
const parameters EMPTY_PARAMS = {
0, 0, NULL, 0, 0.0, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}};
#endif #endif
+6 -5
View File
@@ -2,15 +2,16 @@
#include "bmp.h" #include "bmp.h"
#include <string.h> #include <string.h>
#define WIDTH 256
#define HEIGHT 256
#define COLOR_DEPTH 3 #define COLOR_DEPTH 3
parameters global_params = EMPTY_PARAMS;
void generate_line(unsigned long y, char *data_buffer) { void generate_line(unsigned long y, char *data_buffer) {
memset(data_buffer, y, WIDTH * COLOR_DEPTH); memset(data_buffer, y, global_params.width * COLOR_DEPTH);
} }
void generate(parameters params) { void generate(parameters params) {
// TODO global_params = params;
bmp_generate(WIDTH, HEIGHT, COLOR_DEPTH, "test.bmp", generate_line); bmp_generate(params.width, params.height, COLOR_DEPTH, params.file_path,
generate_line);
} }