From cf92d42b84a5ed4c60800a64a41eadbac10b22bd Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 3 May 2023 16:57:13 -0400 Subject: [PATCH] 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 --- ggdt/src/graphics/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ggdt/src/graphics/mod.rs b/ggdt/src/graphics/mod.rs index 4cdfc0e..23caa6c 100644 --- a/ggdt/src/graphics/mod.rs +++ b/ggdt/src/graphics/mod.rs @@ -1,4 +1,3 @@ -use num_traits::{PrimInt, Unsigned}; use std::fmt::Display; mod bitmap; @@ -16,5 +15,5 @@ pub use font::*; pub use palette::*; /// Common trait to represent single pixel/colour values. -pub trait Pixel: PrimInt + Unsigned + Default + Display {} -impl Pixel for T where T: PrimInt + Unsigned + Default + Display {} +pub trait Pixel: Default + Display + Eq + Copy + Clone {} +impl Pixel for T where T: Default + Display + Eq + Copy + Clone {}