From 81fd05d07b51e9cbb25de2d8bdbd4a51ead36994 Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Sun, 30 Nov 2025 00:11:12 +0100 Subject: cleanup --- src/camera/veyeimx287m.h | 55 ++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 37 deletions(-) (limited to 'src/camera/veyeimx287m.h') diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h index e4c02b0..d65b00d 100644 --- a/src/camera/veyeimx287m.h +++ b/src/camera/veyeimx287m.h @@ -37,31 +37,31 @@ public: ~VeyeIMX287m() override; public: - static std::vector> search(); + [[nodiscard]] static std::vector> search(); public: - bool startStream() override; + [[nodiscard]] bool startStream() override; - bool dequeueImageBuffer(size_t &image); + [[nodiscard]] bool dequeueImageBuffer(size_t &image); // bool getImage(Image &image); - bool getImage(Image *image) override; - std::shared_ptr getImage() override; + [[nodiscard]] bool getImage(Image *image) override; + [[nodiscard]] std::shared_ptr getImage() override; bool init(); // parameters public: - bool set_autoExposure(const bool enable) override; - std::optional get_autoExposure() override; + [[nodiscard]] bool set_autoExposure(const bool enable) override; + [[nodiscard]] std::optional get_autoExposure() override; - bool set_autoGain(const bool enable) override; - std::optional get_autoGain() override; + [[nodiscard]] bool set_autoGain(const bool enable) override; + [[nodiscard]] std::optional get_autoGain() override; - bool set_exposureTime(const std::chrono::microseconds us) override; - std::optional get_exposureTime() override; + [[nodiscard]] bool set_exposureTime(const std::chrono::microseconds us) override; + [[nodiscard]] std::optional get_exposureTime() override; - bool set_gain(const float value) override; - std::optional get_gain() override; + [[nodiscard]] bool set_gain(const float value) override; + [[nodiscard]] std::optional get_gain() override; public: /*! @@ -71,15 +71,12 @@ public: uint32_t processedCounter{0}; private: - bool openCam(); - bool initCam(); + [[nodiscard]] bool openCam(); + [[nodiscard]] bool initCam(); - bool initI2C(); - // bool initHttpServer(); + [[nodiscard]] bool initI2C(); - void getFrameLoop(std::stop_token stopToken); - void rotateFrameLoop(std::stop_token stopToken); - void calcPixelsLoop(std::stop_token stopToken); + void getFramesLoop(std::stop_token stopToken); private: /*! @@ -94,7 +91,6 @@ private: static constexpr uint8_t BUFFER_COUNT{16}; - // std::array m_images; /*! * \brief m_imageMutexes - lock while processing image from m_images */ @@ -108,27 +104,12 @@ private: std::shared_ptr image{std::make_shared()}; }; std::vector m_rawBuffers; - - struct Semaphore - { - // sem_queue, BUFFER_COUNT> rawSemQueue; - // sem_queue rawSemQueue; - // sem_queue, BUFFER_COUNT> rotSemQueue; - // sem_queue rotSemQueue; - } m_sync; + // std::array m_images; std::mutex m_camMtx; - /*! - * \brief m_buffersQueue - queue of buffers which require extracting pixels - */ - // std::queue> m_buffersQueue; std::jthread m_streamThread; std::jthread m_getThreads[1]; - // std::jthread m_getThreads[4]; - // TODO: sync all loops somehow to guarantee frames order - std::jthread m_rotateThreads[0]; - std::jthread m_calcPixelsThreads[0]; std::mutex m_lastImageMtx; std::shared_ptr m_lastProcessedImage{}; -- cgit v1.2.3-70-g09d2