blob: 190a7602e269983088d6d29e047109099d8b8b61 [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
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +01008namespace common
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +01009{
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}
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +010033}// namespace common