Program Listing for File Warp.hpp

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

#pragma once

#include <depthai/pipeline/Node.hpp>
// #include <depthai/pipeline/datatype/WarpConfig.hpp>

// shared
#include <depthai-shared/common/Point2f.hpp>
#include <depthai-shared/properties/WarpProperties.hpp>

namespace dai {
namespace node {

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

   protected:
    Properties& getProperties();

   private:
    void setWarpMesh(const float* meshData, int numMeshPoints, int width, int height);

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

    // /**
    //  * Initial config to use when manipulating frames
    //  */
    // WarpConfig initialConfig;

    // /**
    //  * Input WarpConfig message with ability to modify parameters in runtime
    //  * Default queue is blocking with size 8
    //  */
    // Input inputConfig{*this, "inputConfig", Input::Type::SReceiver, true, 8, {{DatatypeEnum::WarpConfig, true}}};

    Input inputImage{*this, "inputImage", Input::Type::SReceiver, true, 8, true, {{DatatypeEnum::ImgFrame, true}}};

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

    void setOutputSize(std::tuple<int, int> size);
    void setOutputSize(int width, int height);

    void setWarpMesh(const std::vector<Point2f>& meshData, int width, int height);
    void setWarpMesh(const std::vector<std::pair<float, float>>& meshData, int width, int height);

    void setNumFramesPool(int numFramesPool);

    void setMaxOutputFrameSize(int maxFrameSize);

    void setHwIds(std::vector<int> ids);
    std::vector<int> getHwIds() const;

    void setInterpolation(dai::Interpolation interpolation);
    dai::Interpolation getInterpolation() const;
};

}  // namespace node
}  // namespace dai