Implement Debug manually for ColorSpace

This commit is contained in:
Ivan Smirnov 2021-12-01 17:17:12 +00:00
parent 0d612fd3c2
commit bfbf032fff

View file

@ -1,4 +1,6 @@
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] use std::fmt::{self, Debug};
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub struct ColorSpace { pub struct ColorSpace {
pub r_linear: bool, pub r_linear: bool,
pub g_linear: bool, pub g_linear: bool,
@ -56,3 +58,13 @@ impl From<ColorSpace> for u8 {
value.to_u8() value.to_u8()
} }
} }
impl Debug for ColorSpace {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"ColorSpace({}{}{}{})",
self.r_linear as u8, self.g_linear as u8, self.b_linear as u8, self.a_linear as u8
)
}
}