Skip to content

Commit

Permalink
Removed namespace identation style and applied
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed Dec 7, 2020
1 parent 0614cef commit 87db0dc
Show file tree
Hide file tree
Showing 22 changed files with 654 additions and 660 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BasedOnStyle: Google
NamespaceIndentation: Inner
NamespaceIndentation: None
BreakBeforeBinaryOperators: NonAssignment
SpaceBeforeParens: Never
IndentPPDirectives: BeforeHash
Expand Down
1 change: 0 additions & 1 deletion include/depthai/pipeline/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class Node {
Pipeline getParentPipeline();

public:

virtual std::string getName() = 0;
virtual std::vector<Output> getOutputs() = 0;
virtual std::vector<Input> getInputs() = 0;
Expand Down
5 changes: 2 additions & 3 deletions include/depthai/pipeline/Pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Pipeline {

// Default Pipeline openvino version
constexpr static auto DEFAULT_OPENVINO_VERSION = PipelineImpl::DEFAULT_OPENVINO_VERSION;

GlobalProperties getGlobalProperties() const;

PipelineSchema getPipelineSchema();
Expand Down Expand Up @@ -139,15 +139,14 @@ class Pipeline {
AssetManager getAllAssets() const {
return impl()->getAllAssets();
}

AssetManager& getAssetManager() {
return impl()->assetManager;
}

const AssetManager& getAssetManager() const {
return impl()->assetManager;
}

};

} // namespace dai
52 changes: 26 additions & 26 deletions include/depthai/pipeline/node/ColorCamera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@

namespace dai {
namespace node {
class ColorCamera : public Node {
dai::ColorCameraProperties properties;
class ColorCamera : public Node {
dai::ColorCameraProperties properties;

std::string getName() override;
std::vector<Output> getOutputs() override;
std::vector<Input> getInputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;
std::string getName() override;
std::vector<Output> getOutputs() override;
std::vector<Input> getInputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;

public:
ColorCamera(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
public:
ColorCamera(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);

Output video{*this, "video", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};
Output preview{*this, "preview", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};
Output still{*this, "still", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};
Output video{*this, "video", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};
Output preview{*this, "preview", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};
Output still{*this, "still", Output::Type::MSender, {{DatatypeEnum::ImgFrame, false}}};

// Set which color camera to use
void setCamId(int64_t id);
// Set which color camera to use
void setCamId(int64_t id);

// Get which color camera to use
int64_t getCamId() const;
// Get which color camera to use
int64_t getCamId() const;

// setColorOrder - RGB or BGR
void setColorOrder(ColorCameraProperties::ColorOrder colorOrder);
// setColorOrder - RGB or BGR
void setColorOrder(ColorCameraProperties::ColorOrder colorOrder);

// getColorOrder - returns color order
ColorCameraProperties::ColorOrder getColorOrder() const;
// getColorOrder - returns color order
ColorCameraProperties::ColorOrder getColorOrder() const;

// setInterleaved
void setInterleaved(bool interleaved);
// setInterleaved
void setInterleaved(bool interleaved);

// set preview output size
void setPreviewSize(int width, int height);
// set preview output size
void setPreviewSize(int width, int height);

void setResolution(ColorCameraProperties::SensorResolution resolution);
};
void setResolution(ColorCameraProperties::SensorResolution resolution);
};

} // namespace node
} // namespace dai
66 changes: 33 additions & 33 deletions include/depthai/pipeline/node/ImageManip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@
namespace dai {
namespace node {

class ImageManip : public Node {
dai::ImageManipProperties properties;

std::string getName() override;
std::vector<Input> getInputs() override;
std::vector<Output> getOutputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;

std::shared_ptr<RawImageManipConfig> rawConfig;
ImageManipConfig config;

public:
ImageManip(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);

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

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

// Functions to set ImageManipConfig
void setCropRect(float xmin, float ymin, float xmax, float ymax);
void setCenterCrop(float ratio, float whRatio = 1.0f);
void setResize(int w, int h);
void setResizeThumbnail(int w, int h, int bgRed = 0, int bgGreen = 0, int bgBlue = 0);
void setFrameType(dai::RawImgFrame::Type name);
void setHorizontalFlip(bool flip);

// Functions to set properties
void setWaitForConfigInput(bool wait);
void setNumFramesPool(int numFramesPool);
void setMaxOutputFrameSize(int maxFrameSize);
};
class ImageManip : public Node {
dai::ImageManipProperties properties;

std::string getName() override;
std::vector<Input> getInputs() override;
std::vector<Output> getOutputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;

std::shared_ptr<RawImageManipConfig> rawConfig;
ImageManipConfig config;

public:
ImageManip(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);

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

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

// Functions to set ImageManipConfig
void setCropRect(float xmin, float ymin, float xmax, float ymax);
void setCenterCrop(float ratio, float whRatio = 1.0f);
void setResize(int w, int h);
void setResizeThumbnail(int w, int h, int bgRed = 0, int bgGreen = 0, int bgBlue = 0);
void setFrameType(dai::RawImgFrame::Type name);
void setHorizontalFlip(bool flip);

// Functions to set properties
void setWaitForConfigInput(bool wait);
void setNumFramesPool(int numFramesPool);
void setMaxOutputFrameSize(int maxFrameSize);
};

} // namespace node
} // namespace dai
26 changes: 13 additions & 13 deletions include/depthai/pipeline/node/MyProducer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

namespace dai {
namespace node {
class MyProducer : public Node {
dai::MyProducerProperties properties;
class MyProducer : public Node {
dai::MyProducerProperties properties;

std::string getName() override;
std::vector<Input> getInputs() override;
std::vector<Output> getOutputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;
std::string getName() override;
std::vector<Input> getInputs() override;
std::vector<Output> getOutputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;

public:
MyProducer(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
public:
MyProducer(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);

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

void setMessage(const std::string& m);
void setProcessor(ProcessorType proc);
};
void setMessage(const std::string& m);
void setProcessor(ProcessorType proc);
};

} // namespace node
} // namespace dai
40 changes: 20 additions & 20 deletions include/depthai/pipeline/node/NeuralNetwork.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@

namespace dai {
namespace node {
class NeuralNetwork : public Node {
dai::NeuralNetworkProperties properties;
class NeuralNetwork : public Node {
dai::NeuralNetworkProperties properties;

std::string getName() override;
std::vector<Output> getOutputs() override;
std::vector<Input> getInputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;
tl::optional<OpenVINO::Version> getRequiredOpenVINOVersion() override;
// void loadAssets(AssetManager& assetManager) override;
std::string getName() override;
std::vector<Output> getOutputs() override;
std::vector<Input> getInputs() override;
nlohmann::json getProperties() override;
std::shared_ptr<Node> clone() override;
tl::optional<OpenVINO::Version> getRequiredOpenVINOVersion() override;
// void loadAssets(AssetManager& assetManager) override;

void loadBlob(const std::string& path);
void loadBlob(const std::string& path);

std::string blobPath;
OpenVINO::Version networkOpenvinoVersion;
std::string blobPath;
OpenVINO::Version networkOpenvinoVersion;

public:
NeuralNetwork(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);
public:
NeuralNetwork(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId);

Input input{*this, "in", Input::Type::SReceiver, {{DatatypeEnum::Buffer, true}}};
Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::NNData, false}}};
Input input{*this, "in", Input::Type::SReceiver, {{DatatypeEnum::Buffer, true}}};
Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::NNData, false}}};

// Specify local filesystem path to load the blob (which gets loaded at loadAssets)
void setBlobPath(const std::string& path);
void setNumPoolFrames(int numFrames);
};
// Specify local filesystem path to load the blob (which gets loaded at loadAssets)
void setBlobPath(const std::string& path);
void setNumPoolFrames(int numFrames);
};

} // namespace node
} // namespace dai
80 changes: 40 additions & 40 deletions include/depthai/pipeline/node/SPIOut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,46 @@

namespace dai {
namespace node {
class SPIOut : public Node {
dai::SPIOutProperties properties;

std::string getName() {
return "SPIOut";
}

std::vector<Input> getInputs() {
return {input};
}

std::vector<Output> getOutputs() {
return {};
}

nlohmann::json getProperties() {
nlohmann::json j;
nlohmann::to_json(j, properties);
return j;
}

std::shared_ptr<Node> clone() {
return std::make_shared<SPIOut>(*this);
}

public:
SPIOut(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId) : Node(par, nodeId) {
properties.busId = 0;
}

Input input{*this, "in", Input::Type::SReceiver, {{DatatypeEnum::Buffer, true}}};

void setStreamName(std::string name) {
properties.streamName = name;
}

void setBusId(int id) {
properties.busId = id;
}
};
class SPIOut : public Node {
dai::SPIOutProperties properties;

std::string getName() {
return "SPIOut";
}

std::vector<Input> getInputs() {
return {input};
}

std::vector<Output> getOutputs() {
return {};
}

nlohmann::json getProperties() {
nlohmann::json j;
nlohmann::to_json(j, properties);
return j;
}

std::shared_ptr<Node> clone() {
return std::make_shared<SPIOut>(*this);
}

public:
SPIOut(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId) : Node(par, nodeId) {
properties.busId = 0;
}

Input input{*this, "in", Input::Type::SReceiver, {{DatatypeEnum::Buffer, true}}};

void setStreamName(std::string name) {
properties.streamName = name;
}

void setBusId(int id) {
properties.busId = id;
}
};

} // namespace node
} // namespace dai
Loading

0 comments on commit 87db0dc

Please sign in to comment.