• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ekarpp / lumo / 4788921599

pending completion
4788921599

push

github

GitHub
0.2.6 (#24)

618 of 618 new or added lines in 32 files covered. (100.0%)

1627 of 3087 relevant lines covered (52.7%)

9641000.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

12.5
/src/cli.rs
1
use crate::tracer::Integrator;
2

3
#[derive(argh::FromArgs)]
4✔
4
/// Optional CLI configuration of renderer. Renderer setter methods have priority.
5
pub struct TracerCli {
6
    /// number of samples per pixel (defaults to 1)
7
    #[argh(option, short = 's', default = "1")]
4✔
8
    pub samples: u32,
9

10
    /// number of threads used (defaults to all)
11
    #[argh(option, short = 't')]
12
    pub threads: Option<usize>,
13

14
    /// use direct light integrator instead of path tracing.
15
    #[argh(switch, short = 'd', long = "direct")]
16
    pub direct_light: bool,
17

18
    /// use bidirectional path tracing instead of path tracing.
19
    #[argh(switch, short = 'b', long = "bdpt")]
20
    pub bd_path_trace: bool,
21
}
22

23
impl TracerCli {
24
    /// Sets the configured number of threads. Called by renderer on creation.
25
    pub fn set_threads(&self) {
26
        if let Some(t) = self.threads {
×
27
            rayon::ThreadPoolBuilder::new()
×
28
                .num_threads(t)
×
29
                .build_global()
×
30
                .unwrap();
×
31
        }
×
32
    }
×
33

34
    /// Get the configured integrator.
35
    pub fn get_integrator(&self) -> Integrator {
×
36
        if self.direct_light {
×
37
            Integrator::DirectLight
×
38
        } else if self.bd_path_trace {
×
39
            Integrator::BDPathTrace
×
40
        } else {
41
            Integrator::PathTrace
×
42
        }
43
    }
×
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc