use crate::processing::demosaic::DemosaicMethod;
use crate::transforms::BadPixelCorrectionMode;
#[derive(Clone, Debug, Default)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ProcessingOptions {
pub demosaic: DemosaicMethod,
pub white_balance: Option<(f32, f32, f32)>,
pub color_matrix: Option<[f32; 9]>,
pub gamma: Option<f32>,
pub bad_pixel_correction: Option<BadPixelCorrectionMode>,
pub denoise_sigma: Option<f32>,
pub ca_correction: Option<(f32, f32)>,
}
impl ProcessingOptions {
pub fn new() -> Self {
Self::default()
}
pub fn demosaic(mut self, method: DemosaicMethod) -> Self {
self.demosaic = method;
self
}
pub fn white_balance(mut self, r: f32, g: f32, b: f32) -> Self {
self.white_balance = Some((r, g, b));
self
}
pub fn color_matrix(mut self, matrix: [f32; 9]) -> Self {
self.color_matrix = Some(matrix);
self
}
pub fn gamma(mut self, gamma: f32) -> Self {
self.gamma = Some(gamma);
self
}
pub fn bad_pixel_correction(mut self, mode: BadPixelCorrectionMode) -> Self {
self.bad_pixel_correction = Some(mode);
self
}
pub fn denoise(mut self, sigma: f32) -> Self {
self.denoise_sigma = Some(sigma);
self
}
pub fn ca_correction(mut self, red_scale: f32, blue_scale: f32) -> Self {
self.ca_correction = Some((red_scale, blue_scale));
self
}
}