|
Porytiles
|
Represents a 32-bit RGBA color. More...
#include <rgba32.hpp>
Public Member Functions | |
| constexpr | Rgba32 () |
| constexpr | Rgba32 (std::uint8_t red, std::uint8_t green, std::uint8_t blue, std::uint8_t alpha=alpha_opaque) |
| auto | operator<=> (const Rgba32 &rgba) const =default |
| bool | operator== (const Rgba32 &rgba) const =default |
| bool | is_intrinsically_transparent () const |
| Checks if this color is intrinsically transparent based on its alpha channel. | |
| bool | is_extrinsically_transparent (const Rgba32 &extrinsic) const |
| Checks if this color matches the extrinsic transparency color. | |
| bool | is_transparent (const Rgba32 &extrinsic) const |
| Checks if this color should be treated as transparent. | |
| std::string | to_jasc_str () const |
| std::string | to_csv_str () const |
| bool | equals_ignoring_alpha (const Rgba32 &other) const |
| std::uint8_t | red () const |
| std::uint8_t | green () const |
| std::uint8_t | blue () const |
| std::uint8_t | alpha () const |
Static Public Attributes | |
| static constexpr std::uint8_t | alpha_transparent = 0 |
| static constexpr std::uint8_t | alpha_opaque = 255 |
Represents a 32-bit RGBA color.
RGBA32 stores color values as four 8-bit components: red, green, blue, and alpha. Alpha of 0 indicates full transparency, while alpha of 255 indicates full opacity.
Rgba32{} produces a transparent color with all components set to 0, including alpha. Definition at line 23 of file rgba32.hpp.
|
inlineconstexpr |
Definition at line 28 of file rgba32.hpp.
|
inlineconstexpr |
Definition at line 30 of file rgba32.hpp.
|
inline |
Definition at line 96 of file rgba32.hpp.
|
inline |
Definition at line 91 of file rgba32.hpp.
| bool porytiles::Rgba32::equals_ignoring_alpha | ( | const Rgba32 & | other | ) | const |
Definition at line 34 of file rgba32.cpp.
|
inline |
Definition at line 86 of file rgba32.hpp.
| bool porytiles::Rgba32::is_extrinsically_transparent | ( | const Rgba32 & | extrinsic | ) | const |
Checks if this color matches the extrinsic transparency color.
A color is extrinsically transparent if its RGB components match the extrinsic transparency color, regardless of alpha values.
| extrinsic | The extrinsic transparency color to check against |
Definition at line 14 of file rgba32.cpp.
| bool porytiles::Rgba32::is_intrinsically_transparent | ( | ) | const |
Checks if this color is intrinsically transparent based on its alpha channel.
A color is intrinsically transparent if its alpha value is 0.
Definition at line 9 of file rgba32.cpp.
| bool porytiles::Rgba32::is_transparent | ( | const Rgba32 & | extrinsic | ) | const |
Checks if this color should be treated as transparent.
An RGBA32 color is considered transparent if either the color matches the extrinsic transparency color (ignoring alpha values) or if this color's intrinsic alpha value indicates transparency (alpha == 0).
| extrinsic | The extrinsic transparency color to check against |
Definition at line 19 of file rgba32.cpp.
|
default |
|
default |
|
inline |
Definition at line 81 of file rgba32.hpp.
| std::string porytiles::Rgba32::to_csv_str | ( | ) | const |
Definition at line 29 of file rgba32.cpp.
| std::string porytiles::Rgba32::to_jasc_str | ( | ) | const |
Definition at line 24 of file rgba32.cpp.
|
staticconstexpr |
Definition at line 26 of file rgba32.hpp.
|
staticconstexpr |
Definition at line 25 of file rgba32.hpp.