ferroui_linuxframebuffer/output/fb_dev_output_options.rs
1//! The options of the framebuffer device output (the port of
2//! `FbDevOutputOptions.cs`).
3
4use ferroui_base::platform::PixelFormat;
5
6/// FbDev output options.
7#[derive(Clone, Debug, PartialEq)]
8pub struct FbDevOutputOptions {
9 /// The frame buffer device name. Defaults to the value in the
10 /// environment variable FRAMEBUFFER, or /dev/fb0 when FRAMEBUFFER is
11 /// not set.
12 pub file_name: Option<String>,
13 /// The desired pixel format. When not set the format of the device is
14 /// used.
15 pub pixel_format: Option<PixelFormat>,
16 /// Render directly to the mapped memory of the device instead of to a
17 /// back buffer that is copied after the vertical sync.
18 pub render_directly_to_mapped_memory: bool,
19 /// The initial scale factor to use.
20 pub scaling: f64,
21 /// When true, the wait for the vertical sync and the copy that follows
22 /// run on a dedicated thread, saving the rendering thread from a
23 /// blocking wait. Only has an effect when
24 /// `render_directly_to_mapped_memory` is false.
25 pub use_async_front_buffer_blit: Option<bool>,
26}
27
28impl Default for FbDevOutputOptions {
29 fn default() -> Self {
30 Self {
31 file_name: None,
32 pixel_format: None,
33 render_directly_to_mapped_memory: false,
34 scaling: 1.0,
35 use_async_front_buffer_blit: None,
36 }
37 }
38}