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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.wpi.first.cscore.VideoSource
VideoSource.ConnectionStrategy, VideoSource.Kind
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.cscore.VideoSource
m_handle
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImageSource(int handle)
-
Method Summary
All Methods Instance Methods Concrete Methods 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 Detail
-
ImageSource
protected ImageSource(int handle)
-
-
Method Detail
-
notifyError
public void notifyError(String msg)
Signal sinks that an error has occurred. This should be called instead of NotifyFrame when an error occurs.- Parameters:
msg
- Error message.
-
setConnected
public void setConnected(boolean connected)
Set source connection status. Defaults to true.- Parameters:
connected
- True for connected, false for disconnected
-
setDescription
public void setDescription(String description)
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
public VideoProperty createBooleanProperty(String name, boolean defaultValue, boolean value)
Create a boolean property.- Parameters:
name
- Property namedefaultValue
- Default valuevalue
- Current value- Returns:
- Property
-
createStringProperty
public VideoProperty createStringProperty(String name, String value)
Create a string property.- Parameters:
name
- Property namevalue
- Current value- Returns:
- Property
-
setEnumPropertyChoices
public void setEnumPropertyChoices(VideoProperty property, String[] choices)
Configure enum property choices.- Parameters:
property
- Propertychoices
- Choices
-
-