Package edu.wpi.first.cscore.raw
Class RawSource
- java.lang.Object
-
- edu.wpi.first.cscore.VideoSource
-
- edu.wpi.first.cscore.ImageSource
-
- edu.wpi.first.cscore.raw.RawSource
-
- All Implemented Interfaces:
AutoCloseable
public class RawSource extends ImageSource
A source for user code to provide video frames as raw bytes.This is a complex API, most cases should use CvSource.
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
putFrame(long data, int width, int height, int pixelFormat, int totalData)
Put a raw image and notify sinks.protected void
putFrame(long data, int width, int height, VideoMode.PixelFormat pixelFormat, int totalData)
Put a raw image and notify sinks.protected void
putFrame(RawFrame image)
Put a raw image and notify sinks.-
Methods inherited from class edu.wpi.first.cscore.ImageSource
createBooleanProperty, createIntegerProperty, createProperty, createStringProperty, notifyError, setConnected, setDescription, setEnumPropertyChoices
-
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
-
RawSource
public RawSource(String name, VideoMode mode)
Create a raw frame source.- Parameters:
name
- Source name (arbitrary unique identifier)mode
- Video mode being generated
-
RawSource
public RawSource(String name, VideoMode.PixelFormat pixelFormat, int width, int height, int fps)
Create a raw frame source.- Parameters:
name
- Source name (arbitrary unique identifier)pixelFormat
- Pixel formatwidth
- widthheight
- heightfps
- fps
-
-
Method Detail
-
putFrame
protected void putFrame(RawFrame image)
Put a raw image and notify sinks.- Parameters:
image
- raw frame image
-
putFrame
protected void putFrame(long data, int width, int height, int pixelFormat, int totalData)
Put a raw image and notify sinks.- Parameters:
data
- raw frame data pointerwidth
- frame widthheight
- frame heightpixelFormat
- pixel formattotalData
- length of data in total
-
putFrame
protected void putFrame(long data, int width, int height, VideoMode.PixelFormat pixelFormat, int totalData)
Put a raw image and notify sinks.- Parameters:
data
- raw frame data pointerwidth
- frame widthheight
- frame heightpixelFormat
- pixel formattotalData
- length of data in total
-
-