mirror of https://github.com/Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
947 B
53 lines
947 B
// |
|
// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
|
// SPDX-License-Identifier: MIT |
|
// |
|
|
|
#pragma once |
|
|
|
#include "IFrameOutput.hpp" |
|
#include <opencv2/opencv.hpp> |
|
|
|
namespace common |
|
{ |
|
|
|
class CvWindowOutput : public IFrameOutput<cv::Mat> { |
|
public: |
|
|
|
CvWindowOutput() = default; |
|
|
|
~CvWindowOutput() override = default; |
|
|
|
/** |
|
* @brief Creates a named window. |
|
* |
|
* Uses opencv to create a window with given name. |
|
* |
|
* @param windowName opencv window name. |
|
* |
|
*/ |
|
void Init(const std::string& windowName); |
|
|
|
/** |
|
* Writes frame to the window. |
|
* |
|
* @param frame data to write. |
|
*/ |
|
void WriteFrame(std::shared_ptr<cv::Mat>& frame) override; |
|
|
|
/** |
|
* Releases all windows. |
|
*/ |
|
void Close() override; |
|
|
|
/** |
|
* Always true. |
|
* @return true. |
|
*/ |
|
bool IsReady() const override; |
|
|
|
private: |
|
std::string m_windowName; |
|
|
|
}; |
|
}// namespace common
|