WPILibC++ 2024.3.2
cscore_cpp.h File Reference
#include <stdint.h>
#include <functional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include <wpi/RawFrame.h>
#include <wpi/SmallVector.h>
#include <wpi/json_fwd.h>
#include "cscore_c.h"

Go to the source code of this file.

Classes

struct  cs::UsbCameraInfo
 USB camera information. More...
 
struct  cs::VideoMode
 Video mode. More...
 
struct  cs::RawEvent
 Listener event. More...
 

Namespaces

namespace  cs
 CameraServer (cscore) namespace.
 

Typedefs

using cs::LogFunc = std::function< void(unsigned int level, const char *file, unsigned int line, const char *msg)>
 

Functions

CS_PropertyKind cs::GetPropertyKind (CS_Property property, CS_Status *status)
 
std::string cs::GetPropertyName (CS_Property property, CS_Status *status)
 
std::string_view cs::GetPropertyName (CS_Property property, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
int cs::GetProperty (CS_Property property, CS_Status *status)
 
void cs::SetProperty (CS_Property property, int value, CS_Status *status)
 
int cs::GetPropertyMin (CS_Property property, CS_Status *status)
 
int cs::GetPropertyMax (CS_Property property, CS_Status *status)
 
int cs::GetPropertyStep (CS_Property property, CS_Status *status)
 
int cs::GetPropertyDefault (CS_Property property, CS_Status *status)
 
std::string cs::GetStringProperty (CS_Property property, CS_Status *status)
 
std::string_view cs::GetStringProperty (CS_Property property, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
void cs::SetStringProperty (CS_Property property, std::string_view value, CS_Status *status)
 
std::vector< std::string > cs::GetEnumPropertyChoices (CS_Property property, CS_Status *status)
 
CS_Source cs::CreateUsbCameraDev (std::string_view name, int dev, CS_Status *status)
 
CS_Source cs::CreateUsbCameraPath (std::string_view name, std::string_view path, CS_Status *status)
 
CS_Source cs::CreateHttpCamera (std::string_view name, std::string_view url, CS_HttpCameraKind kind, CS_Status *status)
 
CS_Source cs::CreateHttpCamera (std::string_view name, std::span< const std::string > urls, CS_HttpCameraKind kind, CS_Status *status)
 
CS_Source cs::CreateCvSource (std::string_view name, const VideoMode &mode, CS_Status *status)
 
CS_SourceKind cs::GetSourceKind (CS_Source source, CS_Status *status)
 
std::string cs::GetSourceName (CS_Source source, CS_Status *status)
 
std::string_view cs::GetSourceName (CS_Source source, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
std::string cs::GetSourceDescription (CS_Source source, CS_Status *status)
 
std::string_view cs::GetSourceDescription (CS_Source source, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
uint64_t cs::GetSourceLastFrameTime (CS_Source source, CS_Status *status)
 
void cs::SetSourceConnectionStrategy (CS_Source source, CS_ConnectionStrategy strategy, CS_Status *status)
 
bool cs::IsSourceConnected (CS_Source source, CS_Status *status)
 
bool cs::IsSourceEnabled (CS_Source source, CS_Status *status)
 
CS_Property cs::GetSourceProperty (CS_Source source, std::string_view name, CS_Status *status)
 
std::span< CS_Propertycs::EnumerateSourceProperties (CS_Source source, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
 
VideoMode cs::GetSourceVideoMode (CS_Source source, CS_Status *status)
 
bool cs::SetSourceVideoMode (CS_Source source, const VideoMode &mode, CS_Status *status)
 
bool cs::SetSourcePixelFormat (CS_Source source, VideoMode::PixelFormat pixelFormat, CS_Status *status)
 
bool cs::SetSourceResolution (CS_Source source, int width, int height, CS_Status *status)
 
bool cs::SetSourceFPS (CS_Source source, int fps, CS_Status *status)
 
bool cs::SetSourceConfigJson (CS_Source source, std::string_view config, CS_Status *status)
 
bool cs::SetSourceConfigJson (CS_Source source, const wpi::json &config, CS_Status *status)
 
std::string cs::GetSourceConfigJson (CS_Source source, CS_Status *status)
 
wpi::json cs::GetSourceConfigJsonObject (CS_Source source, CS_Status *status)
 
std::vector< VideoMode > cs::EnumerateSourceVideoModes (CS_Source source, CS_Status *status)
 
std::span< CS_Sinkcs::EnumerateSourceSinks (CS_Source source, wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
 
CS_Source cs::CopySource (CS_Source source, CS_Status *status)
 
void cs::ReleaseSource (CS_Source source, CS_Status *status)
 
void cs::SetCameraBrightness (CS_Source source, int brightness, CS_Status *status)
 
int cs::GetCameraBrightness (CS_Source source, CS_Status *status)
 
void cs::SetCameraWhiteBalanceAuto (CS_Source source, CS_Status *status)
 
void cs::SetCameraWhiteBalanceHoldCurrent (CS_Source source, CS_Status *status)
 
void cs::SetCameraWhiteBalanceManual (CS_Source source, int value, CS_Status *status)
 
void cs::SetCameraExposureAuto (CS_Source source, CS_Status *status)
 
void cs::SetCameraExposureHoldCurrent (CS_Source source, CS_Status *status)
 
void cs::SetCameraExposureManual (CS_Source source, int value, CS_Status *status)
 
void cs::SetUsbCameraPath (CS_Source, std::string_view path, CS_Status *status)
 
std::string cs::GetUsbCameraPath (CS_Source source, CS_Status *status)
 
UsbCameraInfo cs::GetUsbCameraInfo (CS_Source source, CS_Status *status)
 
CS_HttpCameraKind cs::GetHttpCameraKind (CS_Source source, CS_Status *status)
 
void cs::SetHttpCameraUrls (CS_Source source, std::span< const std::string > urls, CS_Status *status)
 
std::vector< std::string > cs::GetHttpCameraUrls (CS_Source source, CS_Status *status)
 
void cs::NotifySourceError (CS_Source source, std::string_view msg, CS_Status *status)
 
void cs::SetSourceConnected (CS_Source source, bool connected, CS_Status *status)
 
void cs::SetSourceDescription (CS_Source source, std::string_view description, CS_Status *status)
 
CS_Property cs::CreateSourceProperty (CS_Source source, std::string_view name, CS_PropertyKind kind, int minimum, int maximum, int step, int defaultValue, int value, CS_Status *status)
 
void cs::SetSourceEnumPropertyChoices (CS_Source source, CS_Property property, std::span< const std::string > choices, CS_Status *status)
 
CS_Sink cs::CreateMjpegServer (std::string_view name, std::string_view listenAddress, int port, CS_Status *status)
 
CS_Sink cs::CreateCvSink (std::string_view name, VideoMode::PixelFormat pixelFormat, CS_Status *status)
 
CS_Sink cs::CreateCvSinkCallback (std::string_view name, VideoMode::PixelFormat pixelFormat, std::function< void(uint64_t time)> processFrame, CS_Status *status)
 
CS_SinkKind cs::GetSinkKind (CS_Sink sink, CS_Status *status)
 
std::string cs::GetSinkName (CS_Sink sink, CS_Status *status)
 
std::string_view cs::GetSinkName (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
std::string cs::GetSinkDescription (CS_Sink sink, CS_Status *status)
 
std::string_view cs::GetSinkDescription (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
CS_Property cs::GetSinkProperty (CS_Sink sink, std::string_view name, CS_Status *status)
 
std::span< CS_Propertycs::EnumerateSinkProperties (CS_Sink sink, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
 
void cs::SetSinkSource (CS_Sink sink, CS_Source source, CS_Status *status)
 
CS_Property cs::GetSinkSourceProperty (CS_Sink sink, std::string_view name, CS_Status *status)
 
bool cs::SetSinkConfigJson (CS_Sink sink, std::string_view config, CS_Status *status)
 
bool cs::SetSinkConfigJson (CS_Sink sink, const wpi::json &config, CS_Status *status)
 
std::string cs::GetSinkConfigJson (CS_Sink sink, CS_Status *status)
 
wpi::json cs::GetSinkConfigJsonObject (CS_Sink sink, CS_Status *status)
 
CS_Source cs::GetSinkSource (CS_Sink sink, CS_Status *status)
 
CS_Sink cs::CopySink (CS_Sink sink, CS_Status *status)
 
void cs::ReleaseSink (CS_Sink sink, CS_Status *status)
 
std::string cs::GetMjpegServerListenAddress (CS_Sink sink, CS_Status *status)
 
int cs::GetMjpegServerPort (CS_Sink sink, CS_Status *status)
 
void cs::SetSinkDescription (CS_Sink sink, std::string_view description, CS_Status *status)
 
std::string cs::GetSinkError (CS_Sink sink, CS_Status *status)
 
std::string_view cs::GetSinkError (CS_Sink sink, wpi::SmallVectorImpl< char > &buf, CS_Status *status)
 
void cs::SetSinkEnabled (CS_Sink sink, bool enabled, CS_Status *status)
 
void cs::SetListenerOnStart (std::function< void()> onStart)
 
void cs::SetListenerOnExit (std::function< void()> onExit)
 
CS_Listener cs::AddListener (std::function< void(const RawEvent &event)> callback, int eventMask, bool immediateNotify, CS_Status *status)
 
void cs::RemoveListener (CS_Listener handle, CS_Status *status)
 
CS_ListenerPoller cs::CreateListenerPoller ()
 
void cs::DestroyListenerPoller (CS_ListenerPoller poller)
 
CS_Listener cs::AddPolledListener (CS_ListenerPoller poller, int eventMask, bool immediateNotify, CS_Status *status)
 
std::vector< RawEvent > cs::PollListener (CS_ListenerPoller poller)
 
std::vector< RawEvent > cs::PollListener (CS_ListenerPoller poller, double timeout, bool *timedOut)
 
void cs::CancelPollListener (CS_ListenerPoller poller)
 
bool cs::NotifierDestroyed ()
 
void cs::SetTelemetryPeriod (double seconds)
 
double cs::GetTelemetryElapsedTime ()
 
int64_t cs::GetTelemetryValue (CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
 
double cs::GetTelemetryAverageValue (CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
 
void cs::SetLogger (LogFunc func, unsigned int min_level)
 
void cs::SetDefaultLogger (unsigned int min_level)
 
void cs::Shutdown ()
 
std::vector< UsbCameraInfo > cs::EnumerateUsbCameras (CS_Status *status)
 
std::span< CS_Sourcecs::EnumerateSourceHandles (wpi::SmallVectorImpl< CS_Source > &vec, CS_Status *status)
 
std::span< CS_Sinkcs::EnumerateSinkHandles (wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
 
std::string cs::GetHostname ()
 
std::vector< std::string > cs::GetNetworkInterfaces ()