CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
rpc
rpc/Color.h
Go to the documentation of this file.
1
// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "
carla/MsgPack.h
"
10
11
#include <cstdint>
12
13
#ifdef LIBCARLA_INCLUDED_FROM_UE4
14
#include <
util/enable-ue4-macros.h
>
15
#include "Math/Color.h"
16
#include <
util/disable-ue4-macros.h
>
17
#endif
// LIBCARLA_INCLUDED_FROM_UE4
18
19
namespace
carla
{
20
namespace
rpc
{
21
22
class
Color
{
23
public
:
24
25
uint8_t
r
= 0u;
26
uint8_t
g
= 0u;
27
uint8_t
b
= 0u;
28
29
Color
() =
default
;
30
Color
(
const
Color
&) =
default
;
31
32
Color
(uint8_t
r
, uint8_t
g
, uint8_t
b
)
33
:
r
(
r
),
g
(
g
),
b
(
b
) {}
34
35
Color
&
operator=
(
const
Color
&) =
default
;
36
37
#ifdef LIBCARLA_INCLUDED_FROM_UE4
38
39
Color
(
const
FColor &color)
40
:
Color
(color.
R
, color.G, color.B) {}
41
42
Color
(
const
FLinearColor &color)
43
:
Color
(color.
R
* 255.0f, color.G * 255.0f, color.B * 255.0f) {}
44
45
operator
FColor()
const
{
46
return
FColor{
r
,
g
,
b
};
47
}
48
49
operator
FLinearColor()
const
{
50
return
FLinearColor{
51
static_cast<
float
>
(
r
)/255.0f,
52
static_cast<
float
>
(
g
)/255.0f,
53
static_cast<
float
>
(
b
)/255.0f,
54
1.0f
55
};
56
}
57
58
#endif
// LIBCARLA_INCLUDED_FROM_UE4
59
60
MSGPACK_DEFINE_ARRAY
(
r
,
g
,
b
);
61
};
62
63
}
// namespace rpc
64
}
// namespace carla
R
carla::rpc::Response< T > R
Definition
CarlaServer.cpp:99
MsgPack.h
carla::rpc::Color::Color
Color(const FColor &color)
Definition
rpc/Color.h:39
carla::rpc::Color::Color
Color(const FLinearColor &color)
Definition
rpc/Color.h:42
carla::rpc::Color::Color
Color(const Color &)=default
carla::rpc::Color::b
uint8_t b
Definition
rpc/Color.h:27
carla::rpc::Color::g
uint8_t g
Definition
rpc/Color.h:26
carla::rpc::Color::MSGPACK_DEFINE_ARRAY
MSGPACK_DEFINE_ARRAY(r, g, b)
carla::rpc::Color::operator=
Color & operator=(const Color &)=default
carla::rpc::Color::Color
Color(uint8_t r, uint8_t g, uint8_t b)
Definition
rpc/Color.h:32
carla::rpc::Color::r
uint8_t r
Definition
rpc/Color.h:25
carla::rpc::Color::Color
Color()=default
disable-ue4-macros.h
enable-ue4-macros.h
carla::rpc
Definition
DebugShapeDrawer.h:11
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
Generated by
1.18.0