Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate image;
- extern crate num;
- pub trait ColourVal: num::Float + image::Primitive {}
- #[derive(Clone, Copy, Debug, PartialEq)]
- pub struct RgbPixel<T>(pub image::Rgb<T>) where T: ColourVal;
- impl <T> RgbPixel<T> where T: ColourVal {
- pub fn new(r: T, g: T, b: T) -> RgbPixel<T> where T: ColourVal {
- RgbPixel(image::Rgb {data: [r, g, b]})
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement