Skip to content

Commit

Permalink
Merge pull request #53 from BugelNiels/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
BugelNiels authored Jun 18, 2023
2 parents 8ddee4b + c2e0a2d commit 6d738a8
Show file tree
Hide file tree
Showing 30 changed files with 197 additions and 82 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.9)

set(NITRO_VERSION 1.1.0)
set(NITRO_VERSION 1.1.1)

project(nitro VERSION ${NITRO_VERSION} LANGUAGES CXX)

Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<a name="readme-top"></a>

[![stars](https://img.shields.io/github/stars/bugelniels/nitro.svg?style=for-the-badge)]()
[![stars](https://img.shields.io/github/stars/bugelniels/nitro.svg?style=for-the-badge)](https://github.com/BugelNiels/nitro/stargazers)
[![Github All Releases](https://img.shields.io/github/downloads/BugelNiels/nitro/total.svg?style=for-the-badge)](https://github.com/BugelNiels/nitro/releases/latest)
[![watchers](https://img.shields.io/github/watchers/bugelniels/nitro.svg?style=for-the-badge)]()
[![watchers](https://img.shields.io/github/watchers/bugelniels/nitro.svg?style=for-the-badge)](https://github.com/BugelNiels/nitro/watchers)
[![license](https://img.shields.io/github/license/bugelniels/nitro.svg?style=for-the-badge)](https://github.com/BugelNiels/nitro/blob/main/LICENCE.md)
[![follow](https://img.shields.io/github/followers/bugelniels.svg?style=for-the-badge&label=Follow&maxAge=2592000)](https://github.com/BugelNiels?tab=followers)
[![LinkedIn](https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555)](https://nl.linkedin.com/in/nielsbugel)

<br />
<div align="center">
<h1 align="center">NITRO</h3>

<a href="https://github.com/BugelNiels/nitro">
<img src="appdir/logo.png" alt="Logo" width="128" height="128">
</a>
<h3 align="center" style="padding-top: 0">NITRO</h3>
<p align="center">
Powerful and flexible node editor that facilitates building complex combinations of various image processing techniques.
<br />
Expand All @@ -26,7 +28,6 @@
</p>
</div>


![Node Editor](screenshots/front.png)

## About the project
Expand Down
Binary file added appdir/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added appdir/logo48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added appdir/logo512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added appdir/logo64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified appdir/nitro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion appdir/usr/share/applications/nitro.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ Type=Application
Name=NITRO
Comment=Node Editor for building Image Processing Routines
Exec=nitro
Icon=nitro
Icon=logo
Categories=Graphics;
X-AppImage-Version=
132 changes: 132 additions & 0 deletions data/readme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"connections": [
{
"inPortIndex": 0,
"intNodeId": 5,
"outNodeId": 4,
"outPortIndex": 0
},
{
"inPortIndex": 1,
"intNodeId": 4,
"outNodeId": 0,
"outPortIndex": 0
},
{
"inPortIndex": 2,
"intNodeId": 4,
"outNodeId": 3,
"outPortIndex": 0
},
{
"inPortIndex": 0,
"intNodeId": 3,
"outNodeId": 2,
"outPortIndex": 0
},
{
"inPortIndex": 1,
"intNodeId": 2,
"outNodeId": 1,
"outPortIndex": 1
},
{
"inPortIndex": 0,
"intNodeId": 2,
"outNodeId": 1,
"outPortIndex": 0
},
{
"inPortIndex": 0,
"intNodeId": 1,
"outNodeId": 0,
"outPortIndex": 0
}
],
"nodes": [
{
"id": 0,
"internal-data": {
"model-name": "ImageSource",
"properties": {
"Load 0": "/home/niels/Downloads/niels-bugel-earth2-shopped.jpeg"
}
},
"position": {
"x": -701,
"y": -148
}
},
{
"id": 1,
"internal-data": {
"model-name": "imInfo",
"properties": {
"Type": "Type: "
}
},
"position": {
"x": -445.4,
"y": -50.00000000000001
}
},
{
"id": 2,
"internal-data": {
"model-name": "mask",
"properties": {
"In 0": 1920,
"In 1": 480,
"In 2": 1,
"In 3": 1,
"Mode": 0
}
},
"position": {
"x": -87.39999999999999,
"y": -29
}
},
{
"id": 3,
"internal-data": {
"model-name": "gaussianFilter",
"properties": {
"Border": 0,
"In 1": 256,
"In 2": 221.17
}
},
"position": {
"x": 201.79999999999998,
"y": 5.600000000000017
}
},
{
"id": 4,
"internal-data": {
"model-name": "mix",
"properties": {
"In 0": 0.29,
"Mode": 3
}
},
"position": {
"x": 479.19999999999993,
"y": -210.8
}
},
{
"id": 5,
"internal-data": {
"model-name": "ImageViewer",
"properties": {
}
},
"position": {
"x": 782.8,
"y": -163.7999999999999
}
}
]
}
5 changes: 2 additions & 3 deletions include/gui/mainwindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace nitro {

~MainWindow() override;

public:
QLabel *buildDockIcon(const QString &path);

void finalizeSetup();
Expand All @@ -31,7 +30,7 @@ namespace nitro {

private:
const int icSize_ = 16;
const QColor icColor_ = {180, 180, 180};
const QColor icColor_ = {148, 148, 148};
QSet<QDockWidget *> widgets_;
QLabel *fileNameLabel_ = nullptr;
NodeDockWidget *nodeDock_ = nullptr;
Expand All @@ -47,4 +46,4 @@ namespace nitro {

};

} // nitro
} // nitro
6 changes: 5 additions & 1 deletion include/nodes/datatypes/decimaldata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ namespace nitro {

[[nodiscard]] double value() const { return val_; }

[[nodiscard]] QString getDescription() const override {
return QString::number(val_, 'f', 3);
}

private:
double val_ = 0;
};
} // nitro
} // nitro
6 changes: 5 additions & 1 deletion include/nodes/datatypes/imagedata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ namespace nitro {

[[nodiscard]] std::shared_ptr<cv::Mat> image() const { return image_; }

[[nodiscard]] QString getDescription() const override {
return "";
}

private:
std::shared_ptr<cv::Mat> image_;
};
} // nitro
} // nitro
6 changes: 5 additions & 1 deletion include/nodes/datatypes/integerdata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ namespace nitro {

[[nodiscard]] int value() const { return val_; }

[[nodiscard]] QString getDescription() const override {
return QString::number(val_);
}

private:
int val_ = 0;
};
} // nitro
} // nitro
1 change: 0 additions & 1 deletion modules/im3d/src/gui/im3dviewer/renderdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
nitro::RenderDockWidget::RenderDockWidget(RenderView *renderView, MainWindow *window)
: QDockWidget(window),
renderView_(renderView) {
setHidden(true);
setWindowTitle("3D Image Viewer");
setTitleBarWidget(window->buildDockIcon(":/icons/surface_visualizer.png"));

Expand Down
1 change: 0 additions & 1 deletion modules/imcore/src/gui/imviewer/imviewdockwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ nitro::ImViewDockWidget::ImViewDockWidget(ImageViewer *imageViewer, MainWindow *
imHLayout->addStretch();
imHLayout->addWidget(zoomLabel);
imHLayout->addWidget(zoomBar);
imHLayout->addStretch();
imHLayout->addWidget(new QLabel("size: "));
imHLayout->addWidget(sizeLabel);
imHLayout->addSpacing(20);
Expand Down
36 changes: 7 additions & 29 deletions modules/imcore/src/nodes/util/iminfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,20 @@
#define OUTPUT_MIN "Min"
#define OUTPUT_MAX "Max"

nitro::ImInfoOperator::ImInfoOperator(QLabel *widthLabel, QLabel *heightLabel, QLabel *channelsLabel, QLabel *typeLabel,
QLabel *minLabel, QLabel *maxLabel)
: widthLabel_(widthLabel),
heightLabel_(heightLabel),
channelsLabel_(channelsLabel),
typeLabel_(typeLabel),
minLabel_(minLabel),
maxLabel_(maxLabel) {
nitro::ImInfoOperator::ImInfoOperator(QLabel *typeLabel)
: typeLabel_(typeLabel) {

}

void nitro::ImInfoOperator::execute(nitro::NodePorts &nodePorts, const std::map<QString, int> &options) const {
if (!nodePorts.inputsPresent({INPUT_IMAGE})) {
widthLabel_->setText("Width: -");
heightLabel_->setText("Height: -");
return;
}
auto im1 = nodePorts.getInputImage(INPUT_IMAGE);
nodePorts.setOutputInteger(OUTPUT_WIDTH, im1->cols);
nodePorts.setOutputInteger(OUTPUT_HEIGHT, im1->rows);
nodePorts.setOutputInteger(OUTPUT_CHANNELS, im1->channels());

widthLabel_->setText(QString("Width: %1").arg(im1->cols));
heightLabel_->setText(QString("Height: %1").arg(im1->rows));
channelsLabel_->setText(QString("Channels: %1").arg(im1->channels()));

QString type;
switch (im1->depth()) {
case CV_8U: // 8-bit unsigned integer (0-255)
Expand Down Expand Up @@ -77,38 +65,28 @@ void nitro::ImInfoOperator::execute(nitro::NodePorts &nodePorts, const std::map<
cv::minMaxLoc(channels[i], &minValueTemp, &maxValueTemp, &minLoc, &maxLoc);
minValue = std::min(minValue, minValueTemp);
maxValue = std::max(maxValue, maxValueTemp);

}

typeLabel_->setText(QString("Type: %1").arg(type));
minLabel_->setText(QString("Min: %1").arg(minValue));
maxLabel_->setText(QString("Max: %1").arg(maxValue));
nodePorts.setOutputValue(OUTPUT_MIN, minValue);
nodePorts.setOutputValue(OUTPUT_MAX, maxValue);
}

std::function<std::unique_ptr<nitro::NitroNode>()> nitro::ImInfoOperator::creator(const QString &category) {
return [category]() {
nitro::NitroNodeBuilder builder("Image Info", "imInfo", category);
auto *widthLabel = new QLabel("Width: ");
auto *heightLabel = new QLabel("Height: ");
auto *channelsLabel = new QLabel("Channels: ");
auto *typeLabel = new QLabel("Type: ");
auto *minLabel = new QLabel("Min: ");
auto *maxLabel = new QLabel("Max: ");
return builder.
withOperator(std::make_unique<nitro::ImInfoOperator>(widthLabel, heightLabel, channelsLabel, typeLabel,
minLabel, maxLabel))->
withOperator(std::make_unique<nitro::ImInfoOperator>(typeLabel))->
withIcon("info.png")->
withNodeColor({36, 98, 131})->
withInputImage(INPUT_IMAGE)->
withDisplayWidget(OUTPUT_WIDTH, widthLabel)->
withDisplayWidget(OUTPUT_HEIGHT, heightLabel)->
withDisplayWidget(OUTPUT_CHANNELS, channelsLabel)->
withDisplayWidget(OUTPUT_TYPE, typeLabel)->
withDisplayWidget(OUTPUT_MIN, minLabel)->
withDisplayWidget(OUTPUT_MAX, maxLabel)->
withOutputInteger(OUTPUT_WIDTH)->
withOutputInteger(OUTPUT_HEIGHT)->
withOutputInteger(OUTPUT_CHANNELS)->
withOutputValue(OUTPUT_MIN)->
withOutputValue(OUTPUT_MAX)->
build();
};
}
8 changes: 1 addition & 7 deletions modules/imcore/src/nodes/util/iminfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@ namespace nitro {

class ImInfoOperator : public NodeOperator {
public:
ImInfoOperator(QLabel *widthLabel, QLabel *heightLabel, QLabel *channelsLabel, QLabel *typeLabel,
QLabel *minLabel, QLabel *maxLabel);
ImInfoOperator(QLabel *typeLabel);

static std::function<std::unique_ptr<NitroNode>()> creator(const QString &category);

void execute(NodePorts &nodePorts, const std::map<QString, int> &options) const override;

private:
QLabel *widthLabel_;
QLabel *heightLabel_;
QLabel *channelsLabel_;
QLabel *typeLabel_;
QLabel *minLabel_;
QLabel *maxLabel_;
};
} // nitro
Binary file modified resources/icons/nitro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/shaders/raycast.frag
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ uniform int imHeight;
uniform bool enableImageColors;
uniform bool enableOrthographic;

const vec3 backgroundCol = vec3(0.2);
const vec3 backgroundCol = vec3(0.2, 0.2, 0.22);

float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
Expand Down
Binary file modified screenshots/3dviewer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/imviewer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6d738a8

Please sign in to comment.