![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Represents an RGB color and provides methods for manipulation. More...
#include <RGBColor.h>
Public Member Functions | |
RGBColor () | |
Default constructor initializes the color to black (0, 0, 0). | |
RGBColor (const uint8_t &R, const uint8_t &G, const uint8_t &B) | |
Constructor to initialize RGBColor with specified R, G, and B values. | |
RGBColor (const RGBColor &rgbColor) | |
Copy constructor. | |
RGBColor (const Vector3D &color) | |
Constructor to initialize RGBColor from a Vector3D. | |
void | SetColor (const uint8_t &R, const uint8_t &G, const uint8_t &B) |
Sets the RGB values of the color. | |
RGBColor | Scale (const uint8_t &maxBrightness) |
Scales the brightness of the color to a maximum value. | |
RGBColor | Add (const uint8_t &value) |
Adds a value to each RGB component of the color. | |
RGBColor | HueShift (const float &hueDeg) |
Shifts the hue of the color by a specified angle in degrees. | |
String | ToString () |
Converts the RGBColor to a string representation. | |
RGBColor () | |
Default constructor initializes the color to black (0, 0, 0). | |
RGBColor (uint8_t R, uint8_t G, uint8_t B) | |
Constructor to initialize RGBColor with specified R, G, and B values. | |
RGBColor (const RGBColor &rgbColor) | |
Copy constructor. | |
RGBColor (Vector3D color) | |
Constructor to initialize RGBColor from a Vector3D. | |
void | SetColor (uint8_t R, uint8_t G, uint8_t B) |
Sets the RGB values of the color. | |
RGBColor | Scale (uint8_t maxBrightness) |
Scales the brightness of the color to a maximum value. | |
RGBColor | Add (uint8_t value) |
Adds a value to each RGB component of the color. | |
RGBColor | HueShift (float hueDeg) |
Shifts the hue of the color by a specified angle in degrees. | |
String | ToString () |
Converts the RGBColor to a string representation. | |
Static Public Member Functions | |
static RGBColor | InterpolateColors (const RGBColor &a, const RGBColor &b, const float &ratio) |
Interpolates between two colors based on a ratio. | |
static RGBColor | InterpolateColors (RGBColor a, RGBColor b, float ratio) |
Interpolates between two colors based on a ratio. | |
Public Attributes | |
uint8_t | R = 0 |
Red component of the color (0-255). | |
uint8_t | G = 0 |
Green component of the color (0-255). | |
uint8_t | B = 0 |
Blue component of the color (0-255). | |
uint16_t | color = 0 |
Encoded 16-bit RGB565 color value. | |
Represents an RGB color and provides methods for manipulation.
Represents a 16-bit RGB color (RGB565) and provides methods for manipulation.
Definition at line 23 of file RGBColor.h.
RGBColor | ( | ) |
Default constructor initializes the color to black (0, 0, 0).
Definition at line 3 of file RGBColor.cpp.
Referenced by Add(), Add(), HueShift(), HueShift(), InterpolateColors(), Scale(), and Scale().
Constructor to initialize RGBColor from a Vector3D.
color | Vector3D representing RGB values. |
Definition at line 17 of file RGBColor.cpp.
References B, G, R, Vector3D::X, Vector3D::Y, and Vector3D::Z.
|
inline |
Default constructor initializes the color to black (0, 0, 0).
Definition at line 30 of file RGBColor565.h.
Constructor to initialize RGBColor from a Vector3D.
color | Vector3D representing RGB values. |
Definition at line 60 of file RGBColor565.h.
References B, G, R, Vector3D::X, Vector3D::Y, and Vector3D::Z.
Adds a value to each RGB component of the color.
value | The value to add (0-255). |
Definition at line 47 of file RGBColor.cpp.
References B, G, R, and RGBColor().
Adds a value to each RGB component of the color.
value | The value to add (0-255). |
Definition at line 100 of file RGBColor565.h.
References B, Mathematics::Constrain(), G, R, and RGBColor().
Shifts the hue of the color by a specified angle in degrees.
hueDeg | The angle in degrees to shift the hue. |
Definition at line 65 of file RGBColor.cpp.
References B, G, Mathematics::MPI, R, and RGBColor().
Referenced by Oscilloscope::GetRGB(), SpectrumAnalyzer::GetRGB(), Image::GetRGB(), UVMap::GetRGB(), SimpleMaterial::HueShift(), SpiralMaterial::HueShift(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), and ProtogenProject::UpdateFace().
Shifts the hue of the color by a specified angle in degrees.
hueDeg | The angle in degrees to shift the hue. |
Definition at line 113 of file RGBColor565.h.
References B, G, Mathematics::MPI, R, and RGBColor().
Interpolates between two colors based on a ratio.
a | The starting color. |
b | The ending color. |
ratio | A value between 0 and 1 representing the interpolation factor. |
Definition at line 79 of file RGBColor.cpp.
Referenced by MaterialMask::GetRGB().
Interpolates between two colors based on a ratio.
a | The starting color. |
b | The ending color. |
ratio | A value between 0 and 1 representing the interpolation factor. |
Definition at line 131 of file RGBColor565.h.
References B, G, R, and RGBColor().
Scales the brightness of the color to a maximum value.
maxBrightness | The maximum brightness value (0-255). |
Definition at line 29 of file RGBColor.cpp.
References B, G, R, and RGBColor().
Referenced by BetaProtoController::Display(), GammaControllerBack::Display(), GammaControllerFront::Display(), KaiborgV1Controller::Display(), KaiborgV1D1Controller::Display(), ProtoDRController::Display(), WS35BetaController::Display(), and WS35Controller::Display().
Scales the brightness of the color to a maximum value.
maxBrightness | The maximum brightness value (0-255). |
Definition at line 83 of file RGBColor565.h.
References B, Mathematics::Constrain(), G, R, and RGBColor().
Sets the RGB values of the color.
R | Red component (0-255). |
G | Green component (0-255). |
B | Blue component (0-255). |
Definition at line 23 of file RGBColor.cpp.
Referenced by SammyAnimation::Update(), and TechSaneAnimation::Update().
Sets the RGB values of the color.
R | Red component (0-255). |
G | Green component (0-255). |
B | Blue component (0-255). |
Definition at line 72 of file RGBColor565.h.
String ToString | ( | ) |
|
inline |
uint8_t B = 0 |
Blue component of the color (0-255).
Definition at line 27 of file RGBColor.h.
Referenced by Add(), Add(), Fisheye::ApplyEffect(), GlitchX::ApplyEffect(), HorizontalBlur::ApplyEffect(), Magnet::ApplyEffect(), Overflow::ApplyEffect(), PhaseOffsetR::ApplyEffect(), PhaseOffsetX::ApplyEffect(), PhaseOffsetY::ApplyEffect(), RadialBlur::ApplyEffect(), ShiftR::ApplyEffect(), Test::ApplyEffect(), VerticalBlur::ApplyEffect(), APA102Controller::Display(), BetaProtoController::Display(), ESP32DevKitV1::Display(), GammaControllerBack::Display(), GammaControllerFront::Display(), KaiborgV1Controller::Display(), KaiborgV1D1Controller::Display(), ProtoDRController::Display(), HUB75Controller::Display(), HUB75ControllerSplit::Display(), HUB75ControllerSquare::Display(), WS35BetaController::Display(), WS35Controller::Display(), DisplayTest::FillAltWhiteBlack(), DisplayTest::FillWhite(), HueShift(), HueShift(), InterpolateColors(), InterpolateColors(), Rasterizer::Rasterize(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), Scale(), Scale(), SetColor(), SetColor(), GammaControllerBack::SetPixels(), GammaControllerFront::SetPixels(), KaiborgV1D1Controller::SetPixels(), WS35BetaController::SetPixels(), WS35Controller::SetPixels(), and ToString().
uint16_t color = 0 |
Encoded 16-bit RGB565 color value.
Definition at line 25 of file RGBColor565.h.
Referenced by RGBColor().
uint8_t G = 0 |
Green component of the color (0-255).
Definition at line 26 of file RGBColor.h.
Referenced by Add(), Add(), HeadsUpDisplay::ApplyEffect(), Fisheye::ApplyEffect(), GlitchX::ApplyEffect(), HorizontalBlur::ApplyEffect(), Magnet::ApplyEffect(), Overflow::ApplyEffect(), PhaseOffsetR::ApplyEffect(), PhaseOffsetX::ApplyEffect(), PhaseOffsetY::ApplyEffect(), RadialBlur::ApplyEffect(), ShiftR::ApplyEffect(), Test::ApplyEffect(), VerticalBlur::ApplyEffect(), APA102Controller::Display(), BetaProtoController::Display(), ESP32DevKitV1::Display(), GammaControllerBack::Display(), GammaControllerFront::Display(), KaiborgV1Controller::Display(), KaiborgV1D1Controller::Display(), ProtoDRController::Display(), HUB75Controller::Display(), HUB75ControllerSplit::Display(), HUB75ControllerSquare::Display(), WS35BetaController::Display(), WS35Controller::Display(), DisplayTest::FillAltWhiteBlack(), DisplayTest::FillWhite(), HueShift(), HueShift(), InterpolateColors(), InterpolateColors(), Rasterizer::Rasterize(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), Scale(), Scale(), SetColor(), SetColor(), GammaControllerBack::SetPixels(), GammaControllerFront::SetPixels(), KaiborgV1D1Controller::SetPixels(), WS35BetaController::SetPixels(), WS35Controller::SetPixels(), and ToString().
uint8_t R = 0 |
Red component of the color (0-255).
Definition at line 25 of file RGBColor.h.
Referenced by Add(), Add(), HeadsUpDisplay::ApplyEffect(), Fisheye::ApplyEffect(), GlitchX::ApplyEffect(), HorizontalBlur::ApplyEffect(), Magnet::ApplyEffect(), Overflow::ApplyEffect(), PhaseOffsetR::ApplyEffect(), PhaseOffsetX::ApplyEffect(), PhaseOffsetY::ApplyEffect(), RadialBlur::ApplyEffect(), ShiftR::ApplyEffect(), Test::ApplyEffect(), VerticalBlur::ApplyEffect(), APA102Controller::Display(), BetaProtoController::Display(), ESP32DevKitV1::Display(), GammaControllerBack::Display(), GammaControllerFront::Display(), KaiborgV1Controller::Display(), KaiborgV1D1Controller::Display(), ProtoDRController::Display(), HUB75Controller::Display(), HUB75ControllerSplit::Display(), HUB75ControllerSquare::Display(), WS35BetaController::Display(), WS35Controller::Display(), DisplayTest::FillAltWhiteBlack(), DisplayTest::FillWhite(), HueShift(), HueShift(), InterpolateColors(), InterpolateColors(), Rasterizer::Rasterize(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), RGBColor(), Scale(), Scale(), SetColor(), SetColor(), GammaControllerBack::SetPixels(), GammaControllerFront::SetPixels(), KaiborgV1D1Controller::SetPixels(), WS35BetaController::SetPixels(), WS35Controller::SetPixels(), and ToString().