Tabs->spaces in OpenCV effect headers

This commit is contained in:
FeRD (Frank Dana)
2021-03-31 20:12:47 -04:00
parent c723ee11ca
commit 9be8e29790
4 changed files with 121 additions and 118 deletions

View File

@@ -59,57 +59,57 @@ struct DetectionData{
namespace openshot
{
/**
* @brief This effect displays all the detected objects on a clip.
*/
class ObjectDetection : public EffectBase
{
private:
std::string protobuf_data_path;
std::map<size_t, DetectionData> detectionsData;
std::vector<std::string> classNames;
/**
* @brief This effect displays all the detected objects on a clip.
*/
class ObjectDetection : public EffectBase
{
private:
std::string protobuf_data_path;
std::map<size_t, DetectionData> detectionsData;
std::vector<std::string> classNames;
std::vector<cv::Scalar> classesColor;
std::vector<cv::Scalar> classesColor;
/// Init effect settings
void init_effect_details();
/// Init effect settings
void init_effect_details();
void drawPred(int classId, float conf, cv::Rect2d box, cv::Mat& frame);
void drawPred(int classId, float conf, cv::Rect2d box, cv::Mat& frame);
public:
public:
ObjectDetection();
ObjectDetection(std::string clipTrackerDataPath);
ObjectDetection(std::string clipTrackerDataPath);
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<Frame>(), frame_number); }
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared<Frame>(), frame_number); }
/// Load protobuf data file
/// Load protobuf data file
bool LoadObjDetectdData(std::string inputFilePath);
DetectionData GetTrackedData(size_t frameId);
DetectionData GetTrackedData(size_t frameId);
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
}

View File

@@ -75,57 +75,57 @@ struct EffectCamTrajectory
namespace openshot
{
/**
* @brief This class stabilizes video clip to remove undesired shaking and jitter.
*
* Adding stabilization is useful to increase video quality overall, since it removes
* from subtle to harsh unexpected camera movements.
*/
class Stabilizer : public EffectBase
{
private:
/// Init effect settings
void init_effect_details();
std::string protobuf_data_path;
Keyframe zoom;
/**
* @brief This class stabilizes video clip to remove undesired shaking and jitter.
*
* Adding stabilization is useful to increase video quality overall, since it removes
* from subtle to harsh unexpected camera movements.
*/
class Stabilizer : public EffectBase
{
private:
/// Init effect settings
void init_effect_details();
std::string protobuf_data_path;
Keyframe zoom;
public:
std::string teste;
std::map <size_t,EffectCamTrajectory> trajectoryData; // Save camera trajectory data
std::map <size_t,EffectTransformParam> transformationData; // Save transormation data
public:
std::string teste;
std::map <size_t,EffectCamTrajectory> trajectoryData; // Save camera trajectory data
std::map <size_t,EffectTransformParam> transformationData; // Save transormation data
Stabilizer();
Stabilizer(std::string clipTrackerDataPath);
Stabilizer(std::string clipTrackerDataPath);
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
};
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
};
/// Load protobuf data file
bool LoadStabilizedData(std::string inputFilePath);
/// Load protobuf data file
bool LoadStabilizedData(std::string inputFilePath);
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
}

View File

@@ -72,54 +72,56 @@ struct EffectFrameData{
namespace openshot
{
/**
* @brief This class track a given object through the clip and, when called, draws a box surrounding it.
*
* Tracking is useful to better visualize and follow the movement of an object through video.
*/
class Tracker : public EffectBase
{
private:
/// Init effect settings
void init_effect_details();
std::string protobuf_data_path;
/**
* @brief This class track a given object through the clip and, when called, draws a box surrounding it.
*
* Tracking is useful to better visualize and follow the movement of an object through video.
*/
class Tracker : public EffectBase
{
private:
/// Init effect settings
void init_effect_details();
std::string protobuf_data_path;
public:
public:
std::map<int, EffectFrameData> trackedDataById; // Save object tracking box data
std::map<int, EffectFrameData> trackedDataById; // Save object tracking box data
/// Blank constructor, useful when using Json to load the effect properties
Tracker(std::string clipTrackerDataPath);
/// Default constructor
Tracker();
Tracker(std::string clipTrackerDataPath);
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }
/// @brief This method is required for all derived classes of EffectBase, and returns a
/// modified openshot::Frame object
///
/// The frame object is passed into this method, and a frame_number is passed in which
/// tells the effect which settings to use from its keyframes (starting at 1).
///
/// @returns The modified openshot::Frame object
/// @param frame The frame object that needs the effect applied to it
/// @param frame_number The frame number (starting at 1) of the effect on the timeline.
std::shared_ptr<Frame> GetFrame(std::shared_ptr<Frame> frame, int64_t frame_number) override;
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override { return GetFrame(std::shared_ptr<Frame> (new Frame()), frame_number); }
// Load protobuf data file
bool LoadTrackedData(std::string inputFilePath);
/// Load protobuf data file
bool LoadTrackedData(std::string inputFilePath);
// Get tracker info for the desired frame
EffectFrameData GetTrackedData(size_t frameId);
/// Get tracker info for the desired frame
EffectFrameData GetTrackedData(size_t frameId);
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
// Get and Set JSON methods
std::string Json() const override; ///< Generate JSON string of this object
void SetJson(const std::string value) override; ///< Load JSON string into this object
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
/// Get all properties for a specific frame (perfect for a UI to display the current state
/// of all properties at any time)
std::string PropertiesJSON(int64_t requested_frame) const override;
};
}

View File

@@ -57,6 +57,7 @@ TEST(Constructor)
// Check values
CHECK_EQUAL(640, t1.info.width);
CHECK_EQUAL(480, t1.info.height);
CHECK_EQUAL("Timeline", t1.Name());
// Create a default fraction (should be 1/1)
Timeline t2(300, 240, fps, 44100, 2, LAYOUT_STEREO);