Public Member Functions | Private Attributes

color_range Class Reference

A color range definition is made of four reference RGB colors, used for calculating conversions from a source/key palette. More...

#include <color_range.hpp>

List of all members.

Public Member Functions

 color_range (Uint32 mid, Uint32 max=0x00FFFFFF, Uint32 min=0x00000000, Uint32 rep=0x00808080)
 Constructor, which expects four reference RGB colors.
 color_range (const std::vector< Uint32 > &v)
 Constructor, which expects four reference RGB colors.
 color_range ()
 Default constructor.
Uint32 mid () const
 Average color shade.
Uint32 max () const
 Maximum color shade.
Uint32 min () const
 Minimum color shade.
Uint32 rep () const
 High-contrast shade, intended for the minimap markers.
bool operator< (const color_range &b) const
bool operator== (const color_range &b) const
int index () const

Private Attributes

Uint32 mid_
Uint32 max_
Uint32 min_
Uint32 rep_

Detailed Description

A color range definition is made of four reference RGB colors, used for calculating conversions from a source/key palette.

1) The average shade of a unit's team-color portions (default: gray #808080) 2) The maximum highlight shade of a unit's team-color portions (default: white) 3) The minimum shadow shade of a unit's team-color portions (default: black) 4) A plain high-contrast color, used for the markers on the mini-ma (default: same as the provided average shade, or gray #808080)

The first three reference colors are used for converting a source palette with the external recolor_range() method.

Definition at line 55 of file color_range.hpp.


Constructor & Destructor Documentation

color_range::color_range ( Uint32  mid,
Uint32  max = 0x00FFFFFF,
Uint32  min = 0x00000000,
Uint32  rep = 0x00808080 
) [inline]

Constructor, which expects four reference RGB colors.

Parameters:
mid Average color shade.
max Maximum (highlight) color shade
min Minimum color shade
rep High-contrast reference color

Definition at line 65 of file color_range.hpp.

color_range::color_range ( const std::vector< Uint32 > &  v  )  [inline]

Constructor, which expects four reference RGB colors.

Parameters:
v STL vector with the four reference colors in order.

Definition at line 71 of file color_range.hpp.

color_range::color_range (  )  [inline]

Default constructor.

Definition at line 80 of file color_range.hpp.


Member Function Documentation

int color_range::index (  )  const

Definition at line 179 of file color_range.cpp.

References game_config::color_info().

Referenced by mp::wait::generate_menu(), mp::wait::join_game(), and mp::connect::side::side().

Here is the call graph for this function:

Here is the caller graph for this function:

Uint32 color_range::max (  )  const [inline]

Maximum color shade.

Definition at line 85 of file color_range.hpp.

References max_.

Referenced by operator<(), operator==(), and recolor_range().

Here is the caller graph for this function:

Uint32 color_range::mid (  )  const [inline]

Average color shade.

Definition at line 83 of file color_range.hpp.

References mid_.

Referenced by operator<(), operator==(), and recolor_range().

Here is the caller graph for this function:

Uint32 color_range::min (  )  const [inline]

Minimum color shade.

Definition at line 87 of file color_range.hpp.

References min_.

Referenced by operator<(), operator==(), and recolor_range().

Here is the caller graph for this function:

bool color_range::operator< ( const color_range b  )  const [inline]

Definition at line 91 of file color_range.hpp.

References max(), max_, mid(), mid_, min(), min_, rep(), and rep_.

Here is the call graph for this function:

bool color_range::operator== ( const color_range b  )  const [inline]

Definition at line 99 of file color_range.hpp.

References max(), max_, mid(), mid_, min(), min_, rep(), and rep_.

Here is the call graph for this function:

Uint32 color_range::rep (  )  const [inline]

High-contrast shade, intended for the minimap markers.

Definition at line 89 of file color_range.hpp.

References rep_.

Referenced by operator<(), and operator==().

Here is the caller graph for this function:


Member Data Documentation

Uint32 color_range::max_ [private]

Definition at line 107 of file color_range.hpp.

Referenced by max(), operator<(), and operator==().

Uint32 color_range::mid_ [private]

Definition at line 107 of file color_range.hpp.

Referenced by mid(), operator<(), and operator==().

Uint32 color_range::min_ [private]

Definition at line 107 of file color_range.hpp.

Referenced by min(), operator<(), and operator==().

Uint32 color_range::rep_ [private]

Definition at line 107 of file color_range.hpp.

Referenced by operator<(), operator==(), and rep().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:13:14 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs