#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum Tcs {
#[allow(missing_docs)] Bt2100Linhlg,
#[allow(missing_docs)] Bt2100Linpq,
#[allow(missing_docs)] Density,
#[allow(missing_docs)] Hlg,
#[allow(missing_docs)] Linear,
#[allow(missing_docs)] Pq,
#[allow(missing_docs)] Sdr,
#[allow(missing_docs)] St20651,
#[allow(missing_docs)] St4281,
Unknown(crate::primitives::UnknownVariantValue),
}
impl std::convert::From<&str> for Tcs {
fn from(s: &str) -> Self {
match s {
"BT2100LINHLG" => Tcs::Bt2100Linhlg,
"BT2100LINPQ" => Tcs::Bt2100Linpq,
"DENSITY" => Tcs::Density,
"HLG" => Tcs::Hlg,
"LINEAR" => Tcs::Linear,
"PQ" => Tcs::Pq,
"SDR" => Tcs::Sdr,
"ST2065-1" => Tcs::St20651,
"ST428-1" => Tcs::St4281,
other => Tcs::Unknown(crate::primitives::UnknownVariantValue(other.to_owned())),
}
}
}
impl std::str::FromStr for Tcs {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(Tcs::from(s))
}
}
impl Tcs {
pub fn as_str(&self) -> &str {
match self {
Tcs::Bt2100Linhlg => "BT2100LINHLG",
Tcs::Bt2100Linpq => "BT2100LINPQ",
Tcs::Density => "DENSITY",
Tcs::Hlg => "HLG",
Tcs::Linear => "LINEAR",
Tcs::Pq => "PQ",
Tcs::Sdr => "SDR",
Tcs::St20651 => "ST2065-1",
Tcs::St4281 => "ST428-1",
Tcs::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"BT2100LINHLG",
"BT2100LINPQ",
"DENSITY",
"HLG",
"LINEAR",
"PQ",
"SDR",
"ST2065-1",
"ST428-1",
]
}
}
impl AsRef<str> for Tcs {
fn as_ref(&self) -> &str {
self.as_str()
}
}