9 const CalcPatternMod _pmod = WideRangeAnchor;
10 const std::string name =
"WideRangeAnchorMod";
14 float window_param = 2.F;
21 float diff_max = 16.F;
24 const std::vector<std::pair<std::string, float*>> _params{
25 {
"window_param", &window_param },
27 {
"min_mod", &min_mod },
28 {
"max_mod", &max_mod },
31 {
"diff_min", &diff_min },
32 {
"diff_max", &diff_max },
33 {
"scaler", &scaler },
35#pragma endregion params and param map
56 std::clamp(
static_cast<int>(window_param), 1, max_moving_window_size);
57 divisor =
static_cast<float>(
static_cast<int>(diff_max) -
58 static_cast<int>(diff_min));
67 a = as.get_max_for_window_and_col(col_left, window);
68 b = as.get_max_for_window_and_col(col_right, window);
70 diff = diff_high_by_low(a, b);
73 if (a == 0 && b == 0) {
79 if (a == 0 || b == 0) {
85 if (diff <=
static_cast<int>(diff_min)) {
91 if (diff >
static_cast<int>(diff_max)) {
97 base + (scaler * ((
static_cast<float>(diff) - diff_min) / divisor));
98 pmod = std::clamp(pmod, min_mod, max_mod);