CARLA
Toggle main menu visibility
Loading...
Searching...
No Matches
LibCarla
source
carla
image
CityScapesPalette.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 <cstdint>
10
11
namespace
carla
{
12
namespace
image
{
13
namespace
detail
{
14
15
static
constexpr
16
#if __cplusplus >= 201703L
// C++17
17
inline
18
#endif
19
// Please update documentation if you change this.
20
uint8_t
CITYSCAPES_PALETTE_MAP
[][3u] = {
21
{ 0u, 0u, 0u},
// unlabeled = 0u
22
// cityscape
23
{128u, 64u, 128u},
// road = 1u
24
{244u, 35u, 232u},
// sidewalk = 2u
25
{ 70u, 70u, 70u},
// building = 3u
26
{102u, 102u, 156u},
// wall = 4u
27
{190u, 153u, 153u},
// fence = 5u
28
{153u, 153u, 153u},
// pole = 6u
29
{250u, 170u, 30u},
// traffic light = 7u
30
{220u, 220u, 0u},
// traffic sign = 8u
31
{107u, 142u, 35u},
// vegetation = 9u
32
{152u, 251u, 152u},
// terrain = 10u
33
{ 70u, 130u, 180u},
// sky = 11u
34
{220u, 20u, 60u},
// pedestrian = 12u
35
{255u, 0u, 0u},
// rider = 13u
36
{ 0u, 0u, 142u},
// Car = 14u
37
{ 0u, 0u, 70u},
// truck = 15u
38
{ 0u, 60u, 100u},
// bus = 16u
39
{ 0u, 80u, 100u},
// train = 17u
40
{ 0u, 0u, 230u},
// motorcycle = 18u
41
{119u, 11u, 32u},
// bicycle = 19u
42
// custom
43
{110u, 190u, 160u},
// static = 20u
44
{170u, 120u, 50u},
// dynamic = 21u
45
{ 55u, 90u, 80u},
// other = 22u
46
{ 45u, 60u, 150u},
// water = 23u
47
{157u, 234u, 50u},
// road line = 24u
48
{ 81u, 0u, 81u},
// ground = 25u
49
{150u, 100u, 100u},
// bridge = 26u
50
{230u, 150u, 140u},
// rail track = 27u
51
{180u, 165u, 180u},
// guard rail = 28u
52
{180u, 130u, 70u},
// rock = 29u
53
};
54
55
}
// namespace detail
56
57
class
CityScapesPalette
{
58
public
:
59
60
static
constexpr
auto
GetNumberOfTags
() {
61
return
sizeof
(
detail::CITYSCAPES_PALETTE_MAP
) /
62
sizeof
(*
detail::CITYSCAPES_PALETTE_MAP
);
63
}
64
65
/// Return an RGB uint8_t array.
66
///
67
/// @warning It overflows if @a tag is greater than GetNumberOfTags().
68
static
constexpr
auto
GetColor
(uint8_t tag) {
69
return
detail::CITYSCAPES_PALETTE_MAP
[tag %
GetNumberOfTags
()];
70
}
71
};
72
73
}
// namespace image
74
}
// namespace carla
carla::image::CityScapesPalette
Definition
CityScapesPalette.h:57
carla::image::CityScapesPalette::GetColor
static constexpr auto GetColor(uint8_t tag)
Return an RGB uint8_t array.
Definition
CityScapesPalette.h:68
carla::image::CityScapesPalette::GetNumberOfTags
static constexpr auto GetNumberOfTags()
Definition
CityScapesPalette.h:60
carla::image::detail
Definition
CityScapesPalette.h:13
carla::image::detail::CITYSCAPES_PALETTE_MAP
static constexpr uint8_t CITYSCAPES_PALETTE_MAP[][3u]
Definition
CityScapesPalette.h:20
carla::image
Definition
CityScapesPalette.h:12
carla
This file contains definitions of common data structures used in traffic manager.
Definition
SignComponent.h:21
Generated by
1.18.0