WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
VideoCamera.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
9
10namespace wpi::cs {
11
12/**
13 * A source that represents a video camera.
14 */
15class VideoCamera : public VideoSource {
16 public:
17 /**
18 * White balance.
19 */
21 /// Fixed indoor white balance.
23 /// Fixed outdoor white balance 1.
25 /// Fixed outdoor white balance 2.
27 /// Fixed fluorescent white balance 1.
29 /// Fixed fluorescent white balance 2.
31 };
32
33 VideoCamera() = default;
34
35 /**
36 * Set the brightness, as a percentage (0-100).
37 */
38 void SetBrightness(int brightness) {
39 m_status = 0;
41 }
42
43 /**
44 * Get the brightness, as a percentage (0-100).
45 */
47 m_status = 0;
49 }
50
51 /**
52 * Set the white balance to auto.
53 */
58
59 /**
60 * Set the white balance to hold current.
61 */
66
67 /**
68 * Set the white balance to manual, with specified color temperature.
69 */
70 void SetWhiteBalanceManual(int value) {
71 m_status = 0;
73 }
74
75 /**
76 * Set the exposure to auto aperture.
77 */
82
83 /**
84 * Set the exposure to hold current.
85 */
90
91 /**
92 * Set the exposure to manual, as a percentage (0-100).
93 */
94 void SetExposureManual(int value) {
95 m_status = 0;
97 }
98
99 protected:
100 explicit VideoCamera(CS_Source handle) : VideoSource(handle) {}
101};
102
103} // namespace wpi::cs
void SetBrightness(int brightness)
Set the brightness, as a percentage (0-100).
Definition VideoCamera.hpp:38
void SetExposureAuto()
Set the exposure to auto aperture.
Definition VideoCamera.hpp:78
int GetBrightness()
Get the brightness, as a percentage (0-100).
Definition VideoCamera.hpp:46
void SetWhiteBalanceHoldCurrent()
Set the white balance to hold current.
Definition VideoCamera.hpp:62
void SetWhiteBalanceAuto()
Set the white balance to auto.
Definition VideoCamera.hpp:54
void SetExposureManual(int value)
Set the exposure to manual, as a percentage (0-100).
Definition VideoCamera.hpp:94
void SetExposureHoldCurrent()
Set the exposure to hold current.
Definition VideoCamera.hpp:86
VideoCamera(CS_Source handle)
Definition VideoCamera.hpp:100
void SetWhiteBalanceManual(int value)
Set the white balance to manual, with specified color temperature.
Definition VideoCamera.hpp:70
WhiteBalance
White balance.
Definition VideoCamera.hpp:20
@ kFixedIndoor
Fixed indoor white balance.
Definition VideoCamera.hpp:22
@ kFixedFluorescent1
Fixed fluorescent white balance 1.
Definition VideoCamera.hpp:28
@ kFixedFlourescent2
Fixed fluorescent white balance 2.
Definition VideoCamera.hpp:30
@ kFixedOutdoor1
Fixed outdoor white balance 1.
Definition VideoCamera.hpp:24
@ kFixedOutdoor2
Fixed outdoor white balance 2.
Definition VideoCamera.hpp:26
CS_Status m_status
Definition VideoSource.hpp:372
VideoSource() noexcept=default
CS_Source m_handle
Video source handle.
Definition VideoSource.hpp:375
void SetCameraWhiteBalanceManual(CS_Source source, int value, CS_Status *status)
int GetCameraBrightness(CS_Source source, CS_Status *status)
void SetCameraExposureAuto(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceHoldCurrent(CS_Source source, CS_Status *status)
void SetCameraBrightness(CS_Source source, int brightness, CS_Status *status)
void SetCameraExposureManual(CS_Source source, int value, CS_Status *status)
void SetCameraExposureHoldCurrent(CS_Source source, CS_Status *status)
void SetCameraWhiteBalanceAuto(CS_Source source, CS_Status *status)
CS_Handle CS_Source
Definition cscore_c.h:48
CameraServer (cscore) namespace.
Definition CvSource.hpp:15