Files
allwpilib/cscore/src/main/native/cpp/CvSourceImpl.h

51 lines
1.7 KiB
C
Raw Normal View History

2016-10-24 20:27:00 -07:00
/*----------------------------------------------------------------------------*/
2018-01-02 09:16:20 -08:00
/* Copyright (c) 2016-2018 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>
#include "SourceImpl.h"
namespace cs {
class CvSourceImpl : public SourceImpl {
public:
CvSourceImpl(wpi::StringRef name, const VideoMode& mode);
2016-10-24 20:27:00 -07:00
~CvSourceImpl() override;
2016-11-18 10:08:24 -08:00
void Start();
2016-10-24 20:27:00 -07:00
bool SetVideoMode(const VideoMode& mode, CS_Status* status) override;
void NumSinksChanged() override;
void NumSinksEnabledChanged() override;
// OpenCV-specific functions
void PutFrame(cv::Mat& image);
void NotifyError(wpi::StringRef msg);
int CreateProperty(wpi::StringRef name, CS_PropertyKind kind, int minimum,
2016-11-18 10:08:24 -08:00
int maximum, int step, int defaultValue, int value);
int CreateProperty(wpi::StringRef name, CS_PropertyKind kind, int minimum,
2016-11-18 10:08:24 -08:00
int maximum, int step, int defaultValue, int value,
std::function<void(CS_Property property)> onChange);
void SetEnumPropertyChoices(int property, wpi::ArrayRef<std::string> choices,
2016-10-24 20:27:00 -07:00
CS_Status* status);
private:
std::atomic_bool m_connected{true};
};
} // namespace cs
2017-08-25 17:48:06 -07:00
#endif // CSCORE_CVSOURCEIMPL_H_