From 4fad6e1cb22d1fbcf6c7a975c9bb7554b5d5eef4 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 8 Feb 2025 19:29:46 -0700 Subject: [PATCH] Rename NUM_IFS_PARAMS to NUM_IFS_2D_PARAMS --- libid/fractals/ifs.cpp | 2 +- libid/fractals/lorenz.cpp | 10 +++++----- libid/include/fractals/ifs.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libid/fractals/ifs.cpp b/libid/fractals/ifs.cpp index c2ca12e67..c24bd8112 100644 --- a/libid/fractals/ifs.cpp +++ b/libid/fractals/ifs.cpp @@ -73,7 +73,7 @@ int ifs_load() // read in IFS parameters } string_lower(buf); - int const row_size = std::strstr(buf, "(3d)") != nullptr ? NUM_IFS_3D_PARAMS : NUM_IFS_PARAMS; + int const row_size = std::strstr(buf, "(3d)") != nullptr ? NUM_IFS_3D_PARAMS : NUM_IFS_2D_PARAMS; g_ifs_type = row_size == NUM_IFS_3D_PARAMS; int ret = 0; diff --git a/libid/fractals/lorenz.cpp b/libid/fractals/lorenz.cpp index c0c4dfea2..78bcd8794 100644 --- a/libid/fractals/lorenz.cpp +++ b/libid/fractals/lorenz.cpp @@ -1826,7 +1826,7 @@ static int ifs2d() int color_method = (int) g_params[0]; try { - local_ifs.resize(g_num_affine_transforms*NUM_IFS_PARAMS); + local_ifs.resize(g_num_affine_transforms*NUM_IFS_2D_PARAMS); } catch (const std::bad_alloc &) { @@ -1836,9 +1836,9 @@ static int ifs2d() for (int i = 0; i < g_num_affine_transforms; i++) // fill in the local IFS array { - for (int j = 0; j < NUM_IFS_PARAMS; j++) + for (int j = 0; j < NUM_IFS_2D_PARAMS; j++) { - local_ifs[i*NUM_IFS_PARAMS+j] = (long)(g_ifs_definition[i*NUM_IFS_PARAMS+j] * g_fudge_factor); + local_ifs[i*NUM_IFS_2D_PARAMS+j] = (long)(g_ifs_definition[i*NUM_IFS_2D_PARAMS+j] * g_fudge_factor); } } @@ -1873,10 +1873,10 @@ static int ifs2d() int k = 0; while (sum < r && k < g_num_affine_transforms-1) // fixed bug of error if sum < 1 { - sum += local_ifs[++k*NUM_IFS_PARAMS+6]; + sum += local_ifs[++k*NUM_IFS_2D_PARAMS+6]; } // calculate image of last point under selected iterated function - long *l_f_ptr = local_ifs.data() + k * NUM_IFS_PARAMS; // point to first parm in row + long *l_f_ptr = local_ifs.data() + k * NUM_IFS_2D_PARAMS; // point to first parm in row long new_x = multiply(l_f_ptr[0], x, g_bit_shift) + multiply(l_f_ptr[1], y, g_bit_shift) + l_f_ptr[4]; long new_y = multiply(l_f_ptr[2], x, g_bit_shift) + multiply(l_f_ptr[3], y, g_bit_shift) + l_f_ptr[5]; x = new_x; diff --git a/libid/include/fractals/ifs.h b/libid/include/fractals/ifs.h index 3fb319eef..525f0bbdb 100644 --- a/libid/include/fractals/ifs.h +++ b/libid/include/fractals/ifs.h @@ -6,7 +6,7 @@ enum { - NUM_IFS_PARAMS = 7, + NUM_IFS_2D_PARAMS = 7, NUM_IFS_3D_PARAMS = 13 };