OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
Pixel Struct Reference

Pixel in 3-byte packed RGB format. More...

#include <SimWheelTypes.hpp>

Public Member Functions

 operator uint32_t () const noexcept
 Convert to packed RGB format.
 
 operator int () const noexcept
 Convert to packed RGB format.
 
 Pixel (uint32_t packedRGB) noexcept
 Create from a packed RGB value.
 
 Pixel () noexcept
 Create as a black pixel.
 
 Pixel (const Pixel &source)=default
 Copy-constructor.
 
 Pixel (Pixel &&source)=default
 Move-constructor.
 
Pixeloperator= (uint32_t packedRGB) noexcept
 Assign a packed RGB color.
 
Pixeloperator= (const Pixel &source)=default
 Copy-assignment.
 
Pixeloperator= (Pixel &&source)=default
 Move-assignment.
 
bool operator== (uint32_t packedRGB) const noexcept
 Compare to a packed RGB color.
 
bool operator== (int packedRGB) const noexcept
 Compare to a packed RGB color.
 
bool operator== (const Pixel &other) const noexcept
 Compare to another pixel.
 
bool operator!= (uint32_t packedRGB) const noexcept
 Compare to a packed RGB color.
 
bool operator!= (int packedRGB) const noexcept
 Compare to a packed RGB color.
 
bool operator!= (const Pixel &other) const noexcept
 Compare to another pixel.
 
uint8_t byte0 (PixelFormat format) const noexcept
 Get the first color channel in a certain pixel format.
 
uint8_t byte1 (PixelFormat format) const noexcept
 Get the second color channel in a certain pixel format.
 
uint8_t byte2 (PixelFormat format) const noexcept
 Get the third color channel in a certain pixel format.
 

Public Attributes

uint8_t blue
 Blue channel.
 
uint8_t green
 Green channel.
 
uint8_t red
 Red channel.
 

Detailed Description

Pixel in 3-byte packed RGB format.

Definition at line 1331 of file SimWheelTypes.hpp.

Constructor & Destructor Documentation

◆ Pixel() [1/4]

Pixel::Pixel ( uint32_t packedRGB)
inlinenoexcept

Create from a packed RGB value.

Parameters
packedRGBPacked RGB value

Definition at line 1365 of file SimWheelTypes.hpp.

◆ Pixel() [2/4]

Pixel::Pixel ( )
inlinenoexcept

Create as a black pixel.

Definition at line 1376 of file SimWheelTypes.hpp.

◆ Pixel() [3/4]

Pixel::Pixel ( const Pixel & source)
default

Copy-constructor.

Parameters
sourceInstance to be copied

◆ Pixel() [4/4]

Pixel::Pixel ( Pixel && source)
default

Move-constructor.

Parameters
sourceInstance transferring ownership

Member Function Documentation

◆ byte0()

uint8_t Pixel::byte0 ( PixelFormat format) const
inlinenoexcept

Get the first color channel in a certain pixel format.

Parameters
formatPixel format
Returns
uint8_t Color channel

Definition at line 1497 of file SimWheelTypes.hpp.

◆ byte1()

uint8_t Pixel::byte1 ( PixelFormat format) const
inlinenoexcept

Get the second color channel in a certain pixel format.

Parameters
formatPixel format
Returns
uint8_t Color channel

Definition at line 1523 of file SimWheelTypes.hpp.

◆ byte2()

uint8_t Pixel::byte2 ( PixelFormat format) const
inlinenoexcept

Get the third color channel in a certain pixel format.

Parameters
formatPixel format
Returns
uint8_t Color channel

Definition at line 1549 of file SimWheelTypes.hpp.

◆ operator int()

Pixel::operator int ( ) const
inlinenoexcept

Convert to packed RGB format.

Returns
int Packed RGB value

Definition at line 1355 of file SimWheelTypes.hpp.

◆ operator uint32_t()

Pixel::operator uint32_t ( ) const
inlinenoexcept

Convert to packed RGB format.

Returns
uint32_t Packed RGB value

Definition at line 1345 of file SimWheelTypes.hpp.

◆ operator!=() [1/3]

bool Pixel::operator!= ( const Pixel & other) const
inlinenoexcept

Compare to another pixel.

Parameters
otherOther pixel
Returns
true If this pixel does not match other
false Otherwise

Definition at line 1484 of file SimWheelTypes.hpp.

◆ operator!=() [2/3]

bool Pixel::operator!= ( int packedRGB) const
inlinenoexcept

Compare to a packed RGB color.

Parameters
packedRGBPacked RGB value
Returns
true If this pixel does not match packedRGB
false Otherwise

Definition at line 1472 of file SimWheelTypes.hpp.

◆ operator!=() [3/3]

bool Pixel::operator!= ( uint32_t packedRGB) const
inlinenoexcept

Compare to a packed RGB color.

Parameters
packedRGBPacked RGB value
Returns
true If this pixel does not match packedRGB
false Otherwise

Definition at line 1460 of file SimWheelTypes.hpp.

◆ operator=() [1/3]

Pixel & Pixel::operator= ( const Pixel & source)
default

Copy-assignment.

Parameters
sourceInstance to be copied
Returns
This instance

◆ operator=() [2/3]

Pixel & Pixel::operator= ( Pixel && source)
default

Move-assignment.

Parameters
sourceInstance transferring ownership
Returns
This instance

◆ operator=() [3/3]

Pixel & Pixel::operator= ( uint32_t packedRGB)
inlinenoexcept

Assign a packed RGB color.

Parameters
packedRGBPacked RGB value
Returns
int Non-zero

Definition at line 1397 of file SimWheelTypes.hpp.

◆ operator==() [1/3]

bool Pixel::operator== ( const Pixel & other) const
inlinenoexcept

Compare to another pixel.

Parameters
otherOther pixel
Returns
true If this pixel matches other
false Otherwise

Definition at line 1446 of file SimWheelTypes.hpp.

◆ operator==() [2/3]

bool Pixel::operator== ( int packedRGB) const
inlinenoexcept

Compare to a packed RGB color.

Parameters
packedRGBPacked RGB value
Returns
true If this pixel matches packedRGB
false Otherwise

Definition at line 1434 of file SimWheelTypes.hpp.

◆ operator==() [3/3]

bool Pixel::operator== ( uint32_t packedRGB) const
inlinenoexcept

Compare to a packed RGB color.

Parameters
packedRGBPacked RGB value
Returns
true If this pixel matches packedRGB
false Otherwise

Definition at line 1422 of file SimWheelTypes.hpp.

Member Data Documentation

◆ blue

uint8_t Pixel::blue

Blue channel.

Definition at line 1334 of file SimWheelTypes.hpp.

◆ green

uint8_t Pixel::green

Green channel.

Definition at line 1336 of file SimWheelTypes.hpp.

◆ red

uint8_t Pixel::red

Red channel.

Definition at line 1338 of file SimWheelTypes.hpp.


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