Derive PartialOrd/Ord for Channels and ColorSpace

This commit is contained in:
Ivan Smirnov 2022-01-03 13:41:54 +03:00
parent fb8a43fd13
commit e3184aed01

View file

@ -7,7 +7,7 @@ use crate::utils::unlikely;
/// ///
/// Note: the color space is purely informative. Although it is saved to the /// Note: the color space is purely informative. Although it is saved to the
/// file header, it does not affect encoding/decoding in any way. /// file header, it does not affect encoding/decoding in any way.
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
#[repr(u8)] #[repr(u8)]
pub enum ColorSpace { pub enum ColorSpace {
/// sRGB with linear alpha /// sRGB with linear alpha
@ -56,7 +56,7 @@ impl TryFrom<u8> for ColorSpace {
} }
} }
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, PartialOrd, Ord)]
#[repr(u8)] #[repr(u8)]
pub enum Channels { pub enum Channels {
/// Three 8-bit channels (RGB) /// Three 8-bit channels (RGB)