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
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
putFrame
(long data, int size, int width, int height, int stride, PixelFormat pixelFormat) Put a raw image and notify sinks.void
Put a raw image and notify sinks.void
putFrame
(ByteBuffer data, int width, int height, int stride, PixelFormat pixelFormat) 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 Details
-
RawSource
Create a raw frame source.- Parameters:
name
- Source name (arbitrary unique identifier)mode
- Video mode being generated
-
RawSource
Create a raw frame source.- Parameters:
name
- Source name (arbitrary unique identifier)pixelFormat
- Pixel formatwidth
- widthheight
- heightfps
- fps
-
-
Method Details
-
putFrame
Put a raw image and notify sinks.- Parameters:
image
- raw frame image
-
putFrame
protected void putFrame(long data, int size, int width, int height, int stride, PixelFormat pixelFormat) Put a raw image and notify sinks.- Parameters:
data
- raw frame native data pointersize
- total size in byteswidth
- frame widthheight
- frame heightstride
- size of each row in bytespixelFormat
- pixel format
-
putFrame
Put a raw image and notify sinks.- Parameters:
data
- raw frame native ByteBufferwidth
- frame widthheight
- frame heightstride
- size of each row in bytespixelFormat
- pixel format
-