summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/benoit/d/arch.hh18
-rw-r--r--include/benoit/d/cfg.hh7
-rw-r--r--include/benoit/d/debug.hh11
-rw-r--r--include/benoit/d/dobt.hh6
-rw-r--r--include/benoit/d/imgfmt.hh7
-rw-r--r--include/benoit/d/kernel.hh26
-rw-r--r--include/benoit/d/logdoprint.hh6
-rw-r--r--include/benoit/d/maxiter.hh6
-rw-r--r--include/benoit/d/numthrds.hh6
-rw-r--r--include/benoit/d/outimg.hh7
-rw-r--r--include/benoit/d/pos.hh7
-rw-r--r--include/benoit/d/printdolog.hh6
-rw-r--r--include/benoit/d/resx.hh6
-rw-r--r--include/benoit/d/resy.hh6
-rw-r--r--include/benoit/d/thelog.hh8
-rw-r--r--include/benoit/d/ver.hh6
-rw-r--r--include/benoit/dat.hh5
-rw-r--r--include/benoit/plotmandelbrot.hh2
-rw-r--r--include/benoit/t/dat.hh65
-rw-r--r--include/benoit/t/imgfmt.hh1
-rw-r--r--include/benoit/t/rgba.hh13
-rw-r--r--include/benoit/t/thrddat.hh12
-rw-r--r--include/benoit/wrtimg.hh6
23 files changed, 166 insertions, 77 deletions
diff --git a/include/benoit/d/arch.hh b/include/benoit/d/arch.hh
new file mode 100644
index 0000000..71d8feb
--- /dev/null
+++ b/include/benoit/d/arch.hh
@@ -0,0 +1,18 @@
+# pragma once
+# include <benoit/t/arch.hh>
+namespace benoit {
+ namespace d {
+ benoit::t::arch constexpr arch =
+# if defined(__aarch64__)
+ benoit::t::arch::aarch64;
+# elif (defined(_M_AMD64) || defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(x86_64__))
+ benoit::t::arch::amd64;
+# elif (defined(_IA64) defined(_M_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__itanium__))
+ benoit::t::arch::ia64;
+# elif (defined(_ARCH_PPC64) || defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__))
+ benoit::t::arch::ppc64;
+# else
+ benoit::t::arch::unknown;
+# endif
+ }
+}
diff --git a/include/benoit/d/cfg.hh b/include/benoit/d/cfg.hh
new file mode 100644
index 0000000..e2b2bf5
--- /dev/null
+++ b/include/benoit/d/cfg.hh
@@ -0,0 +1,7 @@
+# pragma once
+# include <string>
+namespace benoit {
+ namespace d {
+ std::string extern cfg;
+ }
+}
diff --git a/include/benoit/d/debug.hh b/include/benoit/d/debug.hh
new file mode 100644
index 0000000..015eb17
--- /dev/null
+++ b/include/benoit/d/debug.hh
@@ -0,0 +1,11 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ bool constexpr debug =
+# if defined(NDEBUG)
+ false;
+# else
+ true;
+# endif
+ }
+}
diff --git a/include/benoit/d/dobt.hh b/include/benoit/d/dobt.hh
new file mode 100644
index 0000000..149eabb
--- /dev/null
+++ b/include/benoit/d/dobt.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ bool extern dobt;
+ }
+}
diff --git a/include/benoit/d/imgfmt.hh b/include/benoit/d/imgfmt.hh
new file mode 100644
index 0000000..58bbc5f
--- /dev/null
+++ b/include/benoit/d/imgfmt.hh
@@ -0,0 +1,7 @@
+# pragma once
+# include <benoit/t/imgfmt.hh>
+namespace benoit {
+ namespace d {
+ benoit::t::imgfmt extern imgfmt;
+ }
+}
diff --git a/include/benoit/d/kernel.hh b/include/benoit/d/kernel.hh
new file mode 100644
index 0000000..b11d9a0
--- /dev/null
+++ b/include/benoit/d/kernel.hh
@@ -0,0 +1,26 @@
+# pragma once
+# include <benoit/t/kernel.hh>
+namespace benoit {
+ namespace d {
+ benoit::t::kernel constexpr kernel =
+# if (defined(Macintosh) || defined(macintosh) || defined(__APPLE__) || defined(__MACH__))
+ benoit::t::kernel::darwinos;
+# elif defined(__DragonFly__)
+ benoit::t::kernel::dragonflybsd;
+# elif defined(__FreeBSD__)
+ benoit::t::kernel::freebsd;
+# elif (defined(__GNU__) || defined(__gnu_hurd__))
+ benoit::t::kernel::hurd;
+# elif defined(__linux__)
+ benoit::t::kernel::linux;
+# elif defined(__minix)
+ benoit::t::kernel::minix;
+# elif defined(__NetBSD__)
+ benoit::t::kernel::netbsd;
+# elif defined(__OpenBSD__)
+ benoit::t::kernel::openbsd;
+# else
+ benoit::t::kernel::unknown;
+# endif
+ }
+}
diff --git a/include/benoit/d/logdoprint.hh b/include/benoit/d/logdoprint.hh
new file mode 100644
index 0000000..801c134
--- /dev/null
+++ b/include/benoit/d/logdoprint.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ bool extern logdoprint;
+ }
+}
diff --git a/include/benoit/d/maxiter.hh b/include/benoit/d/maxiter.hh
new file mode 100644
index 0000000..00fc555
--- /dev/null
+++ b/include/benoit/d/maxiter.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ unsigned long long extern maxiter;
+ }
+}
diff --git a/include/benoit/d/numthrds.hh b/include/benoit/d/numthrds.hh
new file mode 100644
index 0000000..459f994
--- /dev/null
+++ b/include/benoit/d/numthrds.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ unsigned extern numthrds;
+ }
+}
diff --git a/include/benoit/d/outimg.hh b/include/benoit/d/outimg.hh
new file mode 100644
index 0000000..cfcd7df
--- /dev/null
+++ b/include/benoit/d/outimg.hh
@@ -0,0 +1,7 @@
+# pragma once
+# include <string>
+namespace benoit {
+ namespace d {
+ std::string extern outimg;
+ }
+}
diff --git a/include/benoit/d/pos.hh b/include/benoit/d/pos.hh
new file mode 100644
index 0000000..afaeb1d
--- /dev/null
+++ b/include/benoit/d/pos.hh
@@ -0,0 +1,7 @@
+# pragma once
+# include <benoit/t/pos.hh>
+namespace benoit {
+ namespace d {
+ benoit::t::pos extern pos;
+ }
+}
diff --git a/include/benoit/d/printdolog.hh b/include/benoit/d/printdolog.hh
new file mode 100644
index 0000000..85c58bc
--- /dev/null
+++ b/include/benoit/d/printdolog.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ bool extern printdolog;
+ }
+}
diff --git a/include/benoit/d/resx.hh b/include/benoit/d/resx.hh
new file mode 100644
index 0000000..c90a790
--- /dev/null
+++ b/include/benoit/d/resx.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ unsigned extern resx;
+ }
+}
diff --git a/include/benoit/d/resy.hh b/include/benoit/d/resy.hh
new file mode 100644
index 0000000..7d502a8
--- /dev/null
+++ b/include/benoit/d/resy.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ unsigned extern resy;
+ }
+}
diff --git a/include/benoit/d/thelog.hh b/include/benoit/d/thelog.hh
new file mode 100644
index 0000000..edceb32
--- /dev/null
+++ b/include/benoit/d/thelog.hh
@@ -0,0 +1,8 @@
+# pragma once
+# include <string>
+# include <vector>
+namespace benoit {
+ namespace d {
+ std::vector<std::string> extern thelog;
+ }
+}
diff --git a/include/benoit/d/ver.hh b/include/benoit/d/ver.hh
new file mode 100644
index 0000000..79a8cf7
--- /dev/null
+++ b/include/benoit/d/ver.hh
@@ -0,0 +1,6 @@
+# pragma once
+namespace benoit {
+ namespace d {
+ unsigned long long extern ver;
+ }
+}
diff --git a/include/benoit/dat.hh b/include/benoit/dat.hh
deleted file mode 100644
index 7c4e7cf..0000000
--- a/include/benoit/dat.hh
+++ /dev/null
@@ -1,5 +0,0 @@
-# pragma once
-# include <benoit/t/dat.hh>
-namespace benoit {
- benoit::t::dat extern dat;
-}
diff --git a/include/benoit/plotmandelbrot.hh b/include/benoit/plotmandelbrot.hh
index 3d8b57a..f79b247 100644
--- a/include/benoit/plotmandelbrot.hh
+++ b/include/benoit/plotmandelbrot.hh
@@ -2,5 +2,5 @@
# include <cstdint>
# include <vector>
namespace benoit {
- std::vector<std::uint8_t> plotmandelbrot();
+ std::vector<std::uint8_t> * plotmandelbrot();
}
diff --git a/include/benoit/t/dat.hh b/include/benoit/t/dat.hh
deleted file mode 100644
index c43784b..0000000
--- a/include/benoit/t/dat.hh
+++ /dev/null
@@ -1,65 +0,0 @@
-# pragma once
-# include <benoit/t/arch.hh>
-# include <benoit/t/imgfmt.hh>
-# include <benoit/t/kernel.hh>
-# include <benoit/t/pos.hh>
-# include <string>
-# include <vector>
-using namespace std::literals::string_literals;
-namespace benoit {
- namespace t {
- class dat {
- public:
- benoit::t::arch constexpr static arch =
-# if defined(__aarch64__)
- benoit::t::arch::aarch64;
-# elif (defined(_M_AMD64) || defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(x86_64__))
- benoit::t::arch::amd64;
-# elif (defined(_IA64) defined(_M_IA64) || defined(__IA64__) || defined(__ia64__) || defined(__itanium__))
- benoit::t::arch::ia64;
-# elif (defined(_ARCH_PPC64) || defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__))
- benoit::t::arch::ppc64;
-# else
- benoit::t::arch::unknown;
-# endif
- benoit::t::imgfmt imgfmt = benoit::t::imgfmt::ppm;
- benoit::t::kernel constexpr static kernel =
-# if (defined(Macintosh) || defined(macintosh) || defined(__APPLE__) || defined(__MACH__))
- benoit::t::kernel::darwinos;
-# elif defined(__DragonFly__)
- benoit::t::kernel::dragonflybsd;
-# elif defined(__FreeBSD__)
- benoit::t::kernel::freebsd;
-# elif (defined(__GNU__) || defined(__gnu_hurd__))
- benoit::t::kernel::hurd;
-# elif defined(__linux__)
- benoit::t::kernel::linux;
-# elif defined(__minix)
- benoit::t::kernel::minix;
-# elif defined(__NetBSD__)
- benoit::t::kernel::netbsd;
-# elif defined(__OpenBSD__)
- benoit::t::kernel::openbsd;
-# else
- benoit::t::kernel::unknown;
-# endif
- benoit::t::pos pos;
- bool dobt = false;
- bool printdolog = true;
- bool debug =
-# if defined(NDEBUG)
- false;
-# else
- true;
-# endif
- long long ver = 0x5;
- std::string cfg = "benoit.xml"s;
- std::string outimg = "image"s;
- std::vector<std::string> thelog = {};
- unsigned long long maxiter = 0x100ull;
- unsigned numthrds = 0x1u;
- unsigned resx = 0x100u;
- unsigned resy = 0x100u;
- };
- }
-}
diff --git a/include/benoit/t/imgfmt.hh b/include/benoit/t/imgfmt.hh
index ffd6367..7efed27 100644
--- a/include/benoit/t/imgfmt.hh
+++ b/include/benoit/t/imgfmt.hh
@@ -3,7 +3,6 @@ namespace benoit {
namespace t {
enum class imgfmt {
png,
- ppm,
webp,
};
}
diff --git a/include/benoit/t/rgba.hh b/include/benoit/t/rgba.hh
new file mode 100644
index 0000000..e34112f
--- /dev/null
+++ b/include/benoit/t/rgba.hh
@@ -0,0 +1,13 @@
+# pragma once
+# include <cstdint>
+namespace benoit {
+ namespace t {
+ class rgba {
+ public:
+ std::uint8_t a = 0xFF;
+ std::uint8_t b = 0x0;
+ std::uint8_t g = 0x0;
+ std::uint8_t r = 0x0;
+ };
+ }
+}
diff --git a/include/benoit/t/thrddat.hh b/include/benoit/t/thrddat.hh
index 75c8a05..1b691dc 100644
--- a/include/benoit/t/thrddat.hh
+++ b/include/benoit/t/thrddat.hh
@@ -1,15 +1,17 @@
# pragma once
+# include <benoit/t/rgba.hh>
# include <cstdint>
# include <pthread.h>
-# include <vector>
namespace benoit {
namespace t {
class thrddat {
public:
- pthread_t * thrd = nullptr;
- std::vector<std::uint8_t> * img = nullptr;
- unsigned * rows = nullptr;
- unsigned * id = nullptr;
+ pthread_t * thrd = nullptr;
+ std::uint8_t * thrdcol = nullptr;
+ benoit::t::rgba * img = nullptr;
+ unsigned * id = nullptr;
+ unsigned long long * imgbegin = nullptr;
+ unsigned long long * imgend = nullptr;
};
}
}
diff --git a/include/benoit/wrtimg.hh b/include/benoit/wrtimg.hh
new file mode 100644
index 0000000..ce4880b
--- /dev/null
+++ b/include/benoit/wrtimg.hh
@@ -0,0 +1,6 @@
+# pragma once
+# include <cstdint>
+# include <vector>
+namespace benoit {
+ void wrtimg(std::vector<std::uint8_t> * img);
+}