Class RawSource
java.lang.Object
org.wpilib.vision.camera.VideoSource
org.wpilib.vision.camera.ImageSource
org.wpilib.vision.camera.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 VideoSource
VideoSource.ConnectionStrategy, VideoSource.Kind -
Field Summary
Fields inherited from class VideoSource
m_handle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidputFrame(long data, int size, int width, int height, int stride, PixelFormat pixelFormat) Put a raw image and notify sinks.voidputFrame(ByteBuffer data, int width, int height, int stride, PixelFormat pixelFormat) Put a raw image and notify sinks.voidPut a raw image and notify sinks.Methods inherited from class ImageSource
createBooleanProperty, createIntegerProperty, createProperty, createStringProperty, notifyError, setConnected, setDescription, setEnumPropertyChoicesMethods inherited from class 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
-
RawSource
Create a raw frame source.- Parameters:
name- Source name (arbitrary unique identifier)pixelFormat- Pixel formatwidth- widthheight- heightfps- fps
-
-
Method Details
-
putFrame
-
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
-