mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
[cscore] Add [[nodiscard]] to GrabFrame functions (#3479)
Closes #3086.
This commit is contained in:
@@ -152,7 +152,8 @@ class CvSink : public ImageSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrame(cv::Mat& image, double timeout = 0.225) const;
|
||||
[[nodiscard]] uint64_t GrabFrame(cv::Mat& image,
|
||||
double timeout = 0.225) const;
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image. May block forever.
|
||||
@@ -162,7 +163,7 @@ class CvSink : public ImageSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrameNoTimeout(cv::Mat& image) const;
|
||||
[[nodiscard]] uint64_t GrabFrameNoTimeout(cv::Mat& image) const;
|
||||
};
|
||||
|
||||
inline CvSource::CvSource(std::string_view name, const VideoMode& mode) {
|
||||
|
||||
@@ -174,7 +174,8 @@ class RawSink : public ImageSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrame(RawFrame& image, double timeout = 0.225) const;
|
||||
[[nodiscard]] uint64_t GrabFrame(RawFrame& image,
|
||||
double timeout = 0.225) const;
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image. May block forever.
|
||||
@@ -184,7 +185,7 @@ class RawSink : public ImageSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrameNoTimeout(RawFrame& image) const;
|
||||
[[nodiscard]] uint64_t GrabFrameNoTimeout(RawFrame& image) const;
|
||||
};
|
||||
|
||||
inline RawSource::RawSource(std::string_view name, const VideoMode& mode) {
|
||||
|
||||
@@ -111,7 +111,7 @@ class RawCvSink : public RawSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrame(cv::Mat& image, double timeout = 0.225);
|
||||
[[nodiscard]] uint64_t GrabFrame(cv::Mat& image, double timeout = 0.225);
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image. May block forever.
|
||||
@@ -121,7 +121,7 @@ class RawCvSink : public RawSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrameNoTimeout(cv::Mat& image);
|
||||
[[nodiscard]] uint64_t GrabFrameNoTimeout(cv::Mat& image);
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image.
|
||||
@@ -132,7 +132,8 @@ class RawCvSink : public RawSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrameDirect(cv::Mat& image, double timeout = 0.225);
|
||||
[[nodiscard]] uint64_t GrabFrameDirect(cv::Mat& image,
|
||||
double timeout = 0.225);
|
||||
|
||||
/**
|
||||
* Wait for the next frame and get the image. May block forever.
|
||||
@@ -142,7 +143,7 @@ class RawCvSink : public RawSink {
|
||||
* message); the frame time is in the same time base as wpi::Now(),
|
||||
* and is in 1 us increments.
|
||||
*/
|
||||
uint64_t GrabFrameNoTimeoutDirect(cv::Mat& image);
|
||||
[[nodiscard]] uint64_t GrabFrameNoTimeoutDirect(cv::Mat& image);
|
||||
|
||||
private:
|
||||
RawFrame rawFrame;
|
||||
|
||||
Reference in New Issue
Block a user