ENH: update flush table

1. For cases where light color switch to dark color, multiply the value
with 1.3

jira : NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I6b5b2f8e9578d031bbf830ecf18f0069865af2e6
(cherry picked from commit cfa54c55058cd9ed2bd76de7a1158b06bf3501a9)
This commit is contained in:
xun.zhang
2025-03-24 11:19:47 +08:00
committed by Noisyfox
parent 7964fb1a63
commit 3794d2bbfc
3 changed files with 35 additions and 2 deletions

View File

@@ -124,6 +124,14 @@ int FlushVolCalculator::calc_flush_vol(unsigned char src_a, unsigned char src_r,
flush_volume = calc_flush_vol_rgb(src_r, src_g, src_b, dst_r, dst_g, dst_b);
constexpr float dark_color_thres = 180.f/255.f;
constexpr float light_color_thres = 75.f/255.f;
bool is_from_dark = get_luminance(src_r, src_g, src_b) > dark_color_thres;
bool is_to_light = get_luminance(dst_r, dst_g, dst_b) < light_color_thres;
if (m_machine_type != FlushPredict::Standard && is_from_dark && is_to_light)
flush_volume *= 1.3;
flush_volume += m_min_flush_vol;
return std::min((int)flush_volume, m_max_flush_vol);
}