Skip to content

Commit

Permalink
Merge pull request #156 from ckormanyos/another_config
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos authored Sep 7, 2024
2 parents 5c89db8 + 413f603 commit 97f4974
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 74 deletions.
36 changes: 28 additions & 8 deletions MandelbrotDiscovery/mandelbrot_discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,27 @@ template<const unsigned Digits10> auto center_y() -> typename local::cfg_type<Di
template<const unsigned Digits10>
using rectangle_from_digits_type = geometry::rectangle_type<typename geometry::point_type<typename local::cfg_type<Digits10>::mandelbrot_coord_pnt_type>>;

constexpr inline auto default_00_digits10() -> unsigned { return unsigned { UINT32_C( 44) }; } // For magnification <= 20
constexpr inline auto default_01_digits10() -> unsigned { return unsigned { UINT32_C(104) }; } // For magnification <= 80
constexpr inline auto default_02_digits10() -> unsigned { return unsigned { UINT32_C(536) }; } // For magnification <= 512
constexpr inline auto default_00_digits10() -> unsigned { return unsigned { UINT32_C( 44) }; } // For magnification <= 20
constexpr inline auto default_01_digits10() -> unsigned { return unsigned { UINT32_C( 64) }; } // For magnification <= 40
constexpr inline auto default_02_digits10() -> unsigned { return unsigned { UINT32_C( 104) }; } // For magnification <= 80
constexpr inline auto default_03_digits10() -> unsigned { return unsigned { UINT32_C(1560) }; } // For magnification <= 1536 (which we consider unlimited)

using rectangle_00_type = rectangle_from_digits_type<default_00_digits10()>;
using rectangle_01_type = rectangle_from_digits_type<default_01_digits10()>;
using rectangle_02_type = rectangle_from_digits_type<default_02_digits10()>;
using rectangle_03_type = rectangle_from_digits_type<default_03_digits10()>;

using rectangle_tuple_type = std::tuple<rectangle_00_type&, rectangle_01_type&, rectangle_02_type&>;
using rectangle_tuple_type = std::tuple<rectangle_00_type&, rectangle_01_type&, rectangle_02_type&, rectangle_03_type&>;

using rectangle_ref_00_type = typename std::tuple_element<0, rectangle_tuple_type>::type;
using rectangle_ref_01_type = typename std::tuple_element<1, rectangle_tuple_type>::type;
using rectangle_ref_02_type = typename std::tuple_element<2, rectangle_tuple_type>::type;
using rectangle_ref_00_type = typename std::tuple_element<0x00, rectangle_tuple_type>::type;
using rectangle_ref_01_type = typename std::tuple_element<0x01, rectangle_tuple_type>::type;
using rectangle_ref_02_type = typename std::tuple_element<0x02, rectangle_tuple_type>::type;
using rectangle_ref_03_type = typename std::tuple_element<0x03, rectangle_tuple_type>::type;

using point_00_type = typename rectangle_00_type::point_type;
using point_01_type = typename rectangle_01_type::point_type;
using point_02_type = typename rectangle_02_type::point_type;
using point_03_type = typename rectangle_03_type::point_type;

using local_window_type = mandelbrot_discovery<static_cast<int>(INT16_C(800)),
static_cast<int>(INT16_C(800)),
Expand Down Expand Up @@ -117,9 +121,25 @@ auto rectangle_02() -> rectangle_02_type&
return my_rect;
}

auto rectangle_03() -> rectangle_03_type&
{
static rectangle_03_type my_rect
{
point_03_type { center_x<default_03_digits10()>(), center_y<default_03_digits10()>() },
dx_half<default_03_digits10()>(),
dy_half<default_03_digits10()>()
};

static const bool result_pixel_assoc_is_ok { my_rect.set_pixel_assoc(768, 768) };

static_cast<void>(result_pixel_assoc_is_ok);

return my_rect;
}

auto WINAPI WinMain(_In_ ::HINSTANCE h_wnd, _In_opt_ ::HINSTANCE, _In_ LPSTR, _In_ int) -> int
{
rectangle_tuple_type rectangle_tuple(rectangle_00(), rectangle_01(), rectangle_02());
rectangle_tuple_type rectangle_tuple(rectangle_00(), rectangle_01(), rectangle_02(), rectangle_03());

local_window_type::set_rectangle_tuple(rectangle_tuple);

Expand Down
Loading

0 comments on commit 97f4974

Please sign in to comment.