Compute Graph Framework SDK Reference  5.22
dwCameraNode.hpp
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
31#ifndef DWFRAMEWORK_DWNODES_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
32#define DWFRAMEWORK_DWNODES_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
33
34#include <dw/sensors/common/Sensors.h>
35#include <dw/sensors/camera/Camera.h>
36#include <dwcgf/node/Node.hpp>
39#include <dwcgf/pass/Pass.hpp>
41#include <dwcgf/port/Port.hpp>
43#include <dwframework/dwnodes/common/channelpackets/Image.hpp>
44#include <dwframework/dwnodes/common/channelpackets/SelfCalibrationTypes.hpp>
45#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
46#include <dwframework/dwnodes/common/channelpackets/Sensors.hpp>
47
48namespace dw
49{
50namespace framework
51{
52
53class dwCameraNodeImpl;
54
59{
60 char8_t const* sensorName;
61 cudaStream_t cudaStream;
63 dwConstRigHandle_t rig;
64 dwSALHandle_t sal;
65 FixedString<32> frameSkipMask;
67};
68
73{
74public:
75 char8_t const* LOG_TAG;
76
77 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-2201
78 static constexpr auto describeInputPorts()
79 {
80 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
81 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
83 DW_DESCRIBE_PORT(dwCalibratedExtrinsics, "SENSOR_EXTRINSICS"_sv),
84 DW_DESCRIBE_PORT(dwTime_t, "VIRTUAL_SYNC_TIME"_sv));
85 };
86 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-2201
87 static constexpr auto describeOutputPorts()
88 {
89 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
90 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
92 DW_DESCRIBE_PORT(dwSensorNodeProperties, "SENSOR_PROPERTIES"_sv),
93 DW_DESCRIBE_PORT(dwCalibratedExtrinsics, "SENSOR_EXTRINSICS"_sv),
94 DW_DESCRIBE_PORT(dwCameraIntrinsics, "INTRINSICS_EEPROM"_sv),
95 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_NATIVE_RAW"_sv),
96 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_NATIVE_PROCESSED"_sv),
97 DW_DESCRIBE_PORT(dwImageHandle_t, "IMAGE_PROCESSED_RGBA"_sv),
98 DW_DESCRIBE_PORT(dwTime_t, "IMAGE_TIMESTAMP"_sv),
99 DW_DESCRIBE_PORT(dwTime_t, "NEXT_IMAGE_TIMESTAMP"_sv),
100 DW_DESCRIBE_PORT(dwSensorStats, "SENSOR_STATS"_sv),
101 DW_DESCRIBE_PORT(dwSensorTsAndID, "IMAGE_TIMESTAMP_AND_ID"_sv));
102 };
103
104 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-2201
105 static constexpr auto describePasses()
106 {
108 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
109 describePass(StringView{"RAW_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
110 describePass(StringView{"PROCESSED_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
111 describePass(StringView{"PROCESSED_RGBA_OUTPUT"}, DW_PROCESSOR_TYPE_GPU),
112 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
113 };
114
115 dwSensorType getSensorType() const
116 {
117 return DW_SENSOR_CAMERA;
118 }
119
120 dwStatus getImageProperties(dwImageProperties* prop, dwCameraOutputType type);
121 dwStatus getCameraProperties(dwCameraProperties* prop);
122
123 static std::unique_ptr<dwCameraNode> create(ParameterProvider& provider);
124
125 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-2201
126 static constexpr auto describeParameters()
127 {
128 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
129 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
131 describeConstructorArgument<dwCameraNodeParams>(
133 const char*,
135 "cameraIndex"_sv,
138 cudaStream_t,
139 "streamIndex"_sv,
142 bool,
143 "useEEPROMIntrinsics"_sv,
146 dwConstRigHandle_t,
149 dwSALHandle_t,
152 dw::core::FixedString<32>,
153 "frameSkipMask"_sv,
156 bool,
157 "errorHandlingEnabled"_sv,
158 false,
160 describeConstructorArgument<dwContextHandle_t>(
162 dwContextHandle_t)));
163 }
164
166 const dwContextHandle_t ctx);
167
168 // constructors with dwSensorParams
169 dwCameraNode(const dwSensorParams& params,
170 cudaStream_t cudaStream,
171 dwSALHandle_t sal,
172 dwContextHandle_t ctx);
173 dwCameraNode(const char* sensorName,
174 dwConstRigHandle_t rigHandle,
175 dwSALHandle_t sal,
176 dwContextHandle_t ctx,
177 const FixedString<32>& frameSkipMask);
178 dwCameraNode(const dwSensorParams& params,
179 dwSALHandle_t sal,
180 dwContextHandle_t ctx);
181};
182}
183}
184#endif // DWFRAMEWORK_DWNODES_SENSORS_DWCAMERANODE_DWCAMERANODE_HPP_
#define DW_DESCRIBE_INDEX_PARAMETER_WITH_SEMANTIC(TYPE_NAME, SEMANTIC_TYPE_NAME, args...)
#define DW_DESCRIBE_INDEX_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER_WITH_DEFAULT(TYPE_NAME, args...)
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, NAME, args...)
The interface to access parameter values identified by name and/or (semantic) type.
static constexpr auto describeInputPorts()
static constexpr auto describeOutputPorts()
static constexpr auto describePasses()
dwStatus getImageProperties(dwImageProperties *prop, dwCameraOutputType type)
dwSensorType getSensorType() const
dwCameraNode(const dwSensorParams &params, cudaStream_t cudaStream, dwSALHandle_t sal, dwContextHandle_t ctx)
dwCameraNode(const char *sensorName, dwConstRigHandle_t rigHandle, dwSALHandle_t sal, dwContextHandle_t ctx, const FixedString< 32 > &frameSkipMask)
dwCameraNode(dwCameraNodeParams const &params, const dwContextHandle_t ctx)
static constexpr auto describeParameters()
dwCameraNode(const dwSensorParams &params, dwSALHandle_t sal, dwContextHandle_t ctx)
static std::unique_ptr< dwCameraNode > create(ParameterProvider &provider)
dwStatus getCameraProperties(dwCameraProperties *prop)
constexpr std::tuple describeConstructorArguments()
constexpr PassDescriptorT< 0 > describePass(dw::core::StringView &&name, dwProcessorType processorType)
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
Construction parameters for dwCameraNode.
Definition: Buffer.hpp:41