erzeugung vom ersten test image. farbuebergang rot und gruen.

This commit is contained in:
any
2026-07-19 19:14:42 +02:00
parent 22af45e1c9
commit ff8c8a2bdc
9 changed files with 20440 additions and 4 deletions
+19
View File
@@ -0,0 +1,19 @@
//
// Created by ary on 19.07.2026.
//
#include "examples.h"
void example_color(int width, int height, int channels, unsigned char *image) {
for (int i = 0; i < height * width; i++) {
int step = i *channels;
int x = i % width;
int y = i / width;
image[step] = 0 + (int)((((double)x)/width) * 255);
image[step+1] = 0 + (int)((((double)y)/width) * 255);
image[step+2] = 0;
if (channels == 4) {
image[step+3] = 255;
}
}
}