olcPixelGameEngine v2.28
The official distribution of olcPixelGameEngine, a tool used in javidx9's YouTube videos and projects
Loading...
Searching...
No Matches
olc::Pixel Struct Reference

#include <olcPixelGameEngine.h>

Public Types

enum  Mode { NORMAL , MASK , ALPHA , CUSTOM }
 

Public Member Functions

 Pixel ()
 
 Pixel (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=nDefaultAlpha)
 
 Pixel (uint32_t p)
 
Pixeloperator= (const Pixel &v)=default
 
bool operator== (const Pixel &p) const
 
bool operator!= (const Pixel &p) const
 
Pixel operator* (const float i) const
 
Pixel operator/ (const float i) const
 
Pixeloperator*= (const float i)
 
Pixeloperator/= (const float i)
 
Pixel operator+ (const Pixel &p) const
 
Pixel operator- (const Pixel &p) const
 
Pixeloperator+= (const Pixel &p)
 
Pixeloperator-= (const Pixel &p)
 
Pixel operator* (const Pixel &p) const
 
Pixeloperator*= (const Pixel &p)
 
Pixel inv () const
 

Public Attributes

union { 
 
   uint32_t   n = nDefaultPixel 
 
   struct { 
 
      uint8_t   r 
 
      uint8_t   g 
 
      uint8_t   b 
 
      uint8_t   a 
 
   }  
 
};  
 

Member Enumeration Documentation

◆ Mode

Enumerator
NORMAL 
MASK 
ALPHA 
CUSTOM 

Constructor & Destructor Documentation

◆ Pixel() [1/3]

olc::Pixel::Pixel ( )

◆ Pixel() [2/3]

olc::Pixel::Pixel ( uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha = nDefaultAlpha )

◆ Pixel() [3/3]

olc::Pixel::Pixel ( uint32_t p)

Member Function Documentation

◆ inv()

Pixel olc::Pixel::inv ( ) const

◆ operator!=()

bool olc::Pixel::operator!= ( const Pixel & p) const

◆ operator*() [1/2]

Pixel olc::Pixel::operator* ( const float i) const

◆ operator*() [2/2]

Pixel olc::Pixel::operator* ( const Pixel & p) const

◆ operator*=() [1/2]

Pixel & olc::Pixel::operator*= ( const float i)

◆ operator*=() [2/2]

Pixel & olc::Pixel::operator*= ( const Pixel & p)

◆ operator+()

Pixel olc::Pixel::operator+ ( const Pixel & p) const

◆ operator+=()

Pixel & olc::Pixel::operator+= ( const Pixel & p)

◆ operator-()

Pixel olc::Pixel::operator- ( const Pixel & p) const

◆ operator-=()

Pixel & olc::Pixel::operator-= ( const Pixel & p)

◆ operator/()

Pixel olc::Pixel::operator/ ( const float i) const

◆ operator/=()

Pixel & olc::Pixel::operator/= ( const float i)

◆ operator=()

Pixel & olc::Pixel::operator= ( const Pixel & v)
default

◆ operator==()

bool olc::Pixel::operator== ( const Pixel & p) const

Member Data Documentation

◆ [union]

union { ... } olc::Pixel

◆ a

uint8_t olc::Pixel::a

◆ b

uint8_t olc::Pixel::b

◆ g

uint8_t olc::Pixel::g

◆ n

uint32_t olc::Pixel::n = nDefaultPixel

◆ r

uint8_t olc::Pixel::r

The documentation for this struct was generated from the following file: