openshot::ClipBase Class Referenceabstract

This abstract class is the base class, used by all clips in libopenshot. More...

`#include <ClipBase.h>`

Inheritance diagram for openshot::ClipBase:

## Public Member Functions

| ClipBase ()
| Constructor for the base clip. More...
void | Id (string value)
| Set basic properties. More...
virtual string | Json ()=0
| Get and Set JSON methods. More...
virtual Json::Value | JsonValue ()=0
| Generate Json::JsonValue for this object. More...
bool | operator< (ClipBase &a)
bool | operator<= (ClipBase &a)
bool | operator> (ClipBase &a)
bool | operator>= (ClipBase &a)
virtual string | PropertiesJSON (int64_t requested_frame)=0
virtual void | SetJson (string value)=0
| Load JSON string into this object. More...
virtual void | SetJsonValue (Json::Value root)=0
| Load Json::JsonValue into this object. More...
void | SetMaxSize (int width, int height)
| Set Max Image Size (used for performance optimization) More...

## Protected Member Functions

Json::Value | add_property_choice_json (string name, int value, int selected_value)
| Generate JSON choice for a property (dropdown properties) More...
Json::Value | add_property_json (string name, float value, string type, string memo, Keyframe *keyframe, float min_value, float max_value, bool readonly, int64_t requested_frame)
| Generate JSON for a property. More...

## Protected Attributes

float | end
| The position in seconds to end playing (used to trim the ending of a clip) More...
string | id
| ID Property for all derived Clip and Effect classes. More...
int | layer
| The layer this clip is on. Lower clips are covered up by higher clips. More...
int | max_height
| The maximium image height needed by this clip (used for optimizations) More...
int | max_width
| The maximum image width needed by this clip (used for optimizations) More...
float | position
| The position on the timeline where this clip should start playing. More...
string | previous_properties
| This string contains the previous JSON properties. More...
float | start
| The position in seconds to start playing (used to trim the beginning of a clip) More...

## Detailed Description

This abstract class is the base class, used by all clips in libopenshot.

Clips are objects that attach to the timeline and can be layered and positioned together. There are 2 primary types of clips: Effects and Video/Audio Clips.

Definition at line 53 of file ClipBase.h.

## Constructor & Destructor Documentation

## ClipBase()

openshot::ClipBase::ClipBase | ( |  | ) |

inline

Constructor for the base clip.

Definition at line 73 of file ClipBase.h.

## Member Function Documentation

## add_property_choice_json()

Json::Value ClipBase::add_property_choice_json | ( | string | name,
|  | int | value,
|  | int | selected_value
| ) |  |

protected

Generate JSON choice for a property (dropdown properties)

Definition at line 101 of file ClipBase.cpp.

## add_property_json()

Json::Value ClipBase::add_property_json | ( | string | name,
|  | float | value,
|  | string | type,
|  | string | memo,
|  | Keyframe * | keyframe,
|  | float | min_value,
|  | float | max_value,
|  | bool | readonly,
|  | int64_t | requested_frame
| ) |  |

protected

Generate JSON for a property.

Definition at line 65 of file ClipBase.cpp.

## Id()

void openshot::ClipBase::Id | ( | string | value | ) |

inline

Set basic properties.

Definition at line 90 of file ClipBase.h.

## Json()

virtual string openshot::ClipBase::Json | ( |  | ) |

pure virtual

Get and Set JSON methods.

Generate JSON string of this object

Implemented in openshot::EffectBase, openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::ChromaKey, openshot::Saturation, openshot::Deinterlace, openshot::Shift, openshot::Hue, and openshot::Negate.

## JsonValue()

Json::Value ClipBase::JsonValue | ( |  | ) |

pure virtual

Generate Json::JsonValue for this object.

Implemented in openshot::EffectBase, openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::ChromaKey, openshot::Saturation, openshot::Deinterlace, openshot::Shift, openshot::Hue, and openshot::Negate.

Definition at line 33 of file ClipBase.cpp.

## operator<()

bool openshot::ClipBase::operator< | ( | ClipBase & | a | ) |

inline

Definition at line 76 of file ClipBase.h.

## operator<=()

bool openshot::ClipBase::operator<= | ( | ClipBase & | a | ) |

inline

Definition at line 77 of file ClipBase.h.

## operator>()

bool openshot::ClipBase::operator> | ( | ClipBase & | a | ) |

inline

Definition at line 78 of file ClipBase.h.

## operator>=()

bool openshot::ClipBase::operator>= | ( | ClipBase & | a | ) |

inline

Definition at line 79 of file ClipBase.h.

## PropertiesJSON()

virtual string openshot::ClipBase::PropertiesJSON | ( | int64_t | requested_frame | ) |

pure virtual

Get all properties for a specific frame (perfect for a UI to display the current state of all properties at any time)

Implemented in openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::Saturation, openshot::ChromaKey, openshot::Shift, openshot::Deinterlace, openshot::Hue, and openshot::Negate.

## SetJson()

virtual void openshot::ClipBase::SetJson | ( | string | value | ) |

pure virtual

Load JSON string into this object.

Implemented in openshot::EffectBase, openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::ChromaKey, openshot::Saturation, openshot::Deinterlace, openshot::Shift, openshot::Hue, and openshot::Negate.

## SetJsonValue()

void ClipBase::SetJsonValue | ( | Json::Value | root | ) |

pure virtual

Load Json::JsonValue into this object.

Implemented in openshot::EffectBase, openshot::Clip, openshot::Blur, openshot::Mask, openshot::ColorShift, openshot::Bars, openshot::Brightness, openshot::Crop, openshot::Pixelate, openshot::Wave, openshot::ChromaKey, openshot::Saturation, openshot::Deinterlace, openshot::Shift, openshot::Hue, and openshot::Negate.

Definition at line 49 of file ClipBase.cpp.

## SetMaxSize()

void openshot::ClipBase::SetMaxSize | ( | int | width,
|  | int | height
| ) |  |

inline

Set Max Image Size (used for performance optimization)

Definition at line 97 of file ClipBase.h.

## Member Data Documentation

## end

float openshot::ClipBase::end

protected

The position in seconds to end playing (used to trim the ending of a clip)

Definition at line 59 of file ClipBase.h.

## id

string openshot::ClipBase::id

protected

ID Property for all derived Clip and Effect classes.

Definition at line 55 of file ClipBase.h.

## layer

int openshot::ClipBase::layer

protected

The layer this clip is on. Lower clips are covered up by higher clips.

Definition at line 57 of file ClipBase.h.

## max_height

int openshot::ClipBase::max_height

protected

The maximium image height needed by this clip (used for optimizations)

Definition at line 62 of file ClipBase.h.

## max_width

int openshot::ClipBase::max_width

protected

The maximum image width needed by this clip (used for optimizations)

Definition at line 61 of file ClipBase.h.

## position

float openshot::ClipBase::position

protected

The position on the timeline where this clip should start playing.

Definition at line 56 of file ClipBase.h.

## previous_properties

string openshot::ClipBase::previous_properties

protected

This string contains the previous JSON properties.

Definition at line 60 of file ClipBase.h.

## start

float openshot::ClipBase::start

protected

The position in seconds to start playing (used to trim the beginning of a clip)

Definition at line 58 of file ClipBase.h.

The documentation for this class was generated from the following files:

- ClipBase.h
- ClipBase.cpp