CARLA
CityScapesPalette.h
Go to the documentation of this file.
1 // Copyright (c) 2017 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  { 70u, 70u, 70u}, // building = 1u,
23  {100u, 40u, 40u}, // fence = 2u,
24  { 55u, 90u, 80u}, // other = 3u,
25  {220u, 20u, 60u}, // pedestrian = 4u,
26  {153u, 153u, 153u}, // pole = 5u,
27  {157u, 234u, 50u}, // road line = 6u,
28  {128u, 64u, 128u}, // road = 7u,
29  {244u, 35u, 232u}, // sidewalk = 8u,
30  {107u, 142u, 35u}, // vegetation = 9u,
31  { 0u, 0u, 142u}, // vehicle = 10u,
32  {102u, 102u, 156u}, // wall = 11u,
33  {220u, 220u, 0u}, // traffic sign = 12u,
34  { 70u, 130u, 180u}, // sky = 13u,
35  { 81u, 0u, 81u}, // ground = 14u,
36  {150u, 100u, 100u}, // bridge = 15u,
37  {230u, 150u, 140u}, // rail track = 16u,
38  {180u, 165u, 180u}, // guard rail = 17u,
39  {250u, 170u, 30u}, // traffic light = 18u,
40  {110u, 190u, 160u}, // static = 19u,
41  {170u, 120u, 50u}, // dynamic = 20u,
42  { 45u, 60u, 150u}, // water = 21u,
43  {145u, 170u, 100u}, // terrain = 22u,
44  // { 0u, 0u, 70u}, // truck
45  // { 0u, 0u, 90u}, // caravan
46  // { 0u, 0u, 110u}, // trailer
47  // { 0u, 0u, 142u}, // license plate
48  // { 0u, 0u, 230u}, // motorcycle
49  // { 0u, 60u, 100u}, // bus
50  // { 0u, 80u, 100u}, // train
51  // {119u, 11u, 32u}, // bicycle
52  // {150u, 120u, 90u}, // tunnel
53  // {153u, 153u, 153u}, // polegroup
54  // {250u, 170u, 160u}, // parking
55  // {255u, 0u, 0u}, // rider
56  };
57 
58 } // namespace detail
59 
61  public:
62 
63  static constexpr auto GetNumberOfTags() {
64  return sizeof(detail::CITYSCAPES_PALETTE_MAP) /
66  }
67 
68  /// Return an RGB uint8_t array.
69  ///
70  /// @warning It overflows if @a tag is greater than GetNumberOfTags().
71  static constexpr auto GetColor(uint8_t tag) {
72  return detail::CITYSCAPES_PALETTE_MAP[tag % GetNumberOfTags()];
73  }
74  };
75 
76 } // namespace image
77 } // namespace carla
static constexpr auto GetNumberOfTags()
static constexpr uint8_t CITYSCAPES_PALETTE_MAP[][3u]
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:99
static constexpr auto GetColor(uint8_t tag)
Return an RGB uint8_t array.