Skip to main content

mcraw_tui/
grading.rs

1/// Per-file grading adjustments, stored as JSON sidecars alongside source
2/// MCRAW files. Each field defaults to "no-op" (0.0 or false) so that a
3/// file without a sidecar renders identically to the baked-in decode.
4#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
5pub struct RawAdjustments {
6    pub enabled: bool,
7    pub exposure_stops: f32,
8    pub white_balance_kelvin: u16,
9    pub white_balance_tint: f32,
10    pub lift_r: f32,
11    pub lift_g: f32,
12    pub lift_b: f32,
13    pub gamma_r: f32,
14    pub gamma_g: f32,
15    pub gamma_b: f32,
16    pub gain_r: f32,
17    pub gain_g: f32,
18    pub gain_b: f32,
19    pub contrast: f32,
20    pub saturation: f32,
21}
22
23impl Default for RawAdjustments {
24    fn default() -> Self {
25        Self {
26            enabled: false,
27            exposure_stops: 0.0,
28            white_balance_kelvin: 5500,
29            white_balance_tint: 0.0,
30            lift_r: 0.0, lift_g: 0.0, lift_b: 0.0,
31            gamma_r: 1.0, gamma_g: 1.0, gamma_b: 1.0,
32            gain_r: 1.0, gain_g: 1.0, gain_b: 1.0,
33            contrast: 1.0,
34            saturation: 1.0,
35        }
36    }
37}