![]() |
WPILibC++ 2025.3.2
|
A source for user code to provide video frames as raw bytes. More...
#include <cscore_raw.h>
Public Member Functions | |
| RawSource ()=default | |
| RawSource (std::string_view name, const VideoMode &mode) | |
| Create a raw frame source. | |
| RawSource (std::string_view name, VideoMode::PixelFormat pixelFormat, int width, int height, int fps) | |
| Create a raw frame source. | |
Public Member Functions inherited from cs::ImageSource | |
| void | NotifyError (std::string_view msg) |
| Signal sinks that an error has occurred. | |
| void | SetConnected (bool connected) |
| Set source connection status. | |
| void | SetDescription (std::string_view description) |
| Set source description. | |
| VideoProperty | CreateProperty (std::string_view name, VideoProperty::Kind kind, int minimum, int maximum, int step, int defaultValue, int value) |
| Create a property. | |
| VideoProperty | CreateIntegerProperty (std::string_view name, int minimum, int maximum, int step, int defaultValue, int value) |
| Create an integer property. | |
| VideoProperty | CreateBooleanProperty (std::string_view name, bool defaultValue, bool value) |
| Create a boolean property. | |
| VideoProperty | CreateStringProperty (std::string_view name, std::string_view value) |
| Create a string property. | |
| void | SetEnumPropertyChoices (const VideoProperty &property, std::span< const std::string > choices) |
| Configure enum property choices. | |
| template<typename T > | |
| void | SetEnumPropertyChoices (const VideoProperty &property, std::initializer_list< T > choices) |
| Configure enum property choices. | |
Public Member Functions inherited from cs::VideoSource | |
| VideoSource () noexcept=default | |
| VideoSource (const VideoSource &source) | |
| VideoSource (VideoSource &&other) noexcept | |
| VideoSource & | operator= (VideoSource other) noexcept |
| ~VideoSource () | |
| operator bool () const | |
| int | GetHandle () const |
| bool | operator== (const VideoSource &other) const |
| Kind | GetKind () const |
| Get the kind of the source. | |
| std::string | GetName () const |
| Get the name of the source. | |
| std::string | GetDescription () const |
| Get the source description. | |
| uint64_t | GetLastFrameTime () const |
| Get the last time a frame was captured. | |
| void | SetConnectionStrategy (ConnectionStrategy strategy) |
| Sets the connection strategy. | |
| bool | IsConnected () const |
| Is the source currently connected to whatever is providing the images? | |
| bool | IsEnabled () const |
| Gets source enable status. | |
| VideoProperty | GetProperty (std::string_view name) |
| Get a property. | |
| std::vector< VideoProperty > | EnumerateProperties () const |
| Enumerate all properties of this source. | |
| VideoMode | GetVideoMode () const |
| Get the current video mode. | |
| bool | SetVideoMode (const VideoMode &mode) |
| Set the video mode. | |
| bool | SetVideoMode (VideoMode::PixelFormat pixelFormat, int width, int height, int fps) |
| Set the video mode. | |
| bool | SetPixelFormat (VideoMode::PixelFormat pixelFormat) |
| Set the pixel format. | |
| bool | SetResolution (int width, int height) |
| Set the resolution. | |
| bool | SetFPS (int fps) |
| Set the frames per second (FPS). | |
| bool | SetConfigJson (std::string_view config) |
| Set video mode and properties from a JSON configuration string. | |
| bool | SetConfigJson (const wpi::json &config) |
| Set video mode and properties from a JSON configuration object. | |
| std::string | GetConfigJson () const |
| Get a JSON configuration string. | |
| wpi::json | GetConfigJsonObject () const |
| Get a JSON configuration object. | |
| double | GetActualFPS () const |
| Get the actual FPS. | |
| double | GetActualDataRate () const |
| Get the data rate (in bytes per second). | |
| std::vector< VideoMode > | EnumerateVideoModes () const |
| Enumerate all known video modes for this source. | |
| CS_Status | GetLastStatus () const |
| std::vector< VideoSink > | EnumerateSinks () |
| Enumerate all sinks connected to this source. | |
Protected Member Functions | |
| void | PutFrame (wpi::RawFrame &image) |
| Put a raw image and notify sinks. | |
Protected Member Functions inherited from cs::ImageSource | |
| ImageSource ()=default | |
Protected Member Functions inherited from cs::VideoSource | |
| VideoSource (CS_Source handle) | |
Additional Inherited Members | |
Public Types inherited from cs::VideoSource | |
| enum | Kind { kUnknown = CS_SOURCE_UNKNOWN , kUsb = CS_SOURCE_USB , kHttp = CS_SOURCE_HTTP , kCv = CS_SOURCE_CV , kRaw = CS_SOURCE_RAW } |
| Video source kind. More... | |
| enum | ConnectionStrategy { kConnectionAutoManage = CS_CONNECTION_AUTO_MANAGE , kConnectionKeepOpen = CS_CONNECTION_KEEP_OPEN , kConnectionForceClose = CS_CONNECTION_FORCE_CLOSE } |
| Connection strategy. More... | |
Static Public Member Functions inherited from cs::VideoSource | |
| static std::vector< VideoSource > | EnumerateSources () |
| Enumerate all existing sources. | |
Protected Attributes inherited from cs::VideoSource | |
| CS_Status | m_status = 0 |
| CS_Source | m_handle {0} |
| Video source handle. | |
A source for user code to provide video frames as raw bytes.
This is a complex API, most cases should use CvSource.
|
default |