The Battle for Wesnoth  1.15.1+dev
Classes | Functions | Variables
color.hpp File Reference
#include <algorithm>
#include <cstdint>
#include <ostream>
#include <string>
#include <utility>
Include dependency graph for color.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  color_t
 
struct  std::hash< color_t >
 

Functions

std::ostream & operator<< (std::ostream &s, const color_t &c)
 

Variables

const uint32_t SDL_ALPHA_MASK = 0xFF000000
 
const uint32_t SDL_RED_MASK = 0x00FF0000
 
const uint32_t SDL_GREEN_MASK = 0x0000FF00
 
const uint32_t SDL_BLUE_MASK = 0x000000FF
 
const uint32_t SDL_ALPHA_BITSHIFT = 24
 
const uint32_t SDL_RED_BITSHIFT = 16
 
const uint32_t SDL_GREEN_BITSHIFT = 8
 
const uint32_t SDL_BLUE_BITSHIFT = 0
 
const uint32_t RGBA_ALPHA_MASK = 0x000000FF
 
const uint32_t RGBA_RED_MASK = 0xFF000000
 
const uint32_t RGBA_GREEN_MASK = 0x00FF0000
 
const uint32_t RGBA_BLUE_MASK = 0x0000FF00
 
const uint32_t RGBA_ALPHA_BITSHIFT = 0
 
const uint32_t RGBA_RED_BITSHIFT = 24
 
const uint32_t RGBA_GREEN_BITSHIFT = 16
 
const uint32_t RGBA_BLUE_BITSHIFT = 8
 
const uint8_t ALPHA_OPAQUE = 255
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  s,
const color_t c 
)
inline

Definition at line 242 of file color.hpp.

References color_t::a, color_t::b, color_t::g, color_t::r, and s.

Variable Documentation

◆ ALPHA_OPAQUE

const uint8_t ALPHA_OPAQUE = 255

◆ RGBA_ALPHA_BITSHIFT

const uint32_t RGBA_ALPHA_BITSHIFT = 0

Definition at line 43 of file color.hpp.

Referenced by color_t::from_rgba_bytes(), and color_t::to_rgba_bytes().

◆ RGBA_ALPHA_MASK

const uint32_t RGBA_ALPHA_MASK = 0x000000FF

Definition at line 38 of file color.hpp.

Referenced by color_t::from_rgba_bytes().

◆ RGBA_BLUE_BITSHIFT

const uint32_t RGBA_BLUE_BITSHIFT = 8

Definition at line 46 of file color.hpp.

Referenced by color_t::from_rgba_bytes(), and color_t::to_rgba_bytes().

◆ RGBA_BLUE_MASK

const uint32_t RGBA_BLUE_MASK = 0x0000FF00

Definition at line 41 of file color.hpp.

Referenced by color_t::from_rgba_bytes().

◆ RGBA_GREEN_BITSHIFT

const uint32_t RGBA_GREEN_BITSHIFT = 16

Definition at line 45 of file color.hpp.

Referenced by color_t::from_rgba_bytes(), and color_t::to_rgba_bytes().

◆ RGBA_GREEN_MASK

const uint32_t RGBA_GREEN_MASK = 0x00FF0000

Definition at line 40 of file color.hpp.

Referenced by color_t::from_rgba_bytes().

◆ RGBA_RED_BITSHIFT

const uint32_t RGBA_RED_BITSHIFT = 24

Definition at line 44 of file color.hpp.

Referenced by color_t::from_rgba_bytes(), and color_t::to_rgba_bytes().

◆ RGBA_RED_MASK

const uint32_t RGBA_RED_MASK = 0xFF000000

Definition at line 39 of file color.hpp.

Referenced by color_t::from_rgba_bytes().

◆ SDL_ALPHA_BITSHIFT

const uint32_t SDL_ALPHA_BITSHIFT = 24

Definition at line 33 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and color_t::to_argb_bytes().

◆ SDL_ALPHA_MASK

const uint32_t SDL_ALPHA_MASK = 0xFF000000

Definition at line 28 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and surface::is_neutral().

◆ SDL_BLUE_BITSHIFT

const uint32_t SDL_BLUE_BITSHIFT = 0

Definition at line 36 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and color_t::to_argb_bytes().

◆ SDL_BLUE_MASK

const uint32_t SDL_BLUE_MASK = 0x000000FF

Definition at line 31 of file color.hpp.

Referenced by color_t::from_argb_bytes().

◆ SDL_GREEN_BITSHIFT

const uint32_t SDL_GREEN_BITSHIFT = 8

Definition at line 35 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and color_t::to_argb_bytes().

◆ SDL_GREEN_MASK

const uint32_t SDL_GREEN_MASK = 0x0000FF00

Definition at line 30 of file color.hpp.

Referenced by color_t::from_argb_bytes().

◆ SDL_RED_BITSHIFT

const uint32_t SDL_RED_BITSHIFT = 16

Definition at line 34 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and color_t::to_argb_bytes().

◆ SDL_RED_MASK

const uint32_t SDL_RED_MASK = 0x00FF0000

Definition at line 29 of file color.hpp.

Referenced by color_t::from_argb_bytes(), and surface::is_neutral().