diff --git a/cscore/src/main/native/include/cscore_cv.h b/cscore/src/main/native/include/cscore_cv.h index 6911ae2fa1..30a356bef3 100644 --- a/cscore/src/main/native/include/cscore_cv.h +++ b/cscore/src/main/native/include/cscore_cv.h @@ -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) { diff --git a/cscore/src/main/native/include/cscore_raw.h b/cscore/src/main/native/include/cscore_raw.h index adb9649727..0aaaeffd12 100644 --- a/cscore/src/main/native/include/cscore_raw.h +++ b/cscore/src/main/native/include/cscore_raw.h @@ -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) { diff --git a/cscore/src/main/native/include/cscore_raw_cv.h b/cscore/src/main/native/include/cscore_raw_cv.h index 88c94a1642..5b9a37439f 100644 --- a/cscore/src/main/native/include/cscore_raw_cv.h +++ b/cscore/src/main/native/include/cscore_raw_cv.h @@ -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;