| 953 | // O------------------------------------------------------------------------------O |
| 954 | #if !defined(OLC_IGNORE_PIXEL) |
| 955 | struct Pixel |
| 956 | { |
| 957 | union |
| 958 | { |
| 959 | uint32_t n = nDefaultPixel; |
| 960 | struct { uint8_t r; uint8_t g; uint8_t b; uint8_t a; }; |
| 961 | }; |
| 962 | |
| 963 | enum Mode { NORMAL, MASK, ALPHA, CUSTOM }; |
| 964 | |
| 965 | Pixel(); |
| 966 | Pixel(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha = nDefaultAlpha); |
| 967 | Pixel(uint32_t p); |
| 968 | Pixel& operator = (const Pixel& v) = default; |
| 969 | bool operator ==(const Pixel& p) const; |
| 970 | bool operator !=(const Pixel& p) const; |
| 971 | Pixel operator * (const float i) const; |
| 972 | Pixel operator / (const float i) const; |
| 973 | Pixel& operator *=(const float i); |
| 974 | Pixel& operator /=(const float i); |
| 975 | Pixel operator + (const Pixel& p) const; |
| 976 | Pixel operator - (const Pixel& p) const; |
| 977 | Pixel& operator +=(const Pixel& p); |
| 978 | Pixel& operator -=(const Pixel& p); |
| 979 | Pixel operator * (const Pixel& p) const; |
| 980 | Pixel& operator *=(const Pixel& p); |
| 981 | Pixel inv() const; |
| 982 | }; |
| 983 | |
| 984 | Pixel PixelF(float red, float green, float blue, float alpha = 1.0f); |
| 985 | Pixel PixelLerp(const olc::Pixel& p1, const olc::Pixel& p2, float t); |
no outgoing calls