Isle
Loading...
Searching...
No Matches
LegoColor Class Reference

LEGO color representation with 8-bit RGB channels. More...

#include <legocolor.h>

Public Member Functions

 LegoColor ()
 Default constructor. More...
 
LegoU8 GetRed ()
 Get the red channel value. More...
 
void SetRed (LegoU8 p_red)
 Set the red channel value. More...
 
LegoU8 GetGreen ()
 Get the green channel value. More...
 
void SetGreen (LegoU8 p_green)
 Set the green channel value. More...
 
LegoU8 GetBlue ()
 Get the blue channel value. More...
 
void SetBlue (LegoU8 p_blue)
 Set the blue channel value. More...
 
LegoResult Read (LegoStorage *p_storage)
 Read the color from a storage object in the order red, green, blue (each as a byte). More...
 

Protected Attributes

LegoU8 m_red
 Red color component (0x00 offset). [AI]. More...
 
LegoU8 m_green
 Green color component (0x01 offset). [AI]. More...
 
LegoU8 m_blue
 Blue color component (0x02 offset). [AI]. More...
 

Detailed Description

LEGO color representation with 8-bit RGB channels.

[AI]

This class encapsulates a 24-bit RGB color using three 8-bit unsigned integers for red, green, and blue components, as used for LEGO elements and rendering. It provides accessors, mutators, and reading from serialized storage. [AI]

Definition at line 10 of file legocolor.h.

Constructor & Destructor Documentation

◆ LegoColor()

LegoColor::LegoColor ( )
inline

Default constructor.

[AI]

Initializes all RGB channels to zero (black color). [AI]

Definition at line 14 of file legocolor.h.

Member Function Documentation

◆ GetBlue()

LegoU8 LegoColor::GetBlue ( )
inline

Get the blue channel value.

[AI]

Returns
The blue component (0-255). [AI]

Definition at line 34 of file legocolor.h.

◆ GetGreen()

LegoU8 LegoColor::GetGreen ( )
inline

Get the green channel value.

[AI]

Returns
The green component (0-255). [AI]

Definition at line 26 of file legocolor.h.

◆ GetRed()

LegoU8 LegoColor::GetRed ( )
inline

Get the red channel value.

[AI]

Returns
The red component (0-255). [AI]

Definition at line 18 of file legocolor.h.

◆ Read()

LegoResult LegoColor::Read ( LegoStorage p_storage)

Read the color from a storage object in the order red, green, blue (each as a byte).

[AI]

Reads three bytes from the provided LegoStorage: red, green, and blue, setting this color's components accordingly. Returns the result status of the storage read operation. [AI]

Parameters
p_storageStorage instance to read color data from. [AI]
Returns
Result of the read operation (e.g., SUCCESS or error code). [AI]

Definition at line 9 of file legocolor.cpp.

◆ SetBlue()

void LegoColor::SetBlue ( LegoU8  p_blue)
inline

Set the blue channel value.

[AI]

Parameters
p_blueNew value for the blue component (0-255). [AI]

Definition at line 38 of file legocolor.h.

◆ SetGreen()

void LegoColor::SetGreen ( LegoU8  p_green)
inline

Set the green channel value.

[AI]

Parameters
p_greenNew value for the green component (0-255). [AI]

Definition at line 30 of file legocolor.h.

◆ SetRed()

void LegoColor::SetRed ( LegoU8  p_red)
inline

Set the red channel value.

[AI]

Parameters
p_redNew value for the red component (0-255). [AI]

Definition at line 22 of file legocolor.h.

Member Data Documentation

◆ m_blue

LegoU8 LegoColor::m_blue
protected

Blue color component (0x02 offset). [AI].

Definition at line 49 of file legocolor.h.

◆ m_green

LegoU8 LegoColor::m_green
protected

Green color component (0x01 offset). [AI].

Definition at line 48 of file legocolor.h.

◆ m_red

LegoU8 LegoColor::m_red
protected

Red color component (0x00 offset). [AI].

Definition at line 47 of file legocolor.h.


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