diff --git a/include/ncpp/Direct.hh b/include/ncpp/Direct.hh index 17c5ea741..b4d59d31a 100644 --- a/include/ncpp/Direct.hh +++ b/include/ncpp/Direct.hh @@ -122,6 +122,11 @@ namespace ncpp return error_guard (ncdirect_cursor_disable (direct), -1); } + nc_err_e render_image (const char* file, ncblitter_e blitter, ncscale_e scale) const noexcept + { + return ncdirect_render_image (direct, file, blitter, scale); + } + private: ncdirect *direct; }; diff --git a/include/ncpp/NotCurses.hh b/include/ncpp/NotCurses.hh index 1731a65f1..be7190aca 100644 --- a/include/ncpp/NotCurses.hh +++ b/include/ncpp/NotCurses.hh @@ -111,6 +111,11 @@ namespace ncpp return notcurses_canchangecolor (nc); } + bool can_truecolor () const noexcept + { + return notcurses_cantruecolor (nc); + } + void get_stats (ncstats *stats) const noexcept { if (stats == nullptr) diff --git a/include/ncpp/Plane.hh b/include/ncpp/Plane.hh index 564caccbc..5805d4863 100644 --- a/include/ncpp/Plane.hh +++ b/include/ncpp/Plane.hh @@ -285,6 +285,11 @@ namespace ncpp return reparent (const_cast(&newparent)); } + void home () const noexcept + { + ncplane_home (plane); + } + bool move (int y, int x) const NOEXCEPT_MAYBE { return error_guard (ncplane_move_yx (plane, y, x), -1); @@ -616,6 +621,16 @@ namespace ncpp return error_guard (ncplane_perimeter (plane, ul, ur, ll, lr, hline, vline, ctlword), -1); } + bool perimeter_rounded (uint32_t attrword, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE + { + return error_guard (ncplane_perimeter_rounded (plane, attrword, channels, ctlword), -1); + } + + bool perimeter_double (uint32_t attrword, uint64_t channels, unsigned ctlword) const NOEXCEPT_MAYBE + { + return error_guard (ncplane_perimeter_double (plane, attrword, channels, ctlword), -1); + } + int polyfill (int y, int x, const Cell& c) const NOEXCEPT_MAYBE { return error_guard (ncplane_polyfill_yx (plane, y, x, c), -1); @@ -1033,6 +1048,16 @@ namespace ncpp return error_guard_cond (ret, ret < 0); } + bool is_fg_default () const noexcept + { + return ncplane_fg_default_p (plane); + } + + bool is_bg_default () const noexcept + { + return ncplane_bg_default_p (plane); + } + protected: explicit Plane (ncplane *_plane, bool _is_stdplane) : Root (nullptr), diff --git a/include/ncpp/Plot.hh b/include/ncpp/Plot.hh index 062c56050..9cfd7ac25 100644 --- a/include/ncpp/Plot.hh +++ b/include/ncpp/Plot.hh @@ -18,7 +18,7 @@ namespace ncpp static constexpr bool is_uint64 = std::is_same_v; public: - bool add_sample(TCoord x, TCoord y) const NOEXCEPT_MAYBE + bool add_sample (uint64_t x, TCoord y) const NOEXCEPT_MAYBE { int ret; @@ -31,7 +31,7 @@ namespace ncpp return error_guard (ret, -1); } - bool set_sample(TCoord x, TCoord y) const NOEXCEPT_MAYBE + bool set_sample (uint64_t x, TCoord y) const NOEXCEPT_MAYBE { int ret; @@ -43,6 +43,19 @@ namespace ncpp return error_guard (ret, -1); } + bool sample (uint64_t x, TCoord* y) const NOEXCEPT_MAYBE + { + int ret; + + if constexpr (is_double) { + ret = ncdplot_sample (plot, x, y); + } else { + ret = ncuplot_sample (plot, x, y); + } + + return error_guard (ret, -1); + } + protected: explicit PlotBase (Plane *plane, const ncplot_options *opts, TCoord miny = 0, TCoord maxy = 0) : Root (Utilities::get_notcurses_cpp (plane)) diff --git a/include/ncpp/Visual.hh b/include/ncpp/Visual.hh index 9f56e5da2..b12820dbf 100644 --- a/include/ncpp/Visual.hh +++ b/include/ncpp/Visual.hh @@ -92,6 +92,11 @@ namespace ncpp return error_guard (ncvisual_polyfill_yx (visual, y, x, rgba), -1); } + bool geom (const struct ncvisual_options *vopts, int *y, int *x, int *toy, int *tox) const NOEXCEPT_MAYBE + { + return error_guard (ncvisual_geom (get_notcurses (), visual, vopts, y, x, toy, tox), -1); + } + bool at (int y, int x, uint32_t* pixel) const { if (pixel == nullptr)