WPILibC++  2020.3.2-60-g3011ebe
cs::ImageSink Class Reference

A base class for single image reading sinks. More...

#include <cscore_oo.h>

Inheritance diagram for cs::ImageSink:
cs::VideoSink

Public Member Functions

void SetDescription (const wpi::Twine &description)
 Set sink description. More...
 
std::string GetError () const
 Get error string. More...
 
void SetEnabled (bool enabled)
 Enable or disable getting new frames. More...
 
- Public Member Functions inherited from cs::VideoSink
 VideoSink (const VideoSink &sink)
 
 VideoSink (VideoSink &&sink) noexcept
 
VideoSinkoperator= (VideoSink other) noexcept
 
 operator bool () const
 
int GetHandle () const
 
bool operator== (const VideoSink &other) const
 
bool operator!= (const VideoSink &other) const
 
Kind GetKind () const
 Get the kind of the sink.
 
std::string GetName () const
 Get the name of the sink. More...
 
std::string GetDescription () const
 Get the sink description. More...
 
VideoProperty GetProperty (const wpi::Twine &name)
 Get a property of the sink. More...
 
std::vector< VideoPropertyEnumerateProperties () const
 Enumerate all properties of this sink.
 
bool SetConfigJson (wpi::StringRef config)
 Set properties from a JSON configuration string. More...
 
bool SetConfigJson (const wpi::json &config)
 Set properties from a JSON configuration object. More...
 
std::string GetConfigJson () const
 Get a JSON configuration string. More...
 
wpi::json GetConfigJsonObject () const
 Get a JSON configuration object. More...
 
void SetSource (VideoSource source)
 Configure which source should provide frames to this sink. More...
 
VideoSource GetSource () const
 Get the connected source. More...
 
VideoProperty GetSourceProperty (const wpi::Twine &name)
 Get a property of the associated source. More...
 
CS_Status GetLastStatus () const
 

Additional Inherited Members

- Public Types inherited from cs::VideoSink
enum  Kind { kUnknown = CS_SINK_UNKNOWN, kMjpeg = CS_SINK_MJPEG, kCv = CS_SINK_CV }
 
- Static Public Member Functions inherited from cs::VideoSink
static std::vector< VideoSinkEnumerateSinks ()
 Enumerate all existing sinks. More...
 
- Protected Member Functions inherited from cs::VideoSink
 VideoSink (CS_Sink handle)
 
- Protected Attributes inherited from cs::VideoSink
CS_Status m_status = 0
 
CS_Sink m_handle
 

Detailed Description

A base class for single image reading sinks.

Member Function Documentation

◆ GetError()

std::string cs::ImageSink::GetError ( ) const
inline

Get error string.

Call this if WaitForFrame() returns 0 to determine what the error is.

◆ SetDescription()

void cs::ImageSink::SetDescription ( const wpi::Twine description)
inline

Set sink description.

Parameters
descriptionDescription

◆ SetEnabled()

void cs::ImageSink::SetEnabled ( bool  enabled)
inline

Enable or disable getting new frames.

Disabling will cause processFrame (for callback-based CvSinks) to not be called and WaitForFrame() to not return. This can be used to save processor resources when frames are not needed.


The documentation for this class was generated from the following files: