WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
VideoEvent.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
10#include "wpi/cs/cscore_cpp.hpp"
11
12namespace wpi::cs {
13
14/**
15 * An event generated by the library and provided to event listeners.
16 */
17class VideoEvent : public RawEvent {
18 public:
19 /**
20 * Returns the source associated with the event (if any).
21 *
22 * @return The source associated with the event (if any).
23 */
25 CS_Status status = 0;
26 return VideoSource{sourceHandle == 0 ? 0
27 : CopySource(sourceHandle, &status)};
28 }
29
30 /**
31 * Returns the sink associated with the event (if any).
32 *
33 * @return The sink associated with the event (if any).
34 */
36 CS_Status status = 0;
37 return VideoSink{sinkHandle == 0 ? 0 : CopySink(sinkHandle, &status)};
38 }
39
40 /**
41 * Returns the property associated with the event (if any).
42 *
43 * @return The property associated with the event (if any).
44 */
49};
50
51} // namespace wpi::cs
An event generated by the library and provided to event listeners.
Definition VideoEvent.hpp:17
VideoSource GetSource() const
Returns the source associated with the event (if any).
Definition VideoEvent.hpp:24
VideoProperty GetProperty() const
Returns the property associated with the event (if any).
Definition VideoEvent.hpp:45
VideoSink GetSink() const
Returns the sink associated with the event (if any).
Definition VideoEvent.hpp:35
A source or sink property.
Definition VideoProperty.hpp:34
A sink for video that accepts a sequence of frames.
Definition VideoSink.hpp:24
A source for video that provides a sequence of frames.
Definition VideoSource.hpp:25
Kind
Definition VideoProperty.hpp:41
CS_Sink CopySink(CS_Sink sink, CS_Status *status)
CS_Source CopySource(CS_Source source, CS_Status *status)
int CS_Status
Definition cscore_c.h:41
CameraServer (cscore) namespace.
Definition CvSource.hpp:15
CS_Source sourceHandle
Definition RawEvent.hpp:72
CS_Sink sinkHandle
Definition RawEvent.hpp:73
CS_Property propertyHandle
Definition RawEvent.hpp:82
CS_PropertyKind propertyKind
Definition RawEvent.hpp:83
RawEvent()=default