NVIDIA DeepStream SDK API Reference

9.1 Release
sources/includes/ds3d/common/hpp/datarender.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef DS3D_COMMON_HPP_DATA_RENDER_HPP
19 #define DS3D_COMMON_HPP_DATA_RENDER_HPP
20 
21 #include <ds3d/common/common.h>
22 #include <ds3d/common/func_utils.h>
23 #include <ds3d/common/hpp/dataprocess.hpp>
24 
25 namespace ds3d {
26 
28 
57 class GuardDataRender : public GuardDataProcess<abiDataRender> {
59 
60 public:
61  template <typename... Args>
62  GuardDataRender(Args&&... args) : _Base(std::forward<Args>(args)...)
63  {
64  }
65  ~GuardDataRender() = default;
66 
68  {
69  DS_ASSERT(ptr());
70  return ptr()->preroll_i(datamap.abiRef());
71  }
72 
74  {
76  cb.setFn<ErrCode, const abiRefDataMap*>(std::move(dataDoneCB));
77  DS_ASSERT(ptr());
78  ErrCode code = ptr()->render_i(datamap.abiRef(), cb.abiRef());
79  return code;
80  }
81 
83  DS_ASSERT(ptr());
84  const abiRefWindow* refWin = ptr()->getWindow_i();
85  if (refWin) {
86  return GuardWindow(*refWin);
87  } else {
88  return nullptr;
89  }
90  }
91 };
92 
93 } // namespace ds3d
94 
95 #endif // DS3D_COMMON_HPP_DATA_RENDER_HPP
ds3d::GuardDataProcess
Definition: sources/includes/ds3d/common/hpp/dataprocess.hpp:33
ds3d::GuardWindow
GuardDataT< abiWindow > GuardWindow
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:27
ds3d::GuardRef::abiRef
ref * abiRef() const
Definition: sources/includes/ds3d/common/hpp/obj.hpp:273
ds3d::abiRefT< abiDataMap >
DS_ASSERT
#define DS_ASSERT(...)
Definition: sources/includes/ds3d/common/defines.h:36
ds3d::ErrCode
ErrCode
Definition: sources/includes/ds3d/common/common.h:47
ds3d::GuardDataT< abiWindow >
ds3d::GuardDataRender::render
ErrCode render(GuardDataMap datamap, abiOnDataCB::CppFunc dataDoneCB)
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:73
ds3d::GuardDataRender::GuardDataRender
GuardDataRender(Args &&... args)
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:62
ds3d::GuardCB::setFn
void setFn(F f)
Definition: sources/includes/ds3d/common/hpp/obj.hpp:301
ds3d::abiDataRender::render_i
virtual ErrCode render_i(const abiRefDataMap *inputData, const abiOnDataCB *dataDoneCb)=0
ds3d::GuardDataRender::preroll
ErrCode preroll(GuardDataMap datamap)
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:67
ds3d::abiDataRender::preroll_i
virtual ErrCode preroll_i(const abiRefDataMap *inputData)=0
ds3d::GuardDataRender::getWindow
GuardWindow getWindow() const
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:82
ds3d::GuardDataT< abiDataRender >::ptr
abiDataRender * ptr() const
Definition: sources/includes/ds3d/common/hpp/obj.hpp:365
ds3d::GuardDataRender
GuardDataRender is the safe access entry for abiDataRender.
Definition: sources/includes/ds3d/common/hpp/datarender.hpp:57
ds3d::GuardDataMap
Definition: sources/includes/ds3d/common/hpp/datamap.hpp:27
ds3d::GuardDataRender::~GuardDataRender
~GuardDataRender()=default
ds3d::abiDataRender::getWindow_i
virtual const abiRefWindow * getWindow_i() const =0
ds3d
Definition: sources/includes/ds3d/common/abi_dataprocess.h:25
ds3d::abiCallBackT::CppFunc
std::function< void(Args...)> CppFunc
Definition: sources/includes/ds3d/common/abi_obj.h:76
ds3d::GuardCB
Definition: sources/includes/ds3d/common/hpp/obj.hpp:289