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:
parent
579398ea5e
commit
cf92d42b84
|
@ -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 {}
|
||||||
|
|
Loading…
Reference in a new issue