Fractol 1.0
A fractal visualization project implemented in C.
|
#include "fractol.h"
Go to the source code of this file.
Functions | |
static void | julia_iterations (t_render_vars *vars, t_data *data) |
Performs the iterations for a signle point in the Julia set. | |
static void | render_julia_row (t_render_vars *vars, t_data *data, int y) |
Renders a single row of the Julia set. | |
void | render_julia (t_data *data) |
Renders the Julia set fractal. | |
|
static |
Performs the iterations for a signle point in the Julia set.
This function applies the Julia set formula iteratively to determine whether a given point escapes the threshold. The number of iterations taken before escape determines the point's color.
z = z^2 + c
is applied, where:z
is a complex number, represented by real (z_re
) and imaginary (z_im
) parts.c
is a constant defined by the user (real and imaginary parts).MAX_ITERATIONS
) is reached.z_re^2
and z_im^2
) are cached to avoid redundant calculations.vars | Pointer to the structure holding rendering variables (e.g., z and iterations ). @params data Pointer to the main fractal data, including the Julia constant (c ). |
Definition at line 84 of file julia.c.
void render_julia | ( | t_data * | data | ) |
Renders the Julia set fractal.
Renders the Julia fractal.
This function handles the full rendering process for the Julia set by iterating through all rows of the screen, rendering each row sequentially.
y
coordinate), the corresponding imaginary coordinate is computed.render_julia_row
, which handles the pixel-by-pixel rendering.data | Pointer to the main fractal data structure, including rendering details such as zoom, offsets, and fractal paarameters. |
Definition at line 165 of file julia.c.
|
static |
Renders a single row of the Julia set.
This function processes one row of the pixel in the Juliaa set by iterating through each pixel, applying the Juliaa set formula, and determining its color.
z
) based on its position and the scaling factors calculated from the zoom and offsets.vars | Pointer to the rendering variables structure (e.g., pixel and scaling). |
data | Pointer to the main fractal data. |
y | The current row index being processed (0 for the first row, up to HEIGHT - 1 ). |
Definition at line 126 of file julia.c.