- Reduced crazy-long line lengths by moving trailing comments to
previous line
- Added more openshot:: prefixing, which causes Doxygen to link to
the referenced object's documentation. (It doesn't always pick
up cross-class links, without the prefix.)
- The new ordering (with the frame rate AFTER width and height) doesn't
match the other signature, but it *is* consistent with the Timeline
constructor, and it just feels more natural
- Added overloaded-function notes to doxygen strings in FFmpegWriter.h
- Also added a warning about the argument order mismatch above
Add a new #define HAVE_HW_ACCEL, which is only set on FFmpeg 3.4+,
and use that to restrict the use of hw-accel features, leaving
IS_FFMPEG_3_2 to determine only whether code is compatible with
FFmpeg 3.2+.
A few headers contained #defines that were intended to work around
issues with the JUCE library headers, but those things are best
handled in other ways.
- GetValue() calculates the value at the given position now ondemand,
without caching values as previously. First, it uses binary search
to find the segment (start and end point) containing the given
position. Constant and linear interpolation are straightforward,
bezier curves are calculating by binary search between the end
points until a point on the curve is found with a X coordinate close
enough to the given position. That points Y coordinate is returned.
- IsIncreasing(), GetRepeatFraction(), GetDelta() use GetValue()
instead of accessing the (removed) Values vector.
- Removed now unused private functions, and the unused public
Process().
First test results show good performance improvements for the
"rendering case" (setting up the keyframe points at once, then getting
all values) and drastic performance improvements for the "preview
case" (changing keyframe points, mixed with getting values).
Returning a non constant reference is not possible; this allows
outside code to invalidate internal invariants (sorted order of
points) by modifying the returned point. To make updates the current
best approach is to remove the point by index, and then add it again.
The Values vector should only be accessed from the outside through the
GetValue() function. The Points vector should only be accessed using
the AddPoint(), RemovePoint(), .. functions.
This helps maintain internal invariants (e.g. keeping Points sorted)
and allows for future removal / lazy evaluation of Values.
The size() of the vectors had been accessed from various parts of the
code; the GetLength() (for Values) and GetCount() (for Points) member
functions provide access to this information and are already part of
the public API.
AddPoint() now searches (binary search) for the best place to insert a
new point, thus always maintaining the order of Points. Therefore,
ReorderPoints() is no longer needed.
CAVEAT: This breaks if some outside code changes (the public member)
Points!