2016-10-24 20:27:00 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2019-05-30 19:12:05 -07:00
|
|
|
/* Copyright (c) 2016-2019 FIRST. All Rights Reserved. */
|
2016-10-24 20:27:00 -07:00
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#ifndef CSCORE_CVSOURCEIMPL_H_
|
|
|
|
|
#define CSCORE_CVSOURCEIMPL_H_
|
2016-10-24 20:27:00 -07:00
|
|
|
|
|
|
|
|
#include <atomic>
|
|
|
|
|
#include <functional>
|
2017-08-25 17:48:06 -07:00
|
|
|
#include <memory>
|
|
|
|
|
#include <string>
|
2016-10-24 20:27:00 -07:00
|
|
|
#include <vector>
|
|
|
|
|
|
2018-10-31 20:22:58 -07:00
|
|
|
#include <opencv2/core/core.hpp>
|
|
|
|
|
#include <wpi/ArrayRef.h>
|
|
|
|
|
#include <wpi/Twine.h>
|
|
|
|
|
|
2019-05-30 19:12:05 -07:00
|
|
|
#include "ConfigurableSourceImpl.h"
|
2016-10-24 20:27:00 -07:00
|
|
|
#include "SourceImpl.h"
|
|
|
|
|
|
|
|
|
|
namespace cs {
|
|
|
|
|
|
2019-05-30 19:12:05 -07:00
|
|
|
class CvSourceImpl : public ConfigurableSourceImpl {
|
2016-10-24 20:27:00 -07:00
|
|
|
public:
|
2018-10-31 20:22:58 -07:00
|
|
|
CvSourceImpl(const wpi::Twine& name, wpi::Logger& logger, Notifier& notifier,
|
|
|
|
|
Telemetry& telemetry, const VideoMode& mode);
|
2016-10-24 20:27:00 -07:00
|
|
|
~CvSourceImpl() override;
|
|
|
|
|
|
|
|
|
|
// OpenCV-specific functions
|
|
|
|
|
void PutFrame(cv::Mat& image);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::atomic_bool m_connected{true};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace cs
|
|
|
|
|
|
2017-08-25 17:48:06 -07:00
|
|
|
#endif // CSCORE_CVSOURCEIMPL_H_
|