MP3
Linked Lists
RGBAPixel Class Reference

Represents a single pixel in an image. More...

#include "rgbapixel.h"

+ Collaboration diagram for RGBAPixel:

Public Member Functions

bool operator== (RGBAPixel const &other) const
 Equality operator. More...
 
bool operator!= (RGBAPixel const &other) const
 Inequality operator. More...
 
bool operator< (RGBAPixel const &other) const
 Less than operator. More...
 
 RGBAPixel ()
 Constructs a default RGBAPixel. More...
 
 RGBAPixel (uint8_t red, uint8_t green, uint8_t blue)
 Constructs an opaque RGBAPixel with the given red, green, blue color values. More...
 
 RGBAPixel (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
 Constructs an RGBAPixel with the given red, green, blue, and alpha components. More...
 

Public Attributes

uint8_t red
 Byte for the red component of the pixel. More...
 
uint8_t green
 Byte for the green component of the pixel. More...
 
uint8_t blue
 Byte for the blue component of the pixel. More...
 
uint8_t alpha
 Byte for the alpha component of the pixel. More...
 

Detailed Description

Represents a single pixel in an image.

Constructor & Destructor Documentation

◆ RGBAPixel() [1/3]

RGBAPixel::RGBAPixel ( )

Constructs a default RGBAPixel.

A default pixel is completely opaque (non-transparent) and white. Opaque implies that the alpha component of the pixel is 255. Lower values are transparent.

◆ RGBAPixel() [2/3]

RGBAPixel::RGBAPixel ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)

Constructs an opaque RGBAPixel with the given red, green, blue color values.

The alpha component of the pixel constructed should be 255.

Parameters
redRed component for the new pixel.
greenGreen component for the new pixel.
blueBlue component for the new pixel.

◆ RGBAPixel() [3/3]

RGBAPixel::RGBAPixel ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  alpha 
)

Constructs an RGBAPixel with the given red, green, blue, and alpha components.

Parameters
redRed component for the new pixel.
greenGreen component for the new pixel.
blueBlue component for the new pixel.
alphaAlpha component for the new pixel (controls transparency).

Member Function Documentation

◆ operator==()

bool RGBAPixel::operator== ( RGBAPixel const &  other) const

Equality operator.

Parameters
otherOther pixel to check equality with.

◆ operator!=()

bool RGBAPixel::operator!= ( RGBAPixel const &  other) const

Inequality operator.

Parameters
otherOther pixel to check inequality with.

◆ operator<()

bool RGBAPixel::operator< ( RGBAPixel const &  other) const

Less than operator.

Provided to give some ordering notion to RGBAPixels.

Parameters
otherOther pixel to compare with.

Member Data Documentation

◆ red

uint8_t RGBAPixel::red

Byte for the red component of the pixel.

◆ green

uint8_t RGBAPixel::green

Byte for the green component of the pixel.

◆ blue

uint8_t RGBAPixel::blue

Byte for the blue component of the pixel.

◆ alpha

uint8_t RGBAPixel::alpha

Byte for the alpha component of the pixel.


The documentation for this class was generated from the following files: