WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::cs::ImageSink Class Reference

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

#include <wpi/cs/ImageSink.hpp>

Inheritance diagram for wpi::cs::ImageSink:
wpi::cs::VideoSink wpi::cs::CvSink wpi::cs::RawSink

Public Member Functions

void SetDescription (std::string_view description)
 Set sink description.
std::string GetError () const
 Get error string.
void SetEnabled (bool enabled)
 Enable or disable getting new frames.
Public Member Functions inherited from wpi::cs::VideoSink
 VideoSink () noexcept=default
 VideoSink (const VideoSink &sink)
 VideoSink (VideoSink &&other) noexcept
VideoSinkoperator= (VideoSink other) noexcept
 ~VideoSink ()
 operator bool () const
 Returns true if the VideoSink is valid.
int GetHandle () const
 Returns the VideoSink handle.
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.
std::string GetDescription () const
 Get the sink description.
VideoProperty GetProperty (std::string_view name)
 Get a property of the sink.
std::vector< VideoPropertyEnumerateProperties () const
 Enumerate all properties of this sink.
bool SetConfigJson (std::string_view config)
 Set properties from a JSON configuration string.
bool SetConfigJson (const wpi::util::json &config)
 Set properties from a JSON configuration object.
std::string GetConfigJson () const
 Get a JSON configuration string.
wpi::util::json GetConfigJsonObject () const
 Get a JSON configuration object.
void SetSource (VideoSource source)
 Configure which source should provide frames to this sink.
VideoSource GetSource () const
 Get the connected source.
VideoProperty GetSourceProperty (std::string_view name)
 Get a property of the associated source.
CS_Status GetLastStatus () const

Protected Member Functions

 ImageSink ()=default
Protected Member Functions inherited from wpi::cs::VideoSink
 VideoSink (CS_Sink handle)

Additional Inherited Members

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

Detailed Description

A base class for single image reading sinks.

Constructor & Destructor Documentation

◆ ImageSink()

wpi::cs::ImageSink::ImageSink ( )
protecteddefault

Member Function Documentation

◆ GetError()

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

Get error string.

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

◆ SetDescription()

void wpi::cs::ImageSink::SetDescription ( std::string_view description)
inline

Set sink description.

Parameters
descriptionDescription

◆ SetEnabled()

void wpi::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 file: