LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
Toggle main menu visibility
Main Page
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Typedefs
a
b
c
d
e
f
i
l
m
o
p
r
s
t
v
Enumerations
Enumerator
Files
File List
File Members
All
b
o
p
s
Functions
o
Macros
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
rc
tools
include
rcsc
color
rgb_color.h
1
// -*-c++-*-
2
3
/*
4
*Copyright:
5
6
Copyright (C) Hiroki SHIMORA, Hidehisa Akiyama
7
8
This code is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2, or (at your option)
11
any later version.
12
13
This code is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with this code; see the file COPYING. If not, write to
20
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21
22
*EndCopyright:
23
*/
24
26
27
#ifndef RCSC_COLOR_RGB_COLOR_H
28
#define RCSC_COLOR_RGB_COLOR_H
29
30
#include <string>
31
32
namespace
rcsc {
33
38
class
RGBColor
{
39
private
:
41
double
M_red;
42
44
double
M_green;
45
47
double
M_blue;
48
49
public
:
50
/*
51
\brief construct with black
52
*/
53
RGBColor
()
54
: M_red( 0.0 ),
55
M_green( 0.0 ),
56
M_blue( 0.0 )
57
{ }
58
59
/*
60
\brief constructor from red/green/blue components
61
\param r red value
62
\param g green value
63
\param b blue value
64
*/
65
RGBColor
(
const
double
r,
66
const
double
g,
67
const
double
b );
68
69
/*
70
\brief retrieve red component
71
\return red component value in range [0.0, 1.0]
72
*/
73
double
red()
const
74
{
75
return
M_red;
76
}
77
78
/*
79
\brief retrieve green component
80
\return green component value in range [0.0, 1.0]
81
*/
82
double
green()
const
83
{
84
return
M_green;
85
}
86
87
/*
88
\brief retrieve blue component
89
\return blue component value in range [0.0, 1.0]
90
*/
91
double
blue()
const
92
{
93
return
M_blue;
94
}
95
96
/*
97
\brief retrieve red component in range [0, 255]
98
\return red component value in range [0, 255]
99
*/
100
int
red8bit()
const
;
101
102
/*
103
\brief retrieve green component in range [0, 255]
104
\return green component value in range [0, 255]
105
*/
106
int
green8bit()
const
;
107
108
/*
109
\brief retrieve blue component in range [0, 255]
110
\return blue component value in range [0, 255]
111
*/
112
int
blue8bit()
const
;
113
114
/*
115
\brief get the color name string as "#RRGGBB"
116
\return color name string
117
*/
118
std::string name()
const
;
119
120
/*
121
\brief blend two colors
122
\param c1 1st souece color to blend
123
\param c2 2nd souece color to blend
124
\param c1_rate rate of weight of 1st souece color
125
\return blended color
126
*/
127
static
128
RGBColor
blend(
const
RGBColor
& c1,
129
const
RGBColor
& c2,
130
const
double
c1_rate );
131
};
132
133
}
134
135
#endif
rcsc::RGBColor
RGB color class.
Definition:
rgb_color.h:38
Generated by
1.9.4