OpenShot Library | libopenshot  0.4.0
SphericalProjection.h
Go to the documentation of this file.
1 
9 // Copyright (c) 2008-2025 OpenShot Studios, LLC
10 //
11 // SPDX-License-Identifier: LGPL-3.0-or-later
12 
13 #ifndef OPENSHOT_SPHERICAL_PROJECTION_EFFECT_H
14 #define OPENSHOT_SPHERICAL_PROJECTION_EFFECT_H
15 
16 #include "../EffectBase.h"
17 #include "../Frame.h"
18 #include "../Json.h"
19 #include "../KeyFrame.h"
20 
21 #include <memory>
22 #include <string>
23 
24 namespace openshot
25 {
26 
33 {
34 private:
35  void init_effect_details();
36 
37 public:
42 
44  int invert;
46 
49 
52  Keyframe new_pitch,
53  Keyframe new_roll,
54  Keyframe new_fov);
55 
57  std::shared_ptr<Frame> GetFrame(int64_t frame_number) override
58  { return GetFrame(std::make_shared<Frame>(), frame_number); }
59 
61  std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame,
62  int64_t frame_number) override;
63 
64  // JSON serialization
65  std::string Json() const override;
66  void SetJson(std::string value) override;
67  Json::Value JsonValue() const override;
68  void SetJsonValue(Json::Value root) override;
69  std::string PropertiesJSON(int64_t requested_frame) const override;
70 };
71 
72 } // namespace openshot
73 
74 #endif // OPENSHOT_SPHERICAL_PROJECTION_EFFECT_H
openshot::SphericalProjection::invert
int invert
0=Normal, 1=Invert (back lens / +180°)
Definition: SphericalProjection.h:44
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot::SphericalProjection::interpolation
int interpolation
0=Nearest, 1=Bilinear
Definition: SphericalProjection.h:45
openshot::SphericalProjection::pitch
Keyframe pitch
Pitch around right-axis (degrees)
Definition: SphericalProjection.h:39
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::SphericalProjection::SetJsonValue
void SetJsonValue(Json::Value root) override
Load Json::Value into this object.
Definition: SphericalProjection.cpp:199
openshot::SphericalProjection::yaw
Keyframe yaw
Yaw around up-axis (degrees)
Definition: SphericalProjection.h:38
openshot::SphericalProjection::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: SphericalProjection.cpp:211
openshot::Keyframe
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition: KeyFrame.h:53
openshot::SphericalProjection::GetFrame
std::shared_ptr< Frame > GetFrame(int64_t frame_number) override
ClipBase override: create a fresh Frame then call the main GetFrame.
Definition: SphericalProjection.h:57
openshot::SphericalProjection::projection_mode
int projection_mode
0=Sphere, 1=Hemisphere, 2=Fisheye
Definition: SphericalProjection.h:43
openshot::SphericalProjection::SphericalProjection
SphericalProjection()
Blank ctor (for JSON deserialization)
Definition: SphericalProjection.cpp:22
openshot::SphericalProjection::Json
std::string Json() const override
Generate JSON string of this object.
Definition: SphericalProjection.cpp:169
openshot::SphericalProjection
Projects 360° or fisheye video through a virtual camera. Supports yaw, pitch, roll,...
Definition: SphericalProjection.h:32
openshot::SphericalProjection::SetJson
void SetJson(std::string value) override
Load JSON string into this object.
Definition: SphericalProjection.cpp:188
openshot::SphericalProjection::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: SphericalProjection.cpp:174
openshot::SphericalProjection::fov
Keyframe fov
Field-of-view (horizontal, degrees)
Definition: SphericalProjection.h:41
openshot::SphericalProjection::roll
Keyframe roll
Roll around forward-axis (degrees)
Definition: SphericalProjection.h:40