Added: Pregenerated lookup table
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user