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
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#ifndef PROJECTIONS_HPP_
#define PROJECTIONS_HPP_
#include "config.hpp"
#include <string>
namespace VideoStitch {
namespace Core {
/**
* nvcc on mac does not currently support c++11 enum class. This looks like it as far as syntax is concerned,
* so we'll be able to just replace all this by an enum class when possible.
* Note that this is not type-safe though.
*/
class VS_EXPORT PanoProjection {
public:
/**
* A pano projection.
* WARNING Never change these values.
*/
enum Type {
Rectilinear = 0,
Cylindrical = 1,
Equirectangular = 2,
FullFrameFisheye = 3,
Stereographic = 4,
CircularFisheye = 5,
Cubemap = 6,
EquiangularCubemap = 7
};
/**
* Default construction uses a random value.
*/
PanoProjection() : value(Equirectangular) {}
/**
* A PanoProjection is implicitly constructible from the enum.
* @param value enum value
*/
PanoProjection(Type value) : value(value) {}
/**
* A PanoProjection is implicitly convertible to the enum.
*/
operator Type() const { return value; }
private:
Type value;
};
/**
* Returns the PTV name of an output projection.
* @param proj projection
*/
VS_EXPORT const char* getPanoProjectionName(const PanoProjection& proj);
/**
* Returns the projection with this PTV name.
* @param name The format name, e.g. "equirectangular".
* @param proj The projection
* @returns false if this is not a valid name.
*/
bool VS_EXPORT getPanoProjectionFromName(const std::string& name, PanoProjection& proj);
} // namespace Core
} // namespace VideoStitch
#endif