blob: a32147b19ad7685c61639598231e910d81a4904d [file] [log] [blame]
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +01001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "CvWindowOutput.hpp"
7
8namespace od
9{
10
11void CvWindowOutput::Init(const std::string& windowName)
12{
13 m_windowName = windowName;
14 cv::namedWindow(m_windowName, cv::WINDOW_AUTOSIZE);
15}
16
17void CvWindowOutput::WriteFrame(std::shared_ptr<cv::Mat>& frame)
18{
19 cv::cvtColor(*frame, *frame, cv::COLOR_RGB2BGR);
20 cv::imshow( m_windowName, *frame);
21 cv::waitKey(30);
22}
23
24void CvWindowOutput::Close()
25{
26 cv::destroyWindow(m_windowName);
27}
28
29bool CvWindowOutput::IsReady() const
30{
31 return true;
32}
33}// namespace od