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
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#pragma once
#include "gpu/hostBuffer.hpp"
#include "gpu/uniqueBuffer.hpp"
#ifndef VS_OPENCL
#include "maskinterpolation/inputMaskInterpolation.hpp"
#endif
#include "libvideostitch/input.hpp"
#include "libvideostitch/output.hpp"
#include "libvideostitch/panoDef.hpp"
#include <stdint.h>
#include <vector>
namespace VideoStitch {
namespace Core {
class StereoRigDefinition;
/**
* @brief The InputsMap class manage computation and storage of the inputs map
* This inputs map contains for each pixel of the destination panorama the list of inputs which are used to produce it.
*/
class InputsMap {
public:
static Potential<InputsMap> create(const PanoDefinition& pano);
virtual ~InputsMap();
public:
Status compute(const std::map<readerid_t, Input::VideoReader*>&, const PanoDefinition&, const bool);
Status compute(const std::map<readerid_t, Input::VideoReader*>&, const PanoDefinition&, const StereoRigDefinition*,
Eye, const bool);
#ifndef VS_OPENCL
Status loadPrecomputedMap(const frameid_t frameId, const PanoDefinition& pano,
const std::map<readerid_t, Input::VideoReader*>& readers,
std::unique_ptr<MaskInterpolation::InputMaskInterpolation>& inputMaskInterpolation,
bool& loaded);
#endif
// These two functions are related to the frame id
std::pair<frameid_t, frameid_t> getBoundedFrameIds() const;
GPU::Buffer<uint32_t> getMask() { return setupBuffer.borrow(); }
private:
explicit InputsMap(const PanoDefinition& pano);
Status allocateBuffers();
private:
GPU::UniqueBuffer<uint32_t> setupBuffer;
std::pair<frameid_t, frameid_t> _boundedFrames;
int64_t _width;
int64_t _height;
};
} // namespace Core
} // namespace VideoStitch