using System; namespace Orvid.Graphics { /// /// This class describes a single pixel. /// public class Pixel { /// /// The byte that describes the amount of Red in the pixel. /// public byte R; /// /// The byte that describes the amount of Green in the pixel. /// public byte G; /// /// The byte that describes the amount of Blue in the pixel. /// public byte B; /// /// The byte that describes the transparency of the pixel. /// public byte A; public static bool operator !=(Pixel a, Pixel b) { if (!(a is Pixel) || !(b is Pixel)) { if (!(a is Pixel) && !(b is Pixel)) return false; return true; } else { if (a.A != b.A || a.B != b.B || a.G != b.G || a.R != b.R) return true; return false; } } public static bool operator ==(Pixel a, Pixel b) { if (!(a is Pixel) || !(b is Pixel)) { if (!(a is Pixel) && !(b is Pixel)) return true; return false; } else { if (a.A != b.A || a.B != b.B || a.G != b.G || a.R != b.R) return false; return true; } } public override bool Equals(object obj) { return (this == (Pixel)obj); } public override int GetHashCode() { return 0; } } }