use std::collections::hash_map::Iter; use librashader_runtime::parameters::FilterChainParameters; use crate::FilterChain; impl FilterChainParameters for FilterChain { fn get_enabled_pass_count(&self) -> usize { self.common.config.passes_enabled } fn set_enabled_pass_count(&mut self, count: usize) { self.common.config.passes_enabled = count } fn enumerate_parameters(&self) -> Iter { self.common.config.parameters.iter() } fn get_parameter(&self, parameter: &str) -> Option { self.common.config.parameters.get::(parameter.as_ref()).copied() } fn set_parameter(&mut self, parameter: &str, new_value: f32) -> Option { if let Some(value) = self.common.config.parameters.get_mut::(parameter.as_ref()) { let old = *value; *value = new_value; Some(old) } else { None } } }