use std::fmt::Debug;
use Scalar;
pub trait Pixel: Copy + Clone + Debug + PartialEq<Self> {
fn calc_minimum_pitch(width: u32, height: u32) -> usize;
fn calc_size_in_bytes(width: u32, height: u32, pitch: u32) -> Option<usize>;
fn load_from_raw_buffer(x: u32, y: u32, pitch: u32, buffer: &[u8]) -> Self;
fn write_into_raw_buffer(&self, x: u32, y: u32, pitch: u32, buffer: &mut [u8]);
}
pub trait PixelArithmetic: Pixel {
type ScalarT: Scalar;
fn add_px_px(self, rhs: Self) -> Self;
fn sub_px_px(self, rhs: Self) -> Self;
fn mul_px_px(self, rhs: Self) -> Self;
fn div_px_px(self, rhs: Self) -> Self;
fn add_px_sc(self, rhs: Self::ScalarT) -> Self;
fn sub_px_sc(self, rhs: Self::ScalarT) -> Self;
fn mul_px_sc(self, rhs: Self::ScalarT) -> Self;
fn div_px_sc(self, rhs: Self::ScalarT) -> Self;
fn add_sc_px(self, lhs: Self::ScalarT) -> Self;
fn sub_sc_px(self, lhs: Self::ScalarT) -> Self;
fn mul_sc_px(self, lhs: Self::ScalarT) -> Self;
fn div_sc_px(self, lhs: Self::ScalarT) -> Self;
}