<commit_before>#include "zoomrectangle.h"

/**
 * @brief zoomrectangle::zoomrectangle
 */
zoomrectangle::zoomrectangle() : rectangle(QColor(0, 255, 0), QPoint(0, 0)) {
}

/**
 * @brief zoomrectangle::zoomrectangle
 * @param pos Starting point for the new object.
 */
zoomrectangle::zoomrectangle(QPoint pos) : rectangle(QColor(0, 255, 0), pos) {
}

/**
 * @brief shape::update_drawing_pos
 * Updates the position of the end point of the drawing.
 * (Overrides the function in the shape class.)
 * @param pos
 */
void zoomrectangle::update_drawing_pos(QPoint pos) {
    // The zoom area has to be inside the video.
    draw_end = bounded_coords(pos);
}

/**
 * @brief zoomrectangle::set_start_pos
 * Used when the user presses the mouse button to start choosing an area.
 * @param pos The start position of the object.
 */
void zoomrectangle::set_start_pos(QPoint pos) {
    // The zoom area has to be inside the video.
    draw_start = bounded_coords(pos);
}

/**
 * @brief zoomrectangle::area_choosen
 * Called when the mouse has been released and an area
 * has been choosen. If it is a valid area it's stored
 * as the current zoom level.
 */
void zoomrectangle::choose_area() {
    // Rectangle starts in the top left corner, with positive width and height
    cv::Rect rect(draw_start, draw_end);

    // Zoom limit<commit_msg>Edited comment in zoom-rect.<commit_after>#include "zoomrectangle.h"

/**
 * @brief zoomrectangle::zoomrectangle
 */
zoomrectangle::zoomrectangle() : rectangle(QColor(0, 255, 0), QPoint(0, 0)) {
}

/**
 * @brief zoomrectangle::zoomrectangle
 * @param pos Starting point for the new object.
 */
zoomrectangle::zoomrectangle(QPoint pos) : rectangle(QColor(0, 255, 0), pos) {
}

/**
 * @brief shape::update_drawing_pos
 * Updates the position of the end point of the drawing.
 * Coordinates outside the frame are moved to the closest
 * coordinate on the frame.
 * (Overrides the function in the shape class.)
 * @param pos
 */
void zoomrectangle::update_drawing_pos(QPoint pos) {
    // The zoom area has to be inside the video.
    draw_end = bounded_coords(pos);
}

/**
 * @brief zoomrectangle::set_start_pos
 * Used when the user presses the mouse button to start choosing an area.
 * Coordinates outside the frame are moved to the closest
 * coordinate on the frame.
 * @param pos The start position of the object.
 */
void zoomrectangle::set_start_pos(QPoint pos) {
    // The zoom area has to be inside the video.
    draw_start = bounded_coords(pos);
}

/**
 * @brief zoomrectangle::area_choosen
 * Called when the mouse has been released and an area
 * has been choosen. If it is a valid area it's stored
 * as the current zoom level.
 */
void zoomrectangle::choose_area() {
    // Rectangle starts in the top left corner, with positive width and height
    cv::Rect rect(draw_start, draw_end);

    // Zoom limit
{'fraction_non_alphanumeric': 0.10592774465099965, 'fraction_numerical': 0.008418098912662224, 'mean_word_length': 3.9686411149825784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2537185', 'n_tokens_mistral': 891, 'n_tokens_neox': 864, 'n_words': 318}