5#ifndef CSCORE_CSCORE_CPP_H_
6#define CSCORE_CSCORE_CPP_H_
23#pragma warning(disable : 26495)
211 std::span<const std::string> urls,
309 int step,
int defaultValue,
int value,
312 std::span<const std::string> choices,
324 std::function<
void(
uint64_t time)> processFrame,
387 int eventMask,
bool immediateNotify,
CS_Status* status);
394 bool immediateNotify,
CS_Status* status);
419using LogFunc = std::function<void(
unsigned int level,
const char*
file,
420 unsigned int line,
const char* msg)>;
This file defines the SmallVector class.
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:192
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition: ThirdPartyNotices.txt:111
a class to store JSON values
Definition: json.h:2655
basic_string_view< char > string_view
Definition: core.h:520
CS_ConnectionStrategy
Connection strategy.
Definition: cscore_c.h:188
CS_HttpCameraKind
HTTP Camera kinds.
Definition: cscore_c.h:136
CS_PropertyKind
Property kinds.
Definition: cscore_c.h:114
CS_TelemetryKind
Telemetry kinds.
Definition: cscore_c.h:182
CS_SinkKind
Sink kinds.
Definition: cscore_c.h:146
CS_SourceKind
Source kinds.
Definition: cscore_c.h:125
@ CS_SOURCE_PROPERTY_CREATED
Definition: cscore_c.h:163
@ CS_SOURCE_VIDEOMODES_UPDATED
Definition: cscore_c.h:161
@ CS_SINK_PROPERTY_VALUE_UPDATED
Definition: cscore_c.h:174
@ CS_SOURCE_CONNECTED
Definition: cscore_c.h:159
@ CS_TELEMETRY_UPDATED
Definition: cscore_c.h:172
@ CS_SINK_ENABLED
Definition: cscore_c.h:169
@ CS_USB_CAMERAS_CHANGED
Definition: cscore_c.h:176
@ CS_SOURCE_CREATED
Definition: cscore_c.h:157
@ CS_SINK_DESTROYED
Definition: cscore_c.h:168
@ CS_SINK_PROPERTY_CREATED
Definition: cscore_c.h:173
@ CS_SINK_PROPERTY_CHOICES_UPDATED
Definition: cscore_c.h:175
@ CS_NETWORK_INTERFACES_CHANGED
Definition: cscore_c.h:171
@ CS_SOURCE_VIDEOMODE_CHANGED
Definition: cscore_c.h:162
@ CS_SINK_SOURCE_CHANGED
Definition: cscore_c.h:166
@ CS_SOURCE_PROPERTY_VALUE_UPDATED
Definition: cscore_c.h:164
@ CS_SOURCE_DISCONNECTED
Definition: cscore_c.h:160
@ CS_SOURCE_DESTROYED
Definition: cscore_c.h:158
@ CS_SINK_CREATED
Definition: cscore_c.h:167
@ CS_SOURCE_PROPERTY_CHOICES_UPDATED
Definition: cscore_c.h:165
@ CS_SINK_DISABLED
Definition: cscore_c.h:170
@ CS_PIXFMT_BGR
Definition: cscore_c.h:95
@ CS_PIXFMT_GRAY
Definition: cscore_c.h:96
@ CS_PIXFMT_RGB565
Definition: cscore_c.h:94
@ CS_PIXFMT_Y16
Definition: cscore_c.h:97
@ CS_PIXFMT_MJPEG
Definition: cscore_c.h:92
@ CS_PIXFMT_YUYV
Definition: cscore_c.h:93
@ CS_PIXFMT_UNKNOWN
Definition: cscore_c.h:91
@ CS_PIXFMT_UYVY
Definition: cscore_c.h:98
@ CS_INVALID_HANDLE
Definition: cscore_c.h:60
int GetCameraBrightness(CS_Source source, CS_Status *status)
void SetCameraExposureManual(CS_Source source, int value, CS_Status *status)
void SetCameraExposureAuto(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceManual(CS_Source source, int value, CS_Status *status)
void SetCameraBrightness(CS_Source source, int brightness, CS_Status *status)
void SetCameraWhiteBalanceHoldCurrent(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceAuto(CS_Source source, CS_Status *status)
void SetCameraExposureHoldCurrent(CS_Source source, CS_Status *status)
std::vector< std::string > GetHttpCameraUrls(CS_Source source, CS_Status *status)
void SetHttpCameraUrls(CS_Source source, std::span< const std::string > urls, CS_Status *status)
CS_HttpCameraKind GetHttpCameraKind(CS_Source source, CS_Status *status)
CS_ListenerPoller CreateListenerPoller()
CS_Listener AddListener(std::function< void(const RawEvent &event)> callback, int eventMask, bool immediateNotify, CS_Status *status)
std::vector< RawEvent > PollListener(CS_ListenerPoller poller)
void CancelPollListener(CS_ListenerPoller poller)
CS_Listener AddPolledListener(CS_ListenerPoller poller, int eventMask, bool immediateNotify, CS_Status *status)
void SetListenerOnExit(std::function< void()> onExit)
void SetListenerOnStart(std::function< void()> onStart)
void RemoveListener(CS_Listener handle, CS_Status *status)
void DestroyListenerPoller(CS_ListenerPoller poller)
void SetDefaultLogger(unsigned int min_level)
std::function< void(unsigned int level, const char *file, unsigned int line, const char *msg)> LogFunc
Definition: cscore_cpp.h:420
void SetLogger(LogFunc func, unsigned int min_level)
int GetMjpegServerPort(CS_Sink sink, CS_Status *status)
std::string GetMjpegServerListenAddress(CS_Sink sink, CS_Status *status)
void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status *status)
void SetSinkDescription(CS_Sink sink, std::string_view description, CS_Status *status)
std::string GetSinkError(CS_Sink sink, CS_Status *status)
void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, std::span< const std::string > choices, CS_Status *status)
void SetSourceConnected(CS_Source source, bool connected, CS_Status *status)
void SetSourceDescription(CS_Source source, std::string_view description, CS_Status *status)
CS_Property 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 NotifySourceError(CS_Source source, std::string_view msg, CS_Status *status)
int GetPropertyMin(CS_Property property, CS_Status *status)
void SetProperty(CS_Property property, int value, CS_Status *status)
void SetStringProperty(CS_Property property, std::string_view value, CS_Status *status)
CS_PropertyKind GetPropertyKind(CS_Property property, CS_Status *status)
int GetPropertyDefault(CS_Property property, CS_Status *status)
int GetPropertyMax(CS_Property property, CS_Status *status)
int GetProperty(CS_Property property, CS_Status *status)
int GetPropertyStep(CS_Property property, CS_Status *status)
std::string GetStringProperty(CS_Property property, CS_Status *status)
std::vector< std::string > GetEnumPropertyChoices(CS_Property property, CS_Status *status)
std::string GetPropertyName(CS_Property property, CS_Status *status)
CS_Sink CreateCvSinkCallback(std::string_view name, std::function< void(uint64_t time)> processFrame, CS_Status *status)
CS_Sink CreateCvSink(std::string_view name, CS_Status *status)
CS_Sink CreateMjpegServer(std::string_view name, std::string_view listenAddress, int port, CS_Status *status)
bool SetSinkConfigJson(CS_Sink sink, std::string_view config, CS_Status *status)
CS_Source GetSinkSource(CS_Sink sink, CS_Status *status)
CS_Sink CopySink(CS_Sink sink, CS_Status *status)
wpi::json GetSinkConfigJsonObject(CS_Sink sink, CS_Status *status)
void SetSinkSource(CS_Sink sink, CS_Source source, CS_Status *status)
CS_Property GetSinkSourceProperty(CS_Sink sink, std::string_view name, CS_Status *status)
void ReleaseSink(CS_Sink sink, CS_Status *status)
std::span< CS_Property > EnumerateSinkProperties(CS_Sink sink, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
std::string GetSinkDescription(CS_Sink sink, CS_Status *status)
std::string GetSinkName(CS_Sink sink, CS_Status *status)
std::string GetSinkConfigJson(CS_Sink sink, CS_Status *status)
CS_SinkKind GetSinkKind(CS_Sink sink, CS_Status *status)
CS_Property GetSinkProperty(CS_Sink sink, std::string_view name, CS_Status *status)
CS_Source CreateUsbCameraPath(std::string_view name, std::string_view path, CS_Status *status)
CS_Source CreateHttpCamera(std::string_view name, std::string_view url, CS_HttpCameraKind kind, CS_Status *status)
CS_Source CreateUsbCameraDev(std::string_view name, int dev, CS_Status *status)
CS_Source CreateCvSource(std::string_view name, const VideoMode &mode, CS_Status *status)
void ReleaseSource(CS_Source source, CS_Status *status)
bool IsSourceConnected(CS_Source source, CS_Status *status)
uint64_t GetSourceLastFrameTime(CS_Source source, CS_Status *status)
bool SetSourceResolution(CS_Source source, int width, int height, CS_Status *status)
CS_Property GetSourceProperty(CS_Source source, std::string_view name, CS_Status *status)
bool SetSourceConfigJson(CS_Source source, std::string_view config, CS_Status *status)
bool SetSourcePixelFormat(CS_Source source, VideoMode::PixelFormat pixelFormat, CS_Status *status)
std::string GetSourceConfigJson(CS_Source source, CS_Status *status)
wpi::json GetSourceConfigJsonObject(CS_Source source, CS_Status *status)
void SetSourceConnectionStrategy(CS_Source source, CS_ConnectionStrategy strategy, CS_Status *status)
VideoMode GetSourceVideoMode(CS_Source source, CS_Status *status)
CS_Source CopySource(CS_Source source, CS_Status *status)
bool IsSourceEnabled(CS_Source source, CS_Status *status)
std::span< CS_Property > EnumerateSourceProperties(CS_Source source, wpi::SmallVectorImpl< CS_Property > &vec, CS_Status *status)
std::vector< VideoMode > EnumerateSourceVideoModes(CS_Source source, CS_Status *status)
CS_SourceKind GetSourceKind(CS_Source source, CS_Status *status)
std::string GetSourceName(CS_Source source, CS_Status *status)
std::string GetSourceDescription(CS_Source source, CS_Status *status)
bool SetSourceVideoMode(CS_Source source, const VideoMode &mode, CS_Status *status)
bool SetSourceFPS(CS_Source source, int fps, CS_Status *status)
std::span< CS_Sink > EnumerateSourceSinks(CS_Source source, wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
int64_t GetTelemetryValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
double GetTelemetryElapsedTime()
double GetTelemetryAverageValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
void SetTelemetryPeriod(double seconds)
CS_Handle CS_Source
Definition: cscore_c.h:51
int CS_Status
Definition: cscore_c.h:44
CS_Handle CS_ListenerPoller
Definition: cscore_c.h:49
CS_Handle CS_Property
Definition: cscore_c.h:47
CS_Handle CS_Sink
Definition: cscore_c.h:50
int CS_Handle
Definition: cscore_c.h:46
CS_Handle CS_Listener
Definition: cscore_c.h:48
UsbCameraInfo GetUsbCameraInfo(CS_Source source, CS_Status *status)
std::string GetUsbCameraPath(CS_Source source, CS_Status *status)
void SetUsbCameraPath(CS_Source, std::string_view path, CS_Status *status)
std::string GetHostname()
std::vector< UsbCameraInfo > EnumerateUsbCameras(CS_Status *status)
std::span< CS_Sink > EnumerateSinkHandles(wpi::SmallVectorImpl< CS_Sink > &vec, CS_Status *status)
std::span< CS_Source > EnumerateSourceHandles(wpi::SmallVectorImpl< CS_Source > &vec, CS_Status *status)
std::vector< std::string > GetNetworkInterfaces()
::uint64_t uint64_t
Definition: Meta.h:58
::int64_t int64_t
Definition: Meta.h:59
CameraServer (cscore) namespace.
Definition: cscore_oo.inc:15
fps
Definition: velocity.h:46
Definition: AprilTagFieldLayout.h:18
Video mode.
Definition: cscore_c.h:104
int width
Definition: cscore_c.h:106
int pixelFormat
Definition: cscore_c.h:105
int fps
Definition: cscore_c.h:108
int height
Definition: cscore_c.h:107
Listener event.
Definition: cscore_cpp.h:103
VideoMode mode
Definition: cscore_cpp.h:164
CS_Sink sinkHandle
Definition: cscore_cpp.h:158
int value
Definition: cscore_cpp.h:169
std::string name
Definition: cscore_cpp.h:161
Kind kind
Definition: cscore_cpp.h:154
CS_Property propertyHandle
Definition: cscore_cpp.h:167
RawEvent(std::string_view name_, CS_Source source_, RawEvent::Kind kind_, CS_Property property_, CS_PropertyKind propertyKind_, int value_, std::string_view valueStr_)
Definition: cscore_cpp.h:143
CS_Source sourceHandle
Definition: cscore_cpp.h:157
std::string valueStr
Definition: cscore_cpp.h:170
RawEvent(RawEvent::Kind kind_)
Definition: cscore_cpp.h:128
RawEvent(std::string_view name_, CS_Source source_, const VideoMode &mode_)
Definition: cscore_cpp.h:138
CS_Listener listener
Definition: cscore_cpp.h:173
RawEvent(std::string_view name_, CS_Handle handle_, RawEvent::Kind kind_)
Definition: cscore_cpp.h:129
CS_PropertyKind propertyKind
Definition: cscore_cpp.h:168
Kind
Definition: cscore_cpp.h:104
@ kTelemetryUpdated
Definition: cscore_cpp.h:120
@ kUsbCamerasChanged
Definition: cscore_cpp.h:124
@ kSinkSourceChanged
Definition: cscore_cpp.h:114
@ kSourcePropertyCreated
Definition: cscore_cpp.h:111
@ kSinkEnabled
Definition: cscore_cpp.h:117
@ kSinkPropertyCreated
Definition: cscore_cpp.h:121
@ kSourceVideoModeChanged
Definition: cscore_cpp.h:110
@ kSinkDisabled
Definition: cscore_cpp.h:118
@ kSourcePropertyValueUpdated
Definition: cscore_cpp.h:112
@ kSinkPropertyValueUpdated
Definition: cscore_cpp.h:122
@ kSinkPropertyChoicesUpdated
Definition: cscore_cpp.h:123
@ kSinkCreated
Definition: cscore_cpp.h:115
@ kSourceCreated
Definition: cscore_cpp.h:105
@ kSourceDisconnected
Definition: cscore_cpp.h:108
@ kNetworkInterfacesChanged
Definition: cscore_cpp.h:119
@ kSinkDestroyed
Definition: cscore_cpp.h:116
@ kSourcePropertyChoicesUpdated
Definition: cscore_cpp.h:113
@ kSourceDestroyed
Definition: cscore_cpp.h:106
@ kSourceVideoModesUpdated
Definition: cscore_cpp.h:109
@ kSourceConnected
Definition: cscore_cpp.h:107
USB camera information.
Definition: cscore_cpp.h:46
int dev
Device number (e.g.
Definition: cscore_cpp.h:48
std::string name
Vendor/model name of the camera as provided by the USB driver.
Definition: cscore_cpp.h:52
int productId
USB Product Id.
Definition: cscore_cpp.h:58
int vendorId
USB Vendor Id.
Definition: cscore_cpp.h:56
std::string path
Path to device if available (e.g.
Definition: cscore_cpp.h:50
std::vector< std::string > otherPaths
Other path aliases to device (e.g.
Definition: cscore_cpp.h:54
Video mode.
Definition: cscore_cpp.h:64
VideoMode(PixelFormat pixelFormat_, int width_, int height_, int fps_)
Definition: cscore_cpp.h:81
VideoMode()
Definition: cscore_cpp.h:75
bool CompareWithoutFps(const VideoMode &other) const
Definition: cscore_cpp.h:94
bool operator==(const VideoMode &other) const
Definition: cscore_cpp.h:89
PixelFormat
Definition: cscore_cpp.h:65
@ kYUYV
Definition: cscore_cpp.h:68
@ kUnknown
Definition: cscore_cpp.h:66
@ kGray
Definition: cscore_cpp.h:71
@ kBGR
Definition: cscore_cpp.h:70
@ kMJPEG
Definition: cscore_cpp.h:67
@ kY16
Definition: cscore_cpp.h:72
@ kUYVY
Definition: cscore_cpp.h:73
@ kRGB565
Definition: cscore_cpp.h:69