MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / Pixel

Class Pixel

olcPixelGameEngine.h:955–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers 15

operator *Method · 0.85
operator /Method · 0.85
operator +Method · 0.85
operator -Method · 0.85
invMethod · 0.85
PixelFFunction · 0.85
GetPixelMethod · 0.85
SampleBLMethod · 0.85
DrawMethod · 0.85
LoadImageResourceMethod · 0.85
LoadImageResourceMethod · 0.85

Calls

no outgoing calls

Tested by 1

OnUserUpdateMethod · 0.68