31 #ifndef OPENSHOT_CLIP_H 32 #define OPENSHOT_CLIP_H 35 #define int64 opencv_broken_int 36 #define uint64 opencv_broken_uint 37 #include <opencv2/opencv.hpp> 38 #include <opencv2/core.hpp> 46 #include <QtGui/QImage> 59 #include <OpenShotAudio.h> 115 void init_settings();
118 void init_reader_settings();
121 void init_reader_rotation();
125 std::list<openshot::EffectBase*> effects;
127 std::string parentObjectId;
128 std::shared_ptr<openshot::TrackedObjectBase> parentTrackedObject;
143 int64_t adjust_frame_number_minimum(int64_t frame_number);
146 void apply_effects(std::shared_ptr<openshot::Frame> frame);
149 void apply_keyframes(std::shared_ptr<Frame> frame, std::shared_ptr<QImage> background_canvas);
152 QTransform get_transform(std::shared_ptr<Frame> frame,
int width,
int height);
155 std::string get_file_extension(std::string
path);
158 std::shared_ptr<openshot::Frame> GetOrCreateFrame(int64_t number);
161 void get_time_mapped_frame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number);
164 bool isEqual(
double a,
double b);
170 void reverse_buffer(juce::AudioSampleBuffer* buffer);
181 bool COMPILED_WITH_CV =
true;
183 bool COMPILED_WITH_CV =
false;
204 bool IsOpen()
override {
return is_open; };
212 void AttachToObject(std::string object_id);
215 void SetAttachedObject(std::shared_ptr<openshot::TrackedObjectBase> trackedObject);
217 void SetAttachedClip(
Clip* clipObject);
219 std::shared_ptr<openshot::TrackedObjectBase>
GetAttachedObject()
const {
return parentTrackedObject; };
224 std::string
Name()
override {
return "Clip"; };
231 void Close()
override;
234 std::list<openshot::EffectBase*>
Effects() {
return effects; };
244 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number)
override;
256 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> background_frame, int64_t frame_number)
override;
270 std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> background_frame, int64_t frame_number,
openshot::TimelineInfoStruct* options);
273 void Open()
override;
284 void End(
float value) { end = value; }
287 std::string Json()
const override;
288 void SetJson(
const std::string value)
override;
289 Json::Value JsonValue()
const override;
290 void SetJsonValue(
const Json::Value root)
override;
294 std::string PropertiesJSON(int64_t requested_frame)
const override;
345 #endif // OPENSHOT_CLIP_H std::string GetAttachedId() const
Get and set the object id that this clip is attached to.
Header file for ClipBase class.
This abstract class is the base class, used by all effects in libopenshot.
openshot::Keyframe perspective_c4_y
Curves representing Y for coordinate 4.
openshot::Keyframe time
Curve representing the frames over time to play (used for speed and direction of video) ...
openshot::Color wave_color
Curve representing the color of the audio wave form.
openshot::Keyframe has_video
An optional override to determine if this clip has video (-1=undefined, 0=no, 1=yes) ...
openshot::Keyframe perspective_c3_x
Curves representing X for coordinate 3.
Header file for ReaderBase class.
openshot::Keyframe location_y
Curve representing the relative Y position in percent based on the gravity (-1 to 1) ...
This header includes all commonly used effects for libopenshot, for ease-of-use.
bool operator()(openshot::EffectBase *lhs, openshot::EffectBase *rhs)
VolumeMixType
This enumeration determines the strategy when mixing audio with other clips.
This struct contains info about the current Timeline clip instance.
openshot::GravityType gravity
The gravity of a clip determines where it snaps to its parent.
ScaleType
This enumeration determines how clips are scaled to fit their parent container.
Clip * GetAttachedClip() const
Return a pointer to the clip this clip is attached to.
openshot::Keyframe scale_x
Curve representing the horizontal scaling in percent (0 to 1)
This abstract class is the base class, used by all readers in libopenshot.
openshot::FrameDisplayType display
The format to display the frame number (if any)
openshot::Keyframe volume
Curve representing the volume (0 to 1)
openshot::Keyframe scale_y
Curve representing the vertical scaling in percent (0 to 1)
Header file for the Keyframe class.
std::string Name() override
Return the type name of the class.
openshot::Keyframe shear_x
Curve representing X shear angle in degrees (-45.0=left, 45.0=right)
std::shared_ptr< openshot::TrackedObjectBase > GetAttachedObject() const
Return a pointer to the trackedObject this clip is attached to.
void SetAttachedId(std::string value)
Set id of the object id that this clip is attached to.
std::list< openshot::EffectBase * > Effects()
Return the list of effects on the timeline.
This class represents a clip (used to arrange readers on the timeline)
Header file for Frame class.
bool Waveform()
Get the waveform property of this clip.
openshot::Keyframe channel_filter
A number representing an audio channel to filter (clears all other channels)
Header file for AudioResampler class.
openshot::Keyframe alpha
Curve representing the alpha (1 to 0)
FrameDisplayType
This enumeration determines the display format of the clip's frame number (if any). Useful for debugging.
openshot::Keyframe rotation
Curve representing the rotation (0 to 360)
openshot::Keyframe perspective_c1_x
Curves representing X for coordinate 1.
openshot::Keyframe has_audio
An optional override to determine if this clip has audio (-1=undefined, 0=no, 1=yes) ...
void End(float value)
Set end position (in seconds) of clip (trim end of video)
This abstract class is the base class, used by all clips in libopenshot.
openshot::Keyframe perspective_c4_x
Curves representing X for coordinate 4.
openshot::Keyframe perspective_c1_y
Curves representing Y for coordinate 1.
openshot::Keyframe origin_y
Curve representing Y origin point (0.0=0% (top), 1.0=100% (bottom))
openshot::Keyframe origin_x
Curve representing X origin point (0.0=0% (left), 1.0=100% (right))
openshot::Keyframe channel_mapping
A number representing an audio channel to output (only works when filtering a channel) ...
openshot::Keyframe perspective_c2_x
Curves representing X for coordinate 2.
openshot::Keyframe perspective_c3_y
Curves representing Y for coordinate 3.
int Order() const
Get the order that this effect should be executed.
Header file for Color class.
AnchorType
This enumeration determines what parent a clip should be aligned to.
bool IsOpen() override
Determine if reader is open or closed.
This class represents a color (used on the timeline and clips)
Header file for TextReader class.
openshot::CacheMemory * GetCache() override
Get the cache object (always return NULL for this reader)
This namespace is the default namespace for all code in the openshot library.
Header file for EffectBase class.
juce::CriticalSection getFrameCriticalSection
Section lock for multiple threads.
openshot::ScaleType scale
The scale determines how a clip should be resized to fit its parent.
openshot::Keyframe shear_y
Curve representing Y shear angle in degrees (-45.0=down, 45.0=up)
openshot::Keyframe location_x
Curve representing the relative X position in percent based on the gravity (-1 to 1) ...
float Position() const
Get position on timeline (in seconds)
Header file for the TrackedObjectBase class.
Header file for the EffectInfo class.
A Keyframe is a collection of Point instances, which is used to vary a number or property over time...
void Waveform(bool value)
Set the waveform property of this clip.
openshot::VolumeMixType mixing
What strategy should be followed when mixing audio with other clips.
openshot::AnchorType anchor
The anchor determines what parent a clip should snap to.
This class is a memory-based cache manager for Frame objects.
GravityType
This enumeration determines how clips are aligned to their parent container.
int Layer() const
Get layer of clip on timeline (lower number is covered by higher numbers)
openshot::Keyframe perspective_c2_y
Curves representing Y for coordinate 2.
This class is used to resample audio data for many sequential frames.