1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#pragma once
#include "gpu/allocator.hpp"
#include "opencl.h"
namespace VideoStitch {
namespace GPU {
class DeviceSurface {
public:
explicit DeviceSurface(cl_mem im, bool ownsImage) : image(im), ownsImage(ownsImage) {}
~DeviceSurface();
cl_mem& raw() { return image; }
operator cl_mem() const { return image; }
operator cl_mem&() { return image; }
bool operator==(const DeviceSurface& other) const { return image == other.image; }
private:
cl_mem image;
bool ownsImage;
};
class DeviceCubemapSurface {
public:
~DeviceCubemapSurface();
};
} // namespace GPU
namespace Core {
class SourceOpenGLSurface::Pimpl : public SourceSurface::Pimpl {
public:
static Potential<Pimpl> create(GPU::Surface*);
virtual ~Pimpl() {}
virtual Status acquire();
virtual Status release();
private:
Pimpl(GPU::Surface* surf, GPU::Stream str) : SourceSurface::Pimpl(surf, str) {}
};
class PanoOpenGLSurface::Pimpl : public PanoPimpl {
public:
static Potential<Pimpl> create(GPU::Buffer<uint32_t>, GPU::Surface*, size_t w, size_t h);
virtual ~Pimpl() {}
virtual Status acquire();
virtual Status release();
private:
Pimpl(GPU::Stream str, GPU::Buffer<uint32_t> buffer, GPU::Surface* remapSurf, size_t w, size_t h)
: PanoPimpl(str, buffer, remapSurf, w, h) {}
};
class CubemapOpenGLSurface::Pimpl : public CubemapPimpl {
public:
static Potential<Pimpl> create(GPU::Buffer<uint32_t>*, GPU::Buffer<uint32_t>, GPU::CubemapSurface*,
GPU::Buffer<uint32_t>, size_t, bool equiangular);
virtual ~Pimpl() {}
virtual Status acquire();
virtual Status release();
private:
Pimpl(bool equiangular, GPU::Buffer<uint32_t>* buffers, GPU::Buffer<uint32_t> buffer, GPU::CubemapSurface* remapSurf,
GPU::Buffer<uint32_t> tmp, size_t w, GPU::Stream str)
: CubemapPimpl(equiangular, str, buffers, buffer, remapSurf, tmp, w) {}
};
} // namespace Core
} // namespace VideoStitch