Fixed last fix

This commit is contained in:
Nikola
2026-07-13 23:13:08 +02:00
parent c68d8c7c15
commit 085bb04595
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ void tricorn(float complex start, size_t width, ssize_t height, float res, unsig
const size_t y_step = (abs_height+thread_count-1)/thread_count;
const float start_r = crealf(start);
const float directional_res = (flipped ? -1.0f: 1.0f)*res;
const float start_i = height > 0 ? cimag(start) : cimag(start) + (height * directional_res);
const float start_i = height > 0 ? cimag(start) : cimag(start) + ((abs_height - 1) * res);
const_args* consts = malloc(sizeof(*consts));
consts->width = width;
+1 -1
View File
@@ -23,7 +23,7 @@ void tricorn_V2(float complex start, size_t width, ssize_t height, float res, un
// As we iterate from the top always, if it is negative we would have to start at the end of the imaginary part and go in the oposite direction when generating
ssize_t imag_direction = height < 0 ? -1 : 1;
float c_start_real = creal(start);
float c_start_imag = height > 0 ? cimag(start) : creal(start) + (imag_direction * height * res);;
float c_start_imag = height > 0 ? cimag(start) : cimag(start) + ((actual_height-1) * res);;
float vertical_step = imag_direction * res;
+1 -1
View File
@@ -25,7 +25,7 @@ void tricorn_V3(float complex start, size_t width, ssize_t height, float res, un
// As we iterate the image buffer from the top, if height is negative we would have to start at the end of the imaginary part and go in the oposite direction when generating
ssize_t imag_direction = height < 0 ? -1 : 1;
float c_start_real = creal(start);
float c_start_imag = height > 0 ? cimag(start) : cimag(start) + (height * imag_direction) * res;
float c_start_imag = height > 0 ? cimag(start) : cimag(start) + (actual_height - 1) * res;
__m128 four = _mm_set1_ps(4.0f);
__m128 minus_two = _mm_set1_ps(-2.0f);
+3 -3
View File
@@ -24,7 +24,7 @@ void tricorn_V4(float complex start, size_t width, ssize_t height, float res, un
// As we iterate the image buffer from the top, if height is negative we would have to start at the end of the imaginary part and go in the oposite direction when generating
ssize_t imag_direction = height < 0 ? -1 : 1;
float c_start_real = creal(start);
float c_start_imag = height > 0 ? cimag(start) : cimag(start) + (height * imag_direction) * res;
float c_start_imag = height > 0 ? cimag(start) : cimag(start) + (actual_height - 1) * res;
__m128 four = _mm_set1_ps(4.0f);
__m128 minus_two = _mm_set1_ps(-2.0f);
@@ -108,8 +108,8 @@ void tricorn_V4(float complex start, size_t width, ssize_t height, float res, un
img[position + 2] = ((value*5) % 255);
}
}
c_imag -= vertical_step;
c_imag_vector = _mm_sub_ps(c_imag_vector,vertical_step_vector);
c_imag += vertical_step;
c_imag_vector = _mm_add_ps(c_imag_vector,vertical_step_vector);
}
}