CARLA
 
载入中...
搜索中...
未找到
ImageIO.h
浏览该文件的文档.
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 "carla/image/ImageIOConfig.h" // 包含图像输入输出配置的头文件
10
11namespace carla { // 定义命名空间 carla
12namespace image { // 定义命名空间 image
13
14 class ImageIO { // 定义 ImageIO 类
15 public:
16
17 // 静态模板函数,用于读取图像
18 template <typename ImageT, typename IO = io::any>
19 static void ReadImage(const std::string &in_filename, ImageT &image, IO = IO()) {
20 IO::read_image(in_filename, image); // 调用 IO 类的 read_image 方法读取图像
21 }
22
23 // 静态模板函数,用于写入图像视图
24 template <typename ViewT, typename IO = io::any>
25 static std::string WriteView(std::string out_filename, const ViewT &image_view, IO = IO()) {
26 IO::write_view(out_filename, image_view); // 调用 IO 类的 write_view 方法写入图像视图
27 return out_filename; // 返回输出文件名
28 }
29 };
30
31} // namespace image
32} // namespace carla
static std::string WriteView(std::string out_filename, const ViewT &image_view, IO=IO())
Definition ImageIO.h:25
static void ReadImage(const std::string &in_filename, ImageT &image, IO=IO())
Definition ImageIO.h:19
CARLA模拟器的主命名空间。
Definition Carla.cpp:139