OpenTTD Source: ColourARGB Union Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
ColourARGB Union Reference

Packed colour union to access the alpha, red, green, and blue channels from a 32 bit number for big-endian systems. More...

`#include <gfx_type.h>`

## Public Member Functions
constexpr | ColourARGB (uint8_t r, uint8_t g, uint8_t b, uint8_t a=0xFF)
| Create a new colour.
constexpr | ColourARGB (uint data=0)
| Create a new colour.
bool | operator== (const ColourARGB &other) const

## Data Fields
uint32_t | data
| Conversion of the channel information to a 32 bit number.
struct { |
uint8_t a |
uint8_t r |
uint8_t g |
uint8_t b |
| colour channels in BE order More...
}; |  |

## Detailed Description

Packed colour union to access the alpha, red, green, and blue channels from a 32 bit number for big-endian systems.

Definition at line 190 of file gfx_type.h.

## Constructor & Destructor Documentation

## ◆ ColourARGB() [1/2]

constexpr ColourARGB::ColourARGB | ( | uint8_t | r,
|  | uint8_t | g,
|  | uint8_t | b,
|  | uint8_t | a = `0xFF`
| ) |  |
| inlineconstexpr

Create a new colour.

Parameters

  r | The channel for the red colour.
  g | The channel for the green colour.
  b | The channel for the blue colour.
  a | The channel for the alpha/transparency.

Definition at line 203 of file gfx_type.h.

## ◆ ColourARGB() [2/2]

constexpr ColourARGB::ColourARGB | ( | uint | data = `0` | ) |
| inlineconstexpr

Create a new colour.

Parameters

  data | The colour in the correct packed format.

Definition at line 209 of file gfx_type.h.

## Member Function Documentation

## ◆ operator==()

bool ColourARGB::operator== | ( | const ColourARGB & | other | ) | const
| inline

Definition at line 211 of file gfx_type.h.

## Field Documentation

## ◆ a

uint8_t ColourARGB::a

Definition at line 193 of file gfx_type.h.

## ◆ b

uint8_t ColourARGB::b

colour channels in BE order

Definition at line 193 of file gfx_type.h.

## ◆ data

uint32_t ColourARGB::data

Conversion of the channel information to a 32 bit number.

Definition at line 191 of file gfx_type.h.

## ◆ g

uint8_t ColourARGB::g

Definition at line 193 of file gfx_type.h.

## ◆ r

uint8_t ColourARGB::r

Definition at line 193 of file gfx_type.h.

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

- src/gfx_type.h