NVIDIA DeepStream SDK API Reference

7.0 Release
datarender.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 
14 #ifndef DS3D_COMMON_HPP_DATA_RENDER_HPP
15 #define DS3D_COMMON_HPP_DATA_RENDER_HPP
16 
17 #include <ds3d/common/common.h>
18 #include <ds3d/common/func_utils.h>
20 
21 namespace ds3d {
22 
24 
53 class GuardDataRender : public GuardDataProcess<abiDataRender> {
55 
56 public:
57  template <typename... Args>
58  GuardDataRender(Args&&... args) : _Base(std::forward<Args>(args)...)
59  {
60  }
61  ~GuardDataRender() = default;
62 
64  {
65  DS_ASSERT(ptr());
66  return ptr()->preroll_i(datamap.abiRef());
67  }
68 
70  {
72  cb.setFn<ErrCode, const abiRefDataMap*>(std::move(dataDoneCB));
73  DS_ASSERT(ptr());
74  ErrCode code = ptr()->render_i(datamap.abiRef(), cb.abiRef());
75  return code;
76  }
77 
79  DS_ASSERT(ptr());
80  const abiRefWindow* refWin = ptr()->getWindow_i();
81  if (refWin) {
82  return GuardWindow(*refWin);
83  } else {
84  return nullptr;
85  }
86  }
87 };
88 
89 } // namespace ds3d
90 
91 #endif // DS3D_COMMON_HPP_DATA_RENDER_HPP
DS_ASSERT
#define DS_ASSERT(...)
Definition: defines.h:31
ds3d::GuardDataProcess
Definition: dataprocess.hpp:29
dataprocess.hpp
ds3d::GuardRef::abiRef
ref * abiRef() const
Definition: obj.hpp:269
ds3d::abiRefT< abiDataMap >
ds3d::ErrCode
ErrCode
Definition: common.h:43
ds3d::GuardDataT< abiWindow >
ds3d::GuardDataRender::render
ErrCode render(GuardDataMap datamap, abiOnDataCB::CppFunc dataDoneCB)
Definition: datarender.hpp:69
ds3d::GuardDataRender::GuardDataRender
GuardDataRender(Args &&... args)
Definition: datarender.hpp:58
ds3d::GuardCB::setFn
void setFn(F f)
Definition: obj.hpp:297
ds3d::abiDataRender::render_i
virtual ErrCode render_i(const abiRefDataMap *inputData, const abiOnDataCB *dataDoneCb)=0
ds3d::GuardDataRender::preroll
ErrCode preroll(GuardDataMap datamap)
Definition: datarender.hpp:63
ds3d::abiDataRender::preroll_i
virtual ErrCode preroll_i(const abiRefDataMap *inputData)=0
ds3d::GuardDataRender::getWindow
GuardWindow getWindow() const
Definition: datarender.hpp:78
common.h
ds3d::GuardDataT< abiDataRender >::ptr
abiDataRender * ptr() const
Definition: obj.hpp:361
ds3d::GuardDataRender
GuardDataRender is the safe access entry for abiDataRender.
Definition: datarender.hpp:53
func_utils.h
ds3d::GuardDataMap
Definition: datamap.hpp:21
ds3d::GuardDataRender::~GuardDataRender
~GuardDataRender()=default
ds3d::abiDataRender::getWindow_i
virtual const abiRefWindow * getWindow_i() const =0
ds3d
Definition: lidar_3d_datatype.h:35
ds3d::abiCallBackT::CppFunc
std::function< void(Args...)> CppFunc
Definition: abi_obj.h:72
ds3d::GuardWindow
GuardDataT< abiWindow > GuardWindow
Definition: datarender.hpp:23
ds3d::GuardCB
Definition: obj.hpp:285