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)>,
}Expand description
Options for processing a raw image.
This struct controls the entire pipeline from raw data to the final exported image:
- Bad pixel correction (optional, on raw CFA data)
- Demosaicing (Raw -> RGB)
- White Balance
- Color Matrix
- Noise reduction (optional, on RGB data)
- Chromatic aberration correction (optional, on RGB data)
- Gamma Correction
Fields§
§demosaic: DemosaicMethodThe demosaicing method to use.
white_balance: Option<(f32, f32, f32)>White balance multipliers (R, G, B).
color_matrix: Option<[f32; 9]>Color matrix (3x3 row-major) to transform from Camera RGB to output space (e.g. sRGB).
gamma: Option<f32>Gamma correction value (e.g. 2.2).
bad_pixel_correction: Option<BadPixelCorrectionMode>Bad pixel correction mode.
When Some, bad pixels are detected and corrected on the raw CFA data
before demosaicing. Uses a threshold factor of 0.5.
denoise_sigma: Option<f32>Noise reduction bilateral filter sigma.
When Some, a bilateral filter is applied to the RGB image after
demosaicing. The value is used as both the spatial sigma (in pixels)
and a scaled range sigma (sigma * 10000). A typical value is 2.0.
ca_correction: Option<(f32, f32)>Chromatic aberration correction scale factors (red_scale, blue_scale).
When Some, the R and B channels are rescaled relative to the image
centre to correct lateral chromatic aberration. Values near 1.0 make
small corrections (e.g. (0.999, 1.001)).
Implementations§
Source§impl ProcessingOptions
impl ProcessingOptions
Sourcepub fn demosaic(self, method: DemosaicMethod) -> Self
pub fn demosaic(self, method: DemosaicMethod) -> Self
Set the demosaicing method.
Sourcepub fn white_balance(self, r: f32, g: f32, b: f32) -> Self
pub fn white_balance(self, r: f32, g: f32, b: f32) -> Self
Set white balance multipliers.
Sourcepub fn color_matrix(self, matrix: [f32; 9]) -> Self
pub fn color_matrix(self, matrix: [f32; 9]) -> Self
Set the color matrix.
Sourcepub fn bad_pixel_correction(self, mode: BadPixelCorrectionMode) -> Self
pub fn bad_pixel_correction(self, mode: BadPixelCorrectionMode) -> Self
Enable bad pixel correction with the given mode.
Sourcepub fn denoise(self, sigma: f32) -> Self
pub fn denoise(self, sigma: f32) -> Self
Enable bilateral noise reduction with the given spatial sigma.
Sourcepub fn ca_correction(self, red_scale: f32, blue_scale: f32) -> Self
pub fn ca_correction(self, red_scale: f32, blue_scale: f32) -> Self
Enable chromatic aberration correction with per-channel scale factors.
Trait Implementations§
Source§impl Clone for ProcessingOptions
impl Clone for ProcessingOptions
Source§fn clone(&self) -> ProcessingOptions
fn clone(&self) -> ProcessingOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessingOptions
impl Debug for ProcessingOptions
Source§impl Default for ProcessingOptions
impl Default for ProcessingOptions
Source§fn default() -> ProcessingOptions
fn default() -> ProcessingOptions
Source§impl<'de> Deserialize<'de> for ProcessingOptions
impl<'de> Deserialize<'de> for ProcessingOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProcessingOptions
impl RefUnwindSafe for ProcessingOptions
impl Send for ProcessingOptions
impl Sync for ProcessingOptions
impl Unpin for ProcessingOptions
impl UnsafeUnpin for ProcessingOptions
impl UnwindSafe for ProcessingOptions
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, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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