MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / operator +

Method operator +

olcPixelGameEngine.h:1917–1923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1915 }
1916
1917 Pixel Pixel::operator + (const Pixel& p) const
1918 {
1919 uint8_t nR = uint8_t(std::min(255, std::max(0, int(r) + int(p.r))));
1920 uint8_t nG = uint8_t(std::min(255, std::max(0, int(g) + int(p.g))));
1921 uint8_t nB = uint8_t(std::min(255, std::max(0, int(b) + int(p.b))));
1922 return Pixel(nR, nG, nB, a);
1923 }
1924
1925 Pixel Pixel::operator - (const Pixel& p) const
1926 {

Callers

nothing calls this directly

Calls 1

PixelClass · 0.85

Tested by

no test coverage detected