WPILibC++ 2023.4.3-108-ge5452e3
|
Classes | |
class | cs::RawSource |
A source for user code to provide video frames as raw bytes. More... | |
class | cs::RawSink |
A sink for user code to accept video frames as raw bytes. More... | |
Functions | |
cs::RawFrame::RawFrame () | |
cs::RawFrame::~RawFrame () | |
CS_Source | cs::CreateRawSource (std::string_view name, const VideoMode &mode, CS_Status *status) |
CS_Sink | cs::CreateRawSink (std::string_view name, CS_Status *status) |
CS_Sink | cs::CreateRawSinkCallback (std::string_view name, std::function< void(uint64_t time)> processFrame, CS_Status *status) |
void | cs::PutSourceFrame (CS_Source source, const CS_RawFrame &image, CS_Status *status) |
uint64_t | cs::GrabSinkFrame (CS_Sink sink, CS_RawFrame &image, CS_Status *status) |
uint64_t | cs::GrabSinkFrameTimeout (CS_Sink sink, CS_RawFrame &image, double timeout, CS_Status *status) |
cs::RawSource::RawSource ()=default | |
cs::RawSource::RawSource (std::string_view name, const VideoMode &mode) | |
Create a raw frame source. More... | |
cs::RawSource::RawSource (std::string_view name, VideoMode::PixelFormat pixelFormat, int width, int height, int fps) | |
Create a raw frame source. More... | |
void | cs::RawSource::PutFrame (RawFrame &image) |
Put a raw image and notify sinks. More... | |
cs::RawSink::RawSink ()=default | |
cs::RawSink::RawSink (std::string_view name) | |
Create a sink for accepting raw images. More... | |
cs::RawSink::RawSink (std::string_view name, std::function< void(uint64_t time)> processFrame) | |
Create a sink for accepting raws images in a separate thread. More... | |
uint64_t | cs::RawSink::GrabFrame (RawFrame &image, double timeout=0.225) const |
Wait for the next frame and get the image. More... | |
uint64_t | cs::RawSink::GrabFrameNoTimeout (RawFrame &image) const |
Wait for the next frame and get the image. More... | |
CS_Sink cs::CreateRawSink | ( | std::string_view | name, |
CS_Status * | status | ||
) |
CS_Sink cs::CreateRawSinkCallback | ( | std::string_view | name, |
std::function< void(uint64_t time)> | processFrame, | ||
CS_Status * | status | ||
) |
CS_Source cs::CreateRawSource | ( | std::string_view | name, |
const VideoMode & | mode, | ||
CS_Status * | status | ||
) |
|
inlineprotected |
Wait for the next frame and get the image.
Times out (returning 0) after timeout seconds. The provided image will have three 8-bit channels stored in BGR order.
|
inlineprotected |
Wait for the next frame and get the image.
May block forever. The provided image will have three 8-bit channels stored in BGR order.
uint64_t cs::GrabSinkFrame | ( | CS_Sink | sink, |
CS_RawFrame & | image, | ||
CS_Status * | status | ||
) |
uint64_t cs::GrabSinkFrameTimeout | ( | CS_Sink | sink, |
CS_RawFrame & | image, | ||
double | timeout, | ||
CS_Status * | status | ||
) |
|
inlineprotected |
Put a raw image and notify sinks.
image | raw frame image |
void cs::PutSourceFrame | ( | CS_Source | source, |
const CS_RawFrame & | image, | ||
CS_Status * | status | ||
) |
|
inline |
|
default |
|
inlineexplicit |
Create a sink for accepting raw images.
GrabFrame() must be called on the created sink to get each new image.
name | Source name (arbitrary unique identifier) |
|
inline |
Create a sink for accepting raws images in a separate thread.
A thread will be created that calls WaitForFrame() and calls the processFrame() callback each time a new frame arrives.
name | Source name (arbitrary unique identifier) |
processFrame | Frame processing function; will be called with a time=0 if an error occurred. processFrame should call GetImage() or GetError() as needed, but should not call (except in very unusual circumstances) WaitForImage(). |
|
default |
|
inline |
Create a raw frame source.
name | Source name (arbitrary unique identifier) |
mode | Video mode being generated |
|
inline |
Create a raw frame source.
name | Source name (arbitrary unique identifier) |
pixelFormat | Pixel format |
width | width |
height | height |
fps | fps |
|
inline |