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
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#include "./noFlow.hpp"
#include "parse/json.hpp"
#include "libvideostitch/parse.hpp"
namespace VideoStitch {
namespace Core {
NoFlow::Factory::Factory() {}
Potential<ImageFlowFactory> NoFlow::Factory::parse(const Ptv::Value&) {
return Potential<ImageFlowFactory>(new NoFlow::Factory());
}
Ptv::Value* NoFlow::Factory::serialize() const {
Ptv::Value* res = Ptv::Value::emptyObject();
res->push("type", new Parse::JsonValue(NoFlow::getName()));
return res;
}
std::string NoFlow::Factory::getImageFlowName() const { return NoFlow::getName(); }
bool NoFlow::Factory::needsInputPreProcessing() const { return false; }
std::string NoFlow::Factory::hash() const {
std::stringstream ss;
ss << "No Flow";
return ss.str();
}
Potential<ImageFlow> NoFlow::Factory::create() const {
std::map<std::string, float> parameters;
return Potential<ImageFlow>(new NoFlow(parameters));
}
ImageFlowFactory* NoFlow::Factory::clone() const { return new Factory(); }
NoFlow::NoFlow(const std::map<std::string, float>& parameters) : ImageFlow(parameters) {}
std::string NoFlow::getName() { return std::string("no"); }
Status NoFlow::findSingleScaleImageFlow(const int2&, const int2&, const GPU::Buffer<const uint32_t>&, const int2&,
const int2&, const GPU::Buffer<const uint32_t>&, GPU::Buffer<float2>,
GPU::Stream) {
// Do nothing
return Status::OK();
}
Status NoFlow::upsampleFlow(const int2&, const int2&, const GPU::Buffer<const uint32_t>&, const int2&, const int2&,
const GPU::Buffer<const uint32_t>&, const GPU::Buffer<const float2>&, GPU::Buffer<float2>,
GPU::Stream) {
// Do nothing
return Status::OK();
}
ImageFlow::ImageFlowAlgorithm NoFlow::getFlowAlgorithm() const { return ImageFlow::ImageFlowAlgorithm::NoFlow; }
} // namespace Core
} // namespace VideoStitch