From 5df63c0bc7e3d6f1850d04f5bafbae2dd6fa619e Mon Sep 17 00:00:00 2001 From: Nikita Kostovsky Date: Fri, 14 Nov 2025 21:05:12 +0100 Subject: organize things a bit, populate ICamera --- src/camera/veyeimx287m.h | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'src/camera/veyeimx287m.h') diff --git a/src/camera/veyeimx287m.h b/src/camera/veyeimx287m.h index 7d7e2c6..d8c42ae 100644 --- a/src/camera/veyeimx287m.h +++ b/src/camera/veyeimx287m.h @@ -10,6 +10,12 @@ #include "icamera.h" +namespace veye { +namespace imx287m { +class i2c; +} // namespace imx287m +} // namespace veye + class HttpServer; class VeyeIMX287m : public ICamera @@ -29,18 +35,26 @@ public: public: bool startStream() override; + bool dequeueImageBuffer(size_t &image); + bool getImage(Image &image); + bool init(); - bool setExposureTime(const std::chrono::microseconds us); - bool setExposureTimeUs(int value) override; - bool setGain(int value) override; + // parameters +public: + bool set_autoExposure(const bool enable) override; + std::optional get_autoExposure() override; - bool setLaserLevel(int value) override; + bool set_autoGain(const bool enable) override; + std::optional get_autoGain() override; - bool setSomething(int value) override; + bool set_exposureTime(const std::chrono::microseconds us) override; + std::optional get_exposureTime() override; - bool dequeueImageBuffer(size_t &image); - bool getImage(Image &image); + bool set_gain(const float value) override; + std::optional get_gain() override; + + bool setLaserLevel(int value) override; public: /*! @@ -50,10 +64,11 @@ public: uint32_t processedCounter{0}; private: - bool setCamParam(unsigned int v4l2controlId, int value); bool openCam(); bool selectCam(int camIdx = 0); bool initCam(); + + bool initI2C(); bool initHttpServer(); void calcFrameLoop(std::stop_token stopToken); @@ -95,5 +110,6 @@ private: // std::jthread m_calcThreads[1]; std::jthread m_calcThreads[4]; + std::shared_ptr m_i2c; std::shared_ptr m_httpServer; }; -- cgit v1.2.3-70-g09d2