CARLA
 
载入中...
搜索中...
未找到
GBufferUint8Serializer.cpp
浏览该文件的文档.
1// Copyright (c) 2022 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#include "carla/sensor/s11n/GBufferUint8Serializer.h" // 包含 GBufferUint8Serializer 的定义
8
9#include "carla/sensor/data/Image.h" // 包含 Image 数据类型的定义
10
11namespace carla {
12namespace sensor {
13namespace s11n {
14
15 // 从原始传感器数据反序列化出图像数据
17 // 使用输入的原始数据构造一个新的 Image 对象
18 // 通过智能指针 SharedPtr 管理对象的生命周期
19 auto image = SharedPtr<data::Image>(new data::Image{std::move(data)});
20 return image; // 返回封装了图像数据的智能指针
21 }
22
23} // namespace s11n
24} // namespace sensor
25} // namespace carla
包装一个传感器生成的原始数据以及一些有用的元信息。
Definition RawData.h:20
Templated image for any type of pixel.
Definition ImageTmpl.h:33
static SharedPtr< SensorData > Deserialize(RawData &&data)
CARLA模拟器的主命名空间。
Definition Carla.cpp:139
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。
Definition Memory.h:19