polyscope_core/
tone_mapping.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct ToneMappingConfig {
8 pub exposure: f32,
10 pub white_level: f32,
12 pub gamma: f32,
14}
15
16impl Default for ToneMappingConfig {
17 fn default() -> Self {
18 Self {
19 exposure: 1.0,
20 white_level: 1.0,
21 gamma: 2.2,
22 }
23 }
24}
25
26impl ToneMappingConfig {
27 #[must_use]
29 pub fn new() -> Self {
30 Self::default()
31 }
32
33 #[must_use]
35 pub fn with_exposure(mut self, exposure: f32) -> Self {
36 self.exposure = exposure;
37 self
38 }
39
40 #[must_use]
42 pub fn with_white_level(mut self, white_level: f32) -> Self {
43 self.white_level = white_level;
44 self
45 }
46
47 #[must_use]
49 pub fn with_gamma(mut self, gamma: f32) -> Self {
50 self.gamma = gamma;
51 self
52 }
53}