mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user