Skip to main content

tanim_cli/video/
config.rs

1use std::collections::HashMap;
2#[cfg(feature = "typst-lib")]
3use std::sync::{Arc, Mutex};
4#[cfg(feature = "typst-lib")]
5use tinymist_world::TypstSystemUniverse;
6#[cfg(feature = "typst-lib")]
7use typst::foundations::Dict;
8
9#[cfg(not(any(feature = "typst-lib", feature = "typst-bin")))]
10compile_error!("At least one of 'typst-lib' or 'typst-bin' features must be enabled");
11
12pub struct RenderConfig {
13    #[cfg(all(feature = "typst-lib", not(feature = "typst-bin")))]
14    pub universe: Arc<Mutex<TypstSystemUniverse>>,
15    #[cfg(all(feature = "typst-lib", feature = "typst-bin"))]
16    pub universe: Option<Arc<Mutex<TypstSystemUniverse>>>,
17
18    pub ppi: f32,
19    #[cfg(feature = "typst-lib")]
20    pub f_input: Box<dyn Fn(i32) -> Dict + 'static + Send + Sync>,
21
22    #[cfg(feature = "typst-bin")]
23    pub typst_command: Option<String>,
24    #[cfg(feature = "typst-bin")]
25    pub input_path: String,
26    #[cfg(feature = "typst-bin")]
27    pub variable: String,
28
29    pub ffmpeg_options: HashMap<String, String>,
30    pub begin_t: i32,
31    pub end_t: i32,
32    pub fps: u32,
33    pub rendering_threads: Option<usize>,
34    pub encoding_threads: Option<usize>,
35    pub zstd_level: Option<i32>,
36    #[cfg(feature = "ffmpeg-bin")]
37    pub ffmpeg_path: Option<String>,
38}