NVIDIA DeepStream SDK API Reference
7.1 Release
frame.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_FRAME__HPP
15
#define _DS3D_COMMON_HPP_FRAME__HPP
16
17
#include <
ds3d/common/abi_frame.h
>
18
#include <
ds3d/common/func_utils.h
>
19
20
#include <
ds3d/common/hpp/obj.hpp
>
21
22
namespace
ds3d
{
23
24
25
using
FrameGuard
=
GuardDataT<abiFrame>
;
26
27
#if 0
28
// abiFrame Guard
29
class
FrameGuard
:
public
GuardDataT
<abiFrame> {
30
using
_Base =
GuardDataT<abiFrame>
;
31
32
public
:
33
FrameGuard
() =
default
;
34
template
<
typename
... Args>
35
FrameGuard
(Args&&... args) : _Base(std::forward<Args>(args)...)
36
{
37
}
38
39
template
<
class
EleT>
40
EleT& at(
size_t
idx)
41
{
42
abiFrame
* f = this->
ptr
();
43
DS_ASSERT
(this->
ptr
());
44
DS3D_THROW_ERROR
(idx <
ShapeSize
(f->
shape
()),
ErrCode::kOutOfRange
,
"idx out of range"
);
45
uint32_t eleSize =
dataTypeBytes
(f->
dataType
());
46
DS_ASSERT
(
sizeof
(EleT) < eleSize);
47
return
*
static_cast<
EleT*
>
((uint8_t*)f->
base
() + eleSize * idx);
48
}
49
};
50
#endif
51
52
// abi2DFrame Guard
53
using
Frame2DGuard
=
GuardDataT<abi2DFrame>
;
54
55
}
// namespace ds3d
56
57
#endif // _DS3D_COMMON_HPP_FRAME__HPP
DS_ASSERT
#define DS_ASSERT(...)
Definition:
defines.h:31
ds3d::ShapeSize
size_t ShapeSize(const Shape &shape)
Definition:
func_utils.h:166
ds3d::ErrCode::kOutOfRange
@ kOutOfRange
ds3d::abiFrame::shape
virtual const Shape & shape() const =0
ds3d::abiFrame::base
virtual void * base() const =0
obj.hpp
ds3d::GuardDataT
Definition:
obj.hpp:331
abi_frame.h
DS3D_THROW_ERROR
#define DS3D_THROW_ERROR(statement, code, msg)
Definition:
defines.h:78
ds3d::dataTypeBytes
uint32_t dataTypeBytes(DataType t)
Definition:
func_utils.h:142
ds3d::GuardDataT::ptr
Tp * ptr() const
Definition:
obj.hpp:361
func_utils.h
ds3d::FrameGuard
GuardDataT< abiFrame > FrameGuard
Definition:
frame.hpp:25
ds3d
Definition:
lidar_3d_datatype.h:35
ds3d::abiFrame::dataType
virtual DataType dataType() const =0
ds3d::abiFrame
Definition:
abi_frame.h:22
Advance Information | Subject to Change | Generated by NVIDIA | Mon Oct 14 2024 13:27:44 | PR-09318-R32