* @brief A Keyframe is a collection of Point instances, which is used to vary a number or property over time. * * Keyframes are used to animate and interpolate values of properties over time. For example, a single property * can use a Keyframe instead of a constant value. Assume you want to slide an image (from left to right) over * a video. You can create a Keyframe which will adjust t
| 51 | * \endcode |
| 52 | */ |
| 53 | class Keyframe { |
| 54 | |
| 55 | |
| 56 | private: |
| 57 | std::vector<Point> Points; ///< Vector of all Points |
| 58 | |
| 59 | public: |
| 60 | /// Default constructor for the Keyframe class |
| 61 | Keyframe() = default; |
| 62 | |
| 63 | /// Constructor which sets the default point & coordinate at X=1 |
| 64 | Keyframe(double value); |
| 65 | |
| 66 | /// Constructor which adds a supplied vector of Points |
| 67 | Keyframe(const std::vector<openshot::Point>& points); |
| 68 | |
| 69 | /// Destructor |
| 70 | ~Keyframe(); |
| 71 | |
| 72 | /// Add a new point on the key-frame. Each point has a primary coordinate, a left handle, and a right handle. |
| 73 | void AddPoint(Point p); |
| 74 | |
| 75 | /// Add a new point on the key-frame, with optional interpolation type |
| 76 | void AddPoint(double x, double y, InterpolationType interpolate=BEZIER); |
| 77 | |
| 78 | /// Does this keyframe contain a specific point |
| 79 | bool Contains(Point p) const; |
| 80 | |
| 81 | /// Flip all the points in this openshot::Keyframe (useful for reversing an effect or transition, etc...) |
| 82 | void FlipPoints(); |
| 83 | |
| 84 | /// Get the index of a point by matching a coordinate |
| 85 | int64_t FindIndex(Point p) const; |
| 86 | |
| 87 | /// Get the value at a specific index |
| 88 | double GetValue(int64_t index) const; |
| 89 | |
| 90 | /// Get the rounded INT value at a specific index |
| 91 | int GetInt(int64_t index) const; |
| 92 | |
| 93 | /// Get the rounded LONG value at a specific index |
| 94 | int64_t GetLong(int64_t index) const; |
| 95 | |
| 96 | /// Get the change in Y value (from the previous Y value) |
| 97 | double GetDelta(int64_t index) const; |
| 98 | |
| 99 | /// Get a point at a specific index |
| 100 | Point const & GetPoint(int64_t index) const; |
| 101 | |
| 102 | /// Get current point (or closest point to the right) from the X coordinate (i.e. the frame number) |
| 103 | Point GetClosestPoint(Point p) const; |
| 104 | |
| 105 | /// Get current point (or closest point) from the X coordinate (i.e. the frame number) |
| 106 | /// Either use the closest left point, or right point |
| 107 | Point GetClosestPoint(Point p, bool useLeft) const; |
| 108 | |
| 109 | /// Get previous point ( |
| 110 | Point GetPreviousPoint(Point p) const; |
no outgoing calls
no test coverage detected