pub struct ProcessState {
pub config: ProcessConfig,
pub background: Option<Vec<f64>>,
pub flat_field: Option<Vec<f64>>,
pub filter_state: Option<Vec<f64>>,
pub num_filtered: usize,
}Expand description
State for the process plugin (holds background, flat field, and filter state).
Matches the C++ NDPluginProcess which uses a single pFilter array.
Fields§
§config: ProcessConfig§background: Option<Vec<f64>>§flat_field: Option<Vec<f64>>§filter_state: Option<Vec<f64>>Single filter buffer (equivalent to C++ pFilter).
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 matching C++ NDPluginProcess.
C++: scale = maxScale / (maxValue - minValue); offset = -minValue; Also enables offset/scale processing and clipping (matching C++ lines 238-249).
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.
Uses the C++ coefficient scheme where: O1 = oScale * (oc[0] + oc[1]/N), O2 = oScale * (oc[2] + oc[3]/N) F1 = fScale * (fc[0] + fc[1]/N), F2 = fScale * (fc[2] + fc[3]/N) data[i] = oOffset + O1filter[i] + O2data[i] filter[i] = fOffset + F1filter[i] + F2data[i]
Sourcepub fn reset_filter(&mut self)
pub fn reset_filter(&mut self)
Reset the filter state, clearing the filter buffer.
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
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>
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>
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