All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gpuRenderer.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_CORE_GPU_RENDERER_HPP
#define OPENPOSE_CORE_GPU_RENDERER_HPP
#include <atomic>
#include <tuple>
#include <openpose/core/common.hpp>
#include <openpose/core/renderer.hpp>
namespace op
{
class OP_API GpuRenderer : public Renderer
{
public:
explicit GpuRenderer(const float renderThreshold, const float alphaKeypoint,
const float alphaHeatMap, const bool blendOriginalFrame = true,
const unsigned int elementToRender = 0u, const unsigned int numberElementsToRender = 0u);
virtual ~GpuRenderer();
std::tuple<std::shared_ptr<float*>, std::shared_ptr<bool>, std::shared_ptr<std::atomic<unsigned int>>,
std::shared_ptr<std::atomic<unsigned long long>>, std::shared_ptr<const unsigned int>>
getSharedParameters();
void setSharedParametersAndIfLast(const std::tuple<std::shared_ptr<float*>, std::shared_ptr<bool>,
std::shared_ptr<std::atomic<unsigned int>>,
std::shared_ptr<std::atomic<unsigned long long>>,
std::shared_ptr<const unsigned int>>& tuple,
const bool isLast);
protected:
std::shared_ptr<float*> spGpuMemory;
void cpuToGpuMemoryIfNotCopiedYet(const float* const cpuMemory, const unsigned long long memoryVolume);
void gpuToCpuMemoryIfLastRenderer(float* cpuMemory, const unsigned long long memoryVolume);
private:
std::shared_ptr<std::atomic<unsigned long long>> spVolume;
bool mIsFirstRenderer;
bool mIsLastRenderer;
std::shared_ptr<bool> spGpuMemoryAllocated;
DELETE_COPY(GpuRenderer);
};
}
#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