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
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#ifndef PROCESSORSTITCHOUTPUT_HPP_
#define PROCESSORSTITCHOUTPUT_HPP_
#include "config.hpp"
#include "status.hpp"
#include "ptv.hpp"
#include "stitchOutput.hpp"
namespace VideoStitch {
namespace Core {
/**
* A StitchOutput that applies processing to the output of the stitcher.
*/
class VS_EXPORT ProcessorStitchOutput : public StitchOutput {
public:
/**
* A class that represents predefined processors to apply.
*/
class Spec {
public:
Spec();
/**
* Enables computing the sum of solid pixels.
* "sum": sum_{p in image | p_A > 0}{p_R + p_G + p_B}
*/
Spec& withSum();
/**
* Enables computing the count of solid pixels.
* "count": count_{p in image | p_A > 0}{1}
*/
Spec& withCount();
private:
friend class ProcessorStitchOutput;
bool sum;
bool count;
};
/**
* Creates a ProcessorStitchOutput with size
* @param w width
* @param h height
* @param spec Spec. Must have at least one processor enabled.
* @note This StitchOutput is NOT thread safe. It is meant to be used by only one stitcher.
*/
static Potential<ProcessorStitchOutput> create(size_t w, size_t h, const Spec& spec);
/**
* Returns the result of running the processing. The contents depend on the applied processors (cf doc).
* Only valid until the next call to the dirver stitcher (not thread safe).
*/
virtual const Ptv::Value& getResult() const = 0;
protected:
/**
* Creates form impl @a impl
*/
explicit ProcessorStitchOutput(Pimpl*);
private:
ProcessorStitchOutput(const ProcessorStitchOutput&);
const ProcessorStitchOutput& operator=(const ProcessorStitchOutput&);
};
} // namespace Core
} // namespace VideoStitch
#endif