update Pixel trait to just the bare minimum requirements

our target is IndexedBitmap's will use PixelType=u8 and
RgbaBitmap's will use PixelType=ARGBu8x4

thus, restricting the Pixel trait to primitive unsigned numerics won't
work anymore, but we do still need to support basic stuff like
equality testing and copy/clone support for our generic bitmap
operations
This commit is contained in:
Gered 2023-05-03 16:57:13 -04:00
parent 579398ea5e
commit cf92d42b84

View file

@ -1,4 +1,3 @@
use num_traits::{PrimInt, Unsigned};
use std::fmt::Display; use std::fmt::Display;
mod bitmap; mod bitmap;
@ -16,5 +15,5 @@ pub use font::*;
pub use palette::*; pub use palette::*;
/// Common trait to represent single pixel/colour values. /// Common trait to represent single pixel/colour values.
pub trait Pixel: PrimInt + Unsigned + Default + Display {} pub trait Pixel: Default + Display + Eq + Copy + Clone {}
impl<T> Pixel for T where T: PrimInt + Unsigned + Default + Display {} impl<T> Pixel for T where T: Default + Display + Eq + Copy + Clone {}