CARLA
载入中...
搜索中...
未找到
LibCarla
source
carla
sensor
s11n
ImageSerializer.cpp
浏览该文件的文档.
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
#include "
carla/sensor/s11n/ImageSerializer.h
"
8
9
#include "
carla/sensor/data/Image.h
"
10
11
namespace
carla
{
12
namespace
sensor {
13
namespace
s11n {
14
15
SharedPtr<SensorData>
ImageSerializer::Deserialize
(
RawData
&&data) {
16
auto
image =
SharedPtr<data::Image>
(
new
data::Image
{std::move(data)});
17
// Set alpha of each pixel in the buffer to max to make it 100% opaque
18
for
(
auto
&pixel : *image) {
19
pixel.a = 255u;
20
}
21
return
image;
22
}
23
24
}
// namespace s11n
25
}
// namespace sensor
26
}
// namespace carla
ImageSerializer.h
carla::sensor::RawData
包装一个传感器生成的原始数据以及一些有用的元信息。
Definition
RawData.h:20
carla::sensor::data::ImageTmpl
Templated image for any type of pixel.
Definition
ImageTmpl.h:33
carla::sensor::s11n::ImageSerializer::Deserialize
static SharedPtr< SensorData > Deserialize(RawData &&data)
Definition
ImageSerializer.cpp:15
carla
CARLA模拟器的主命名空间。
Definition
Carla.cpp:139
carla::SharedPtr
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。
Definition
Memory.h:19
Image.h
制作者
1.10.0