From 1d1a608a5cc4352d6884a141024258285b423e7f Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 17 Feb 2015 00:21:57 -0600 Subject: [PATCH] Added GetColorHex() function to the openshot::Color class, which returns a Hex string of a color at any frame number. Added new "hash" and "changed" properties to the openshot::Clip Properties JSON method, to help a UI determine if something has changed in the property values. Lastly, added new unit tests for both classes. --- include/Clip.h | 1 + include/Color.h | 6 +- src/Clip.cpp | 19 +++++++ src/Color.cpp | 10 ++++ src/examples/Example.cpp | 1 - tests/Clip_Tests.cpp | 115 +++++++++++++++++++++++++++++++++++++++ tests/Color_Tests.cpp | 20 +++++++ 7 files changed, 170 insertions(+), 2 deletions(-) diff --git a/include/Clip.h b/include/Clip.h index 29194bb3..bd44cda1 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -91,6 +91,7 @@ namespace openshot { class Clip : public ClipBase { private: bool waveform; ///< Should a waveform be used instead of the clip's image + string previous_properties; ///< This string contains the previous JSON properties // Audio resampler (if time mapping) AudioResampler *resampler; diff --git a/include/Color.h b/include/Color.h index faeb21a6..00d420f0 100644 --- a/include/Color.h +++ b/include/Color.h @@ -29,13 +29,14 @@ #define OPENSHOT_COLOR_H #include "KeyFrame.h" +#include namespace openshot { /** * @brief This struct represents a color (used on the timeline and clips) * - * Colors are represented by 4 curves, representing red, green, and blue. The curves + * Colors are represented by 3 curves, representing red, green, and blue. The curves * can be used to animate colors over time. */ struct Color{ @@ -43,6 +44,9 @@ namespace openshot { Keyframe green; ///