summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/frame.hpp
blob: 2a221de31739902e14d430b7c461fef883b8ca98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "tracker-easy-api.h"

#include <opencv2/core.hpp>
#include <QImage>



struct Preview
{
    Preview(int w, int h);

    Preview& operator=(const cv::Mat& frame);
    QImage get_bitmap();
    void draw_head_center(Coordinates::f x, Coordinates::f y);

    operator cv::Mat&() { return frame_copy; }
    operator cv::Mat const&() const { return frame_copy; }

private:
    static void ensure_size(cv::Mat& frame, int w, int h, int type);

    cv::Mat frame_copy, frame_out;
    cv::Mat iFrameRgb;
};