use windows::Graphics::Capture::GraphicsCaptureItem;
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum ColorFormat {
Rgba16F = 10,
Rgba8 = 28,
Bgra8 = 87,
}
impl Default for ColorFormat {
#[inline]
fn default() -> Self {
Self::Rgba8
}
}
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum CursorCaptureSettings {
Default,
WithCursor,
WithoutCursor,
}
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum DrawBorderSettings {
Default,
WithBorder,
WithoutBorder,
}
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Settings<Flags, T: TryInto<GraphicsCaptureItem>> {
pub(crate) item: T,
pub(crate) cursor_capture: CursorCaptureSettings,
pub(crate) draw_border: DrawBorderSettings,
pub(crate) color_format: ColorFormat,
pub(crate) flags: Flags,
}
impl<Flags, T: TryInto<GraphicsCaptureItem>> Settings<Flags, T> {
#[must_use]
#[inline]
pub const fn new(
item: T,
cursor_capture: CursorCaptureSettings,
draw_border: DrawBorderSettings,
color_format: ColorFormat,
flags: Flags,
) -> Self {
Self {
item,
cursor_capture,
draw_border,
color_format,
flags,
}
}
#[must_use]
#[inline]
pub const fn item(&self) -> &T {
&self.item
}
#[must_use]
#[inline]
pub const fn cursor_capture(&self) -> CursorCaptureSettings {
self.cursor_capture
}
#[must_use]
#[inline]
pub const fn draw_border(&self) -> DrawBorderSettings {
self.draw_border
}
#[must_use]
#[inline]
pub const fn color_format(&self) -> ColorFormat {
self.color_format
}
#[must_use]
#[inline]
pub const fn flags(&self) -> &Flags {
&self.flags
}
}