OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gpuRenderer.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_CORE_GPU_RENDERER_HPP
2 #define OPENPOSE_CORE_GPU_RENDERER_HPP
3
4 #include <atomic>
5 #include <tuple>
6 #include <openpose/core/common.hpp>
7 #include <openpose/core/renderer.hpp>
8
9 namespace op
10 {
11 class OP_API GpuRenderer : public Renderer
12 {
13 public:
14 explicit GpuRenderer(const float renderThreshold, const float alphaKeypoint,
15 const float alphaHeatMap, const bool blendOriginalFrame = true,
16 const unsigned int elementToRender = 0u, const unsigned int numberElementsToRender = 0u);
17
18 virtual ~GpuRenderer();
19
20 std::tuple<std::shared_ptr<float*>, std::shared_ptr<bool>, std::shared_ptr<std::atomic<unsigned int>>,
21 std::shared_ptr<std::atomic<unsigned long long>>, std::shared_ptr<const unsigned int>>
22 getSharedParameters();
23
24 void setSharedParametersAndIfLast(const std::tuple<std::shared_ptr<float*>, std::shared_ptr<bool>,
25 std::shared_ptr<std::atomic<unsigned int>>,
26 std::shared_ptr<std::atomic<unsigned long long>>,
27 std::shared_ptr<const unsigned int>>& tuple,
28 const bool isLast);
29
30 protected:
31 std::shared_ptr<float*> spGpuMemory;
32
33 void cpuToGpuMemoryIfNotCopiedYet(const float* const cpuMemory, const unsigned long long memoryVolume);
34
35 void gpuToCpuMemoryIfLastRenderer(float* cpuMemory, const unsigned long long memoryVolume);
36
37 private:
38 std::shared_ptr<std::atomic<unsigned long long>> spVolume;
39 bool mIsFirstRenderer;
40 bool mIsLastRenderer;
41 std::shared_ptr<bool> spGpuMemoryAllocated;
42
43 DELETE_COPY(GpuRenderer);
44 };
45 }
46
47 #endif // OPENPOSE_CORE_GPU_RENDERER_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
common.hpp
op::GpuRenderer::spGpuMemory
std::shared_ptr< float * > spGpuMemory
Definition: gpuRenderer.hpp:31
op::GpuRenderer
Definition: gpuRenderer.hpp:11
OP_API
#define OP_API
Definition: macros.hpp:19
op::Renderer
Definition: renderer.hpp:10
renderer.hpp