-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94017d2
commit 74a3a72
Showing
13 changed files
with
127 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.venv | ||
build | ||
*.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
default: help | ||
|
||
help: | ||
@echo "Rasal makefile commands, run with make <command>" | ||
@echo | ||
@grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\t\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done | ||
@echo | ||
|
||
.PHONY: clean | ||
clean: # Clean your working directory. | ||
@printf "\033[36m ---------- $@: Cleaning workding directory ----------\033[0m\n" | ||
rm -rf .venv | ||
rm -rf .tox | ||
rm -rf build | ||
rm -rf *.egg-info | ||
rm -rf *.pyc | ||
|
||
.PHONY: dev | ||
dev: clean # Build and enter a dev environment. | ||
@printf "\033[36m ---------- $@: Building dev environment ----------\033[0m\n" | ||
python -m venv .venv; | ||
.venv/bin/pip install ./ | ||
.venv/bin/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <pybind11/pybind11.h> | ||
#include <nlohmann/json.hpp> | ||
|
||
#define STRINGIFY(x) #x | ||
#define MACRO_STRINGIFY(x) STRINGIFY(x) | ||
|
||
/* | ||
* _____ _____ _ | ||
* | __ \ /\ / ____| /\ | | | ||
* | |__) | / \ | (___ / \ | | | ||
* | _ / / /\ \ \___ \ / /\ \ | | | ||
* | | \ \ / ____ \ ____) / ____ \| |____ | ||
* |_| \_\/_/ \_\_____/_/ \_\______| | ||
* | ||
*/ | ||
|
||
int add(int i, int j) { | ||
return i + j; | ||
} | ||
|
||
namespace py = pybind11; | ||
|
||
PYBIND11_MODULE(rasal, m) { | ||
m.doc() = R"pbdoc( | ||
Resolution and Sensors and Lens. | ||
_____ _____ _ | ||
| __ \ /\ / ____| /\ | | | ||
| |__) | / \ | (___ / \ | | | ||
| _ / / /\ \ \___ \ / /\ \ | | | ||
| | \ \ / ____ \ ____) / ____ \| |____ | ||
|_| \_\/_/ \_\_____/_/ \_\______| | ||
)pbdoc"; | ||
|
||
m.def("add", &add, R"pbdoc( | ||
Add two numbers | ||
Some other explanation about the add function. | ||
)pbdoc"); | ||
|
||
m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc( | ||
Subtract two numbers | ||
Some other explanation about the subtract function. | ||
)pbdoc"); | ||
|
||
#ifdef VERSION_INFO | ||
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO); | ||
#else | ||
m.attr("__version__") = "dev"; | ||
#endif | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Sensor { | ||
|
||
int width; | ||
int height; | ||
|
||
public: | ||
Sensor (int, int) | ||
|
||
} | ||
|
||
Sensor::Sensor (int width, int height) { | ||
width = width | ||
heigh = height | ||
} | ||
|