CARLA
Loading...
Searching...
No Matches
ImageTmpl.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/Debug.h"
17#include "carla/ros2/ROS2.h"
18
19namespace carla {
20namespace sensor {
21namespace data {
22
23 /// Templated image for any type of pixel.
24 template <typename PixelT>
25 class ImageTmpl : public Array<PixelT> {
27 friend class carla::ros2::ROS2;
28 protected:
29
33
34 friend Serializer;
40
42 : Super(Serializer::header_offset, std::move(data)) {
44 }
45
46 private:
47
48 const auto &GetHeader() const {
50 }
51
52 public:
53
54 using pixel_type = PixelT;
55
56 /// Get image width in pixels.
57 auto GetWidth() const {
58 return GetHeader().width;
59 }
60
61 /// Get image height in pixels.
62 auto GetHeight() const {
63 return GetHeader().height;
64 }
65
66 /// Get horizontal field of view of the image in degrees.
67 auto GetFOVAngle() const {
68 return GetHeader().fov_angle;
69 }
70 };
71
72} // namespace data
73} // namespace sensor
74} // namespace carla
#define DEBUG_ASSERT(predicate)
Definition Debug.h:66
Wrapper around the raw data generated by a sensor plus some useful meta-information.
Definition RawData.h:21
Base class for all the sensor data consisting of an array of items.
Definition Array.h:23
const RawData & GetRawData() const
Definition Array.h:139
Templated image for any type of pixel.
Definition ImageTmpl.h:25
auto GetFOVAngle() const
Get horizontal field of view of the image in degrees.
Definition ImageTmpl.h:67
auto GetWidth() const
Get image width in pixels.
Definition ImageTmpl.h:57
auto GetHeight() const
Get image height in pixels.
Definition ImageTmpl.h:62
const auto & GetHeader() const
Definition ImageTmpl.h:48
Serializes the single-channel float32 distance images produced by the path-traced distance camera.
Serializes image buffers generated by camera sensors.
Serializes image buffers generated by camera sensors.
Serializes image buffers generated by camera sensors.
static const ImageHeader & DeserializeHeader(const RawData &data)
Serializes image buffers generated by camera sensors.
Serializes image buffers generated by camera sensors.
This file contains definitions of common data structures used in traffic manager.