pub struct ProcessState {
pub config: ProcessConfig,
pub background: Option<Vec<f64>>,
pub flat_field: Option<Vec<f64>>,
pub filter_state: Option<Vec<f64>>,
pub filter_state_prev: Option<Vec<Vec<f64>>>,
pub output_state: Option<Vec<f64>>,
pub output_state_prev: Option<Vec<f64>>,
pub num_filtered: usize,
}Expand description
State for the process plugin (holds background, flat field, and filter history).
Fields§
§config: ProcessConfig§background: Option<Vec<f64>>§flat_field: Option<Vec<f64>>§filter_state: Option<Vec<f64>>F_{n-1}: most recent filter state.
filter_state_prev: Option<Vec<Vec<f64>>>[F_{n-2}, F_{n-3}]: older filter history.
output_state: Option<Vec<f64>>O_{n-1}: most recent output state.
output_state_prev: Option<Vec<f64>>O_{n-2}: previous output state.
num_filtered: usizeNumber of frames filtered since last reset.
Implementations§
Source§impl ProcessState
impl ProcessState
pub fn new(config: ProcessConfig) -> Self
Sourcepub fn save_background(&mut self, array: &NDArray)
pub fn save_background(&mut self, array: &NDArray)
Save the current array as background.
Sourcepub fn save_flat_field(&mut self, array: &NDArray)
pub fn save_flat_field(&mut self, array: &NDArray)
Save the current array as flat field.
Sourcepub fn auto_offset_scale(&mut self, array: &NDArray)
pub fn auto_offset_scale(&mut self, array: &NDArray)
Auto-calculate offset and scale so that the output range fits the output data type. Sets offset = -min*scale, scale = max_out_range / (max - min).
Sourcepub fn apply_filter_type(&mut self, filter_type: i32)
pub fn apply_filter_type(&mut self, filter_type: i32)
Apply a named filter type preset, setting the FC/OC/RC coefficients.
Sourcepub fn reset_filter(&mut self)
pub fn reset_filter(&mut self)
Reset the filter state, clearing all history buffers.
Auto Trait Implementations§
impl Freeze for ProcessState
impl RefUnwindSafe for ProcessState
impl Send for ProcessState
impl Sync for ProcessState
impl Unpin for ProcessState
impl UnsafeUnpin for ProcessState
impl UnwindSafe for ProcessState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more