moq_video/resize.rs
1//! Frame resizing options.
2
3/// Options for [`Frame::resize_with`](crate::Frame::resize_with).
4///
5/// Build with `Config::default()` and set fields, so future options stay
6/// additive.
7#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
8#[non_exhaustive]
9pub struct Config {
10 /// Whether to prefer GPU or CPU scaling.
11 pub acceleration: Acceleration,
12}
13
14/// Which device should scale a frame when both paths are available.
15#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
16#[non_exhaustive]
17pub enum Acceleration {
18 /// Use the platform default.
19 ///
20 /// GPU-backed surfaces stay on the GPU on every supported platform.
21 #[default]
22 Auto,
23 /// Always download GPU surfaces and scale on the CPU.
24 Cpu,
25 /// Scale on the GPU where supported, falling back to the CPU on an error.
26 Gpu,
27}