NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/ds3d/glprocess/gl_texture_render.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023-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_GLPROCESS_GL_TEXTURE_2D_RENDER_H
19 #define DS3D_GLPROCESS_GL_TEXTURE_2D_RENDER_H
20 
21 #include "ds3d/common/common.h"
22 #include "ds3d/common/hpp/datamap.hpp"
23 #include "ds3d/glprocess/gl_program.h"
24 #include "ds3d/glprocess/gl_buf.h"
25 #include "ds3d/glprocess/gl_render_ctx.h"
26 #include "ds3d/glprocess/gl_cuda_utils.h"
27 #include "ds3d/glprocess/gl_helper.h"
28 
29 #include "gl_render_base_priv.h"
30 
31 namespace ds3d { namespace gl {
32 
33 static constexpr size_t kTex2DVertDefaultNum = 6;
34 
40 };
41 
43  Texture3DConfig _config;
44  std::unique_ptr<VertexBuf> _vertexBuf;
45  std::unique_ptr<VertexBuf> _coordBuf;
46 
47  // data allocated on 1st coming dataset
48  Ptr<Texture> _texture;
49  Frame2DPlane _texPlanes;
50  std::unique_ptr<CudaTexture> _cudaTexture;
51 
52  // data managed during runtime
53  uint32_t _vertexInUse = 0;
54 
55 public:
56  ErrCode configure(const char* yamlConfig, uint32_t size) override;
57  ErrCode initResource() override;
58  ErrCode uploadData(GuardDataMap datamap) override;
59  ErrCode draw(GuardDataMap datamap) override;
60  ErrCode flush() override;
61  ErrCode deinitResource() override;
62 
63 protected:
64  Texture3DConfig& textrueConfig() { return _config; }
65 
67  ErrCode allocateTexture(const Frame2DPlane& plane, MemType memType, FrameType frameType);
71 };
72 
73 }} // namespace ds3d::gl
74 
75 #endif // DS3D_GLPROCESS_GL_TEXTURE_2D_RENDER_H
gl_render_base_priv.h
ds3d::gl::Texture3DRenderCtx::initResource
ErrCode initResource() override
ds3d::Frame2DPlane
Definition: includes/ds3d/common/abi_frame.h:47
ds3d::kTextureVertexKey
static constexpr const char * kTextureVertexKey
Definition: includes/ds3d/common/common.h:95
ds3d::gl::Texture3DRenderCtx::allocateTexture
ErrCode allocateTexture(const Frame2DPlane &plane, MemType memType, FrameType frameType)
ds3d::gl::Texture3DRenderCtx::draw
ErrCode draw(GuardDataMap datamap) override
ds3d::gl::Texture3DRenderCtx::flush
ErrCode flush() override
ds3d::kColorFrame
static constexpr const char * kColorFrame
Definition: includes/ds3d/common/common.h:78
ds3d::gl::Texture3DConfig::textureVertexKey
std::string textureVertexKey
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:38
ds3d::ErrCode
ErrCode
Definition: includes/ds3d/common/common.h:47
ds3d::gl::Texture3DRenderCtx
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:42
ds3d::gl::BaseRenderConfig
base config for all renders layout: [0, 0, 1280, 720] color_clear: True
Definition: sources/libs/ds3d/glprocess/gl_render_base_priv.h:65
ds3d::gl::Texture3DRenderCtx::textrueConfig
Texture3DConfig & textrueConfig()
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:64
ds3d::kTextureCoordinateKey
static constexpr const char * kTextureCoordinateKey
Definition: includes/ds3d/common/common.h:97
ds3d::gl::Texture3DRenderCtx::deinitResource
ErrCode deinitResource() override
pydeepstreamdoc::tensor::TensorDoc::size
constexpr const char * size
Definition: service-maker/sources/python/src/bindings/docstrings/tensordoc.h:46
ds3d::gl::Texture3DRenderCtx::configure
ErrCode configure(const char *yamlConfig, uint32_t size) override
ds3d::gl::Texture3DRenderCtx::allocateBuffers
ErrCode allocateBuffers()
ds3d::gl::Texture3DRenderCtx::uploadImage
ErrCode uploadImage(GuardDataMap &datamap)
ds3d::gl::Texture3DRenderCtx::uploadData
ErrCode uploadData(GuardDataMap datamap) override
ds3d::Ptr
ShrdPtr< T > Ptr
Definition: includes/ds3d/common/hpp/obj.hpp:37
ds3d::gl::Texture3DConfig::maxVertexNum
uint32_t maxVertexNum
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:36
ds3d::GuardDataMap
Definition: includes/ds3d/common/hpp/datamap.hpp:27
ds3d::gl::Texture3DConfig::textureCoordKey
std::string textureCoordKey
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:39
ds3d::FrameType
FrameType
Definition: includes/ds3d/common/idatatype.h:95
ds3d::gl::Texture3DRenderCtx::uploadDefaultValues
ErrCode uploadDefaultValues()
ds3d::gl::Texture3DRenderCtx::uploadVetex
ErrCode uploadVetex(GuardDataMap &datamap)
ds3d
Definition: includes/ds3d/common/abi_dataprocess.h:25
ds3d::gl::BaseRenderPriv
Definition: sources/libs/ds3d/glprocess/gl_render_base_priv.h:77
ds3d::MemType
MemType
Definition: includes/ds3d/common/idatatype.h:106
ds3d::gl::Texture3DConfig::textureFrameKey
std::string textureFrameKey
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:37
ds3d::gl::Texture3DConfig
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:35
ds3d::gl::kTex2DVertDefaultNum
static constexpr size_t kTex2DVertDefaultNum
Definition: sources/libs/ds3d/glprocess/gl_texture_render.h:33