Added: Pregenerated lookup table

This commit is contained in:
Yashar Alan Zenker
2026-07-17 11:53:16 +02:00
parent 1ead5be671
commit dc4b8bfaef
6 changed files with 287 additions and 38 deletions
+1 -10
View File
@@ -1,4 +1,5 @@
#include "tricorn_V1.h"
#include "color_table.h"
static unsigned converge(float c_real, float c_imag, unsigned n);
@@ -15,16 +16,6 @@ static unsigned converge(float c_real, float c_imag, unsigned n);
*/
void tricorn_V1(float complex start, size_t width, ssize_t height, float res, unsigned n, _Bool color, unsigned char* img){
int bytesPerColor = color ? 3 : 1;
unsigned char color_lookup_table[256][3];
if(color) {
for (int i = 0; i < 256; i++) {
color_lookup_table[i][0] = (unsigned char)((i * 3) % 255);
color_lookup_table[i][1] = (unsigned char)((i * 2) % 255);
color_lookup_table[i][2] = (unsigned char)((i * 5) % 255);
}
}
// Absolute height for iteration purposes
ssize_t actual_height = height > 0 ? height : (ssize_t)(-height);