use crate::VideoMode;
#[cfg(any(feature = "alloc", feature = "std"))]
use crate::prelude::Vec;
#[non_exhaustive]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct T7VtdbBlock {
pub version: u8,
pub mode: VideoMode,
pub y420: bool,
}
impl T7VtdbBlock {
pub fn new(version: u8, mode: VideoMode, y420: bool) -> Self {
Self {
version,
mode,
y420,
}
}
}
#[non_exhaustive]
#[cfg(any(feature = "alloc", feature = "std"))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct T8VtdbBlock {
pub version: u8,
pub y420: bool,
pub codes: Vec<u16>,
pub timings: Vec<VideoMode>,
}
#[cfg(any(feature = "alloc", feature = "std"))]
impl T8VtdbBlock {
pub fn new(version: u8, y420: bool, codes: Vec<u16>, timings: Vec<VideoMode>) -> Self {
Self {
version,
y420,
codes,
timings,
}
}
}
#[non_exhaustive]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct T10VtdbEntry {
pub width: u16,
pub height: u16,
pub refresh_hz: u16,
pub y420: bool,
}
impl T10VtdbEntry {
pub fn new(width: u16, height: u16, refresh_hz: u16, y420: bool) -> Self {
Self {
width,
height,
refresh_hz,
y420,
}
}
}
#[non_exhaustive]
#[cfg(any(feature = "alloc", feature = "std"))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct T10VtdbBlock {
pub entries: Vec<T10VtdbEntry>,
}
#[cfg(any(feature = "alloc", feature = "std"))]
impl T10VtdbBlock {
pub fn new(entries: Vec<T10VtdbEntry>) -> Self {
Self { entries }
}
}
#[non_exhaustive]
#[cfg(any(feature = "alloc", feature = "std"))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct VtbExtBlock {
pub version: u8,
pub timings: Vec<VideoMode>,
}
#[cfg(any(feature = "alloc", feature = "std"))]
impl VtbExtBlock {
pub fn new(version: u8, timings: Vec<VideoMode>) -> Self {
Self { version, timings }
}
}