WPILibC++  unspecified
cs::UsbCamera Class Reference

A source that represents a USB camera. More...

#include <cscore_oo.h>

Inheritance diagram for cs::UsbCamera:
Collaboration diagram for cs::UsbCamera:

Public Member Functions

 UsbCamera (llvm::StringRef name, int dev)
 Create a source for a USB camera based on device number. More...
 
 UsbCamera (llvm::StringRef name, llvm::StringRef path)
 Create a source for a USB camera based on device path. More...
 
std::string GetPath () const
 Get the path to the device.
 
- Public Member Functions inherited from cs::VideoCamera
void SetBrightness (int brightness)
 Set the brightness, as a percentage (0-100).
 
int GetBrightness ()
 Get the brightness, as a percentage (0-100).
 
void SetWhiteBalanceAuto ()
 Set the white balance to auto.
 
void SetWhiteBalanceHoldCurrent ()
 Set the white balance to hold current.
 
void SetWhiteBalanceManual (int value)
 Set the white balance to manual, with specified color temperature.
 
void SetExposureAuto ()
 Set the exposure to auto aperature.
 
void SetExposureHoldCurrent ()
 Set the exposure to hold current.
 
void SetExposureManual (int value)
 Set the exposure to manual, as a percentage (0-100).
 
- Public Member Functions inherited from cs::VideoSource
 VideoSource (const VideoSource &source)
 
 VideoSource (VideoSource &&other) noexcept
 
VideoSourceoperator= (VideoSource other) noexcept
 
 operator bool () const
 
int GetHandle () const
 
bool operator== (const VideoSource &other) 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. More...
 
std::string GetDescription () const
 Get the source description. This is source-kind specific.
 
uint64_t GetLastFrameTime () const
 Get the last time a frame was captured. More...
 
bool IsConnected () const
 Is the source currently connected to whatever is providing the images?
 
VideoProperty GetProperty (llvm::StringRef name)
 Get a property. More...
 
std::vector< VideoPropertyEnumerateProperties () const
 Enumerate all properties of this source.
 
VideoMode GetVideoMode () const
 Get the current video mode.
 
bool SetVideoMode (const VideoMode &mode)
 Set the video mode. More...
 
bool SetVideoMode (VideoMode::PixelFormat pixelFormat, int width, int height, int fps)
 Set the video mode. More...
 
bool SetPixelFormat (VideoMode::PixelFormat pixelFormat)
 Set the pixel format. More...
 
bool SetResolution (int width, int height)
 Set the resolution. More...
 
bool SetFPS (int fps)
 Set the frames per second (FPS). More...
 
std::vector< VideoModeEnumerateVideoModes () const
 Enumerate all known video modes for this source.
 
CS_Status GetLastStatus () const
 
std::vector< VideoSinkEnumerateSinks ()
 Enumerate all sinks connected to this source. More...
 

Static Public Member Functions

static std::vector< UsbCameraInfoEnumerateUsbCameras ()
 Enumerate USB cameras on the local system. More...
 
- Static Public Member Functions inherited from cs::VideoSource
static std::vector< VideoSourceEnumerateSources ()
 Enumerate all existing sources. More...
 

Additional Inherited Members

- Public Types inherited from cs::VideoCamera
enum  WhiteBalance {
  kFixedIndoor = 3000, kFixedOutdoor1 = 4000, kFixedOutdoor2 = 5000, kFixedFluorescent1 = 5100,
  kFixedFlourescent2 = 5200
}
 
- Public Types inherited from cs::VideoSource
enum  Kind { kUnknown = CS_SOURCE_UNKNOWN, kUsb = CS_SOURCE_USB, kHttp = CS_SOURCE_HTTP, kCv = CS_SOURCE_CV }
 
- Protected Member Functions inherited from cs::VideoCamera
 VideoCamera (CS_Source handle)
 
- Protected Member Functions inherited from cs::VideoSource
 VideoSource (CS_Source handle)
 
- Protected Attributes inherited from cs::VideoSource
CS_Status m_status = 0
 
CS_Source m_handle
 

Detailed Description

A source that represents a USB camera.

Constructor & Destructor Documentation

cs::UsbCamera::UsbCamera ( llvm::StringRef  name,
int  dev 
)
inline

Create a source for a USB camera based on device number.

Parameters
nameSource name (arbitrary unique identifier)
devDevice number (e.g. 0 for /dev/video0)
cs::UsbCamera::UsbCamera ( llvm::StringRef  name,
llvm::StringRef  path 
)
inline

Create a source for a USB camera based on device path.

Parameters
nameSource name (arbitrary unique identifier)
pathPath to device (e.g. "/dev/video0" on Linux)

Member Function Documentation

std::vector< UsbCameraInfo > cs::UsbCamera::EnumerateUsbCameras ( )
inlinestatic

Enumerate USB cameras on the local system.

Returns
Vector of USB camera information (one for each camera)

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