Package edu.wpi.first.cscore
Class ImageSource
java.lang.Object
edu.wpi.first.cscore.VideoSource
edu.wpi.first.cscore.ImageSource
- All Implemented Interfaces:
AutoCloseable
public abstract class ImageSource extends VideoSource
A base class for single image providing sources.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.cscore.VideoSource
VideoSource.ConnectionStrategy, VideoSource.Kind
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImageSource(int handle)
Constructs an ImageSource. -
Method Summary
Modifier and Type Method Description VideoProperty
createBooleanProperty(String name, boolean defaultValue, boolean value)
Create a boolean property.VideoProperty
createIntegerProperty(String name, int minimum, int maximum, int step, int defaultValue, int value)
Create an integer property.VideoProperty
createProperty(String name, VideoProperty.Kind kind, int minimum, int maximum, int step, int defaultValue, int value)
Create a property.VideoProperty
createStringProperty(String name, String value)
Create a string property.void
notifyError(String msg)
Signal sinks that an error has occurred.void
setConnected(boolean connected)
Set source connection status.void
setDescription(String description)
Set source description.void
setEnumPropertyChoices(VideoProperty property, String[] choices)
Configure enum property choices.Methods inherited from class edu.wpi.first.cscore.VideoSource
close, enumerateProperties, enumerateSinks, enumerateSources, enumerateVideoModes, equals, getActualDataRate, getActualFPS, getConfigJson, getDescription, getHandle, getKind, getKindFromInt, getLastFrameTime, getName, getProperty, getVideoMode, hashCode, isConnected, isEnabled, isValid, setConfigJson, setConnectionStrategy, setFPS, setPixelFormat, setResolution, setVideoMode, setVideoMode
-
Constructor Details
-
ImageSource
Constructs an ImageSource.- Parameters:
handle
- The image source handle.
-
-
Method Details
-
notifyError
Signal sinks that an error has occurred. This should be called instead of NotifyFrame when an error occurs.- Parameters:
msg
- Error message.
-
setConnected
Set source connection status. Defaults to true.- Parameters:
connected
- True for connected, false for disconnected
-
setDescription
Set source description.- Parameters:
description
- Description
-
createProperty
public VideoProperty createProperty(String name, VideoProperty.Kind kind, int minimum, int maximum, int step, int defaultValue, int value)Create a property.- Parameters:
name
- Property namekind
- Property kindminimum
- Minimum valuemaximum
- Maximum valuestep
- Step valuedefaultValue
- Default valuevalue
- Current value- Returns:
- Property
-
createIntegerProperty
public VideoProperty createIntegerProperty(String name, int minimum, int maximum, int step, int defaultValue, int value)Create an integer property.- Parameters:
name
- Property nameminimum
- Minimum valuemaximum
- Maximum valuestep
- Step valuedefaultValue
- Default valuevalue
- Current value- Returns:
- Property
-
createBooleanProperty
Create a boolean property.- Parameters:
name
- Property namedefaultValue
- Default valuevalue
- Current value- Returns:
- Property
-
createStringProperty
Create a string property.- Parameters:
name
- Property namevalue
- Current value- Returns:
- Property
-
setEnumPropertyChoices
Configure enum property choices.- Parameters:
property
- Propertychoices
- Choices
-