Program Listing for File MonoCamera.hpp

Return to documentation for file (include/depthai/pipeline/node/MonoCamera.hpp)

#pragma once

#include <depthai/pipeline/datatype/CameraControl.hpp>

#include "depthai/common/CameraBoardSocket.hpp"
#include "depthai/pipeline/Node.hpp"

// shared
#include <depthai-shared/properties/MonoCameraProperties.hpp>

namespace dai {
namespace node {

class MonoCamera : public NodeCRTP<Node, MonoCamera, MonoCameraProperties> {
   public:
    constexpr static const char* NAME = "MonoCamera";

   private:
    std::shared_ptr<RawCameraControl> rawControl;

   protected:
    Properties& getProperties();

   public:
    MonoCamera(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
    MonoCamera(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props);

    CameraControl initialControl;

    Input inputControl{*this, "inputControl", Input::Type::SReceiver, true, 8, {{DatatypeEnum::CameraControl, false}}};

    Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

    Output raw{*this, "raw", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

    Output frameEvent{*this, "frameEvent", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

    void setBoardSocket(CameraBoardSocket boardSocket);

    CameraBoardSocket getBoardSocket() const;

    void setCamera(std::string name);

    std::string getCamera() const;

    // Set which mono camera to use
    [[deprecated("Use 'setBoardSocket()' instead.")]] void setCamId(int64_t id);

    // Get which mono camera to use
    [[deprecated("Use 'getBoardSocket()' instead.")]] int64_t getCamId() const;

    void setImageOrientation(CameraImageOrientation imageOrientation);

    CameraImageOrientation getImageOrientation() const;

    void setResolution(Properties::SensorResolution resolution);

    Properties::SensorResolution getResolution() const;

    // Set events on which frames will be received
    void setFrameEventFilter(const std::vector<dai::FrameEvent>& events);

    // Get events on which frames will be received
    std::vector<dai::FrameEvent> getFrameEventFilter() const;

    void setFps(float fps);

    [[deprecated("setIsp3aFps is unstable")]] void setIsp3aFps(int isp3aFps);

    float getFps() const;

    std::tuple<int, int> getResolutionSize() const;
    int getResolutionWidth() const;
    int getResolutionHeight() const;

    void setNumFramesPool(int num);
    void setRawNumFramesPool(int num);

    int getNumFramesPool() const;
    int getRawNumFramesPool() const;

    void setRawOutputPacked(bool packed);
};

}  // namespace node
}  // namespace dai