<commit_before>#include "analysisoverlay.h"

/**
 * @brief AnalysisOverlay::AnalysisOverlay
 */
AnalysisOverlay::AnalysisOverlay() {
    add_area(2, cv::Point(50,50), cv::Point(150,150));
    add_area(3, cv::Point(50,50), cv::Point(150,150));
    add_area(4, cv::Point(50,50), cv::Point(150,150));
    add_area(5, cv::Point(50,50), cv::Point(150,150));
    add_area(6, cv::Point(50,50), cv::Point(150,150));
    add_area(7, cv::Point(50,50), cv::Point(150,150));
    add_area(8, cv::Point(50,50), cv::Point(150,150));
    add_area(9, cv::Point(50,50), cv::Point(150,150));
    add_area(10, cv::Point(150,150), cv::Point(250,170));
}

/**
 * @brief AnalysisOverlay::draw_overlay
 * Draws an overlay with the detected areas, on top of the specified frame.
 * @param img Frame to draw on
 * @param frame_nr Number of the frame currently shown in the video.
 */
cv::Mat AnalysisOverlay::draw_overlay(cv::Mat &frame, int frame_nr) {
    if (showing_overlay) {
        for (std::pair<cv::Point, cv::Point> area : detections[frame_nr]) {
            cv::Rect rect(area.first, area.second);
            cv::rectangle(frame, rect, cv::Scalar(255, 0, 0), 5);
        }
    }
    return frame;
}

/**
 * @brief AnalysisOverlay::add_area
 * @param frame_nr Frame associated with the area.
 * @param start Start point.
 * @param end End point.
 */
void AnalysisOverlay::add_area(int frame_nr, cv::Point start, cv::Point end) {
    std::pair <cv::Point, cv::Point> pair(start, end);
    detections[frame_nr].push_back(pair);
}

/**
 * @brief AnalysisOverlay::is_showing_overlay
 * @return Returns true if the analysis overlay is showing, else false.
 */
bool AnalysisOverlay::is_showing_overlay() {
    return showing_overlay;
}

/**
 * @brief AnalysisOverlay::toggle_showing
 */
void AnalysisOverlay::toggle_showing() {
    showing_overlay = !showing_overlay;
}
<commit_msg>Edited comment.<commit_after>#include "analysisoverlay.h"

/**
 * @brief AnalysisOverlay::AnalysisOverlay
 */
AnalysisOverlay::AnalysisOverlay() {
    // Temporary areas to show, since there's no analysis yet.
    add_area(2, cv::Point(50,50), cv::Point(150,150));
    add_area(3, cv::Point(50,50), cv::Point(150,150));
    add_area(4, cv::Point(50,50), cv::Point(150,150));
    add_area(5, cv::Point(50,50), cv::Point(150,150));
    add_area(6, cv::Point(50,50), cv::Point(150,150));
    add_area(7, cv::Point(50,50), cv::Point(150,150));
    add_area(8, cv::Point(50,50), cv::Point(150,150));
    add_area(9, cv::Point(50,50), cv::Point(150,150));
    add_area(10, cv::Point(150,150), cv::Point(250,170));
}

/**
 * @brief AnalysisOverlay::draw_overlay
 * Draws an overlay with the detected areas, on top of the specified frame.
 * @param img Frame to draw on
 * @param frame_nr Number of the frame currently shown in the video.
 */
cv::Mat AnalysisOverlay::draw_overlay(cv::Mat &frame, int frame_nr) {
    if (showing_overlay) {
        for (std::pair<cv::Point, cv::Point> area : detections[frame_nr]) {
            cv::Rect rect(area.first, area.second);
            cv::rectangle(frame, rect, cv::Scalar(255, 0, 0), 5);
        }
    }
    return frame;
}

/**
 * @brief AnalysisOverlay::add_area
 * @param frame_nr Frame associated with the area.
 * @param start Start point.
 * @param end End point.
 */
void AnalysisOverlay::add_area(int frame_nr, cv::Point start, cv::Point end) {
    std::pair <cv::Point, cv::Point> pair(start, end);
    detections[frame_nr].push_back(pair);
}

/**
 * @brief AnalysisOverlay::is_showing_overlay
 * @return Returns true if the analysis overlay is showing, else false.
 */
bool AnalysisOverlay::is_showing_overlay() {
    return showing_overlay;
}

/**
 * @brief AnalysisOverlay::toggle_showing
 */
void AnalysisOverlay::toggle_showing() {
    showing_overlay = !showing_overlay;
}

{'fraction_non_alphanumeric': 0.1684710852917877, 'fraction_numerical': 0.05703723263797201, 'mean_word_length': 4.6706586826347305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4866982', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1302, 'n_words': 290}