|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef _DS3D_DATARENDER_GL3D_RENDER_CONFIG__H
19 #define _DS3D_DATARENDER_GL3D_RENDER_CONFIG__H
21 #include <ds3d/common/common.h>
22 #include <ds3d/common/func_utils.h>
24 #include "ds3d/common/hpp/yaml_config.hpp"
26 namespace ds3d {
namespace impl {
namespace render {
46 std::string
title =
"data-render";
101 "parse dataloader component content failed");
104 auto streams = node[
"streams"];
105 auto yWidth = node[
"width"];
106 auto yHeight = node[
"height"];
107 auto yTitle = node[
"title"];
108 auto yBlock = node[
"block"];
111 const static std::set<std::string> kValidStreams{
113 auto toString = [&]() {
115 for (
auto& i : kValidStreams) {
120 std::vector<std::string> strStreams = streams.as<std::vector<std::string>>();
121 for (
auto& each : strStreams) {
124 "stream must choose from " + toString());
129 config.
width = yWidth.as<uint32_t>();
132 config.
height = yHeight.as<uint32_t>();
136 config.
title = yTitle.as<std::string>();
139 config.
block = yBlock.as<
bool>();
148 parseBaseConfig(content, path, config),
"paser datarender config base failed.");
150 auto yminDepth = node[
"min_depth"];
151 auto ymaxDepth = node[
"max_depth"];
152 auto yMinDepthColor = node[
"min_depth_color"];
153 auto yMaxDepthColor = node[
"max_depth_color"];
156 config.
minDepth = yminDepth.as<
float>();
159 config.
maxDepth = ymaxDepth.as<
float>();
161 if (yMinDepthColor) {
162 auto color = yMinDepthColor.as<std::vector<uint32_t>>();
169 if (yMaxDepthColor) {
170 auto color = yMaxDepthColor.as<std::vector<uint32_t>>();
184 parseBaseConfig(content, path, config),
"paser datarender config base failed.");
186 auto yViewPos = node[
"view_position"];
187 auto yViewTarget = node[
"view_target"];
188 auto yViewUp = node[
"view_up"];
189 auto yNear = node[
"near"];
190 auto yFar = node[
"far"];
191 auto yFov = node[
"fov"];
192 auto yCoordYOpp = node[
"coord_y_opposite"];
193 auto yPositiveZonly = node[
"positive_z_only"];
196 auto pos = yViewPos.as<std::vector<float>>();
203 auto target = yViewTarget.as<std::vector<float>>();
210 auto up = yViewUp.as<std::vector<float>>();
217 config.
near = yNear.as<
float>();
220 config.
far = yFar.as<
float>();
223 config.
fov = yFov.as<
float>();
228 if (yPositiveZonly) {
238 parsePointsConfig(content, path, config),
"paser datarender config base failed.");
240 auto yEleSize = node[
"element_size"];
241 auto yLidarDataKey = node[
"lidar_data_key"];
242 auto yLidarBboxKey = node[
"lidar_bbox_key"];
243 auto yColor = node[
"lidar_color"];
244 auto ylabel = node[
"enable_label"];
256 auto color = yColor.as<std::vector<uint32_t>>();
257 size_t size = (color.size() < 3 ? color.size() : 3);
258 for (
size_t i = 0; i <
size; ++i) {
271 #endif // _DS3D_DATARENDER_GL3D_RENDER_CONFIG__H
static vec3b kDefaultMaxDepthColor
std::set< std::string > streams
ErrCode parseLidarConfig(const std::string &content, const std::string &path, LidarConfig &config)
static constexpr const char * kLidar3DBboxRawData
get array of Lidar3DBbox from FrameGuard [N, sizeof(Lidar3DBbox)]
ErrCode parseBaseConfig(const std::string &content, const std::string &path, Config &config)
bool hasColorStream() const
constexpr float kMinDepth
ErrCode parsePointsConfig(const std::string &content, const std::string &path, PointsConfig &config)
ErrCode parseComponentConfig(const std::string &yamlComp, const std::string &path, ComponentConfig &config)
#define DS3D_FAILED_RETURN(condition, ret, fmt,...)
static vec3b kDefaultMinDepthColor
constexpr uint32_t kDefaultHeight
constexpr const char * kPointStream
constexpr uint32_t kDefaultWidth
bool hasDepthStream() const
ErrCode parseDepthColorConfig(const std::string &content, const std::string &path, DepthConfig &config)
constexpr const char * kLidarStream
constexpr const char * size
constexpr const char * kColorStream
#define DS3D_ERROR_RETURN(code, fmt,...)
bool hasPointsStream() const
#define DS3D_THROW_ERROR(statement, code, msg)
constexpr const char * kDepthStream
config::ComponentConfig compConfig
constexpr float kMaxDepth