Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Visual Class Reference

#include <Visual.hh>

Inheritance diagram for Visual:
Collaboration diagram for Visual:

Public Member Functions

 Visual (const char *file)
 
 Visual (const uint32_t *rgba, int rows, int rowstride, int cols)
 
 Visual (const Plane &p, ncblitter_e blit, unsigned begy, unsigned begx, unsigned leny, unsigned lenx)
 
 ~Visual () noexcept
 
 operator ncvisual * () const noexcept
 
 operator ncvisual const * () const noexcept
 
int decode () const noexcept
 
int decode_loop () const noexcept
 
ncplaneblit (const ncvisual_options *vopts) const NOEXCEPT_MAYBE
 
int stream (const ncvisual_options *vopts, float timescale, ncstreamcb streamer, void *curry=nullptr) const NOEXCEPT_MAYBE
 
ncplanesubtitle (Plane &parent) noexcept
 
bool rotate (double rads) const NOEXCEPT_MAYBE
 
bool simple_streamer (ncvisual_options *vopts, const timespec *tspec, void *curry=nullptr) const NOEXCEPT_MAYBE
 
int polyfill (int y, int x, uint32_t rgba) const NOEXCEPT_MAYBE
 
bool geom (const struct ncvisual_options *vopts, ncvgeom *geom) const NOEXCEPT_MAYBE
 
bool at (int y, int x, uint32_t *pixel) const
 
bool set (int y, int x, uint32_t pixel) const NOEXCEPT_MAYBE
 
- Public Member Functions inherited from Root
notcursesget_notcurses () const
 
NotCursesget_notcurses_cpp () const
 

Additional Inherited Members

- Protected Member Functions inherited from Root
 Root (NotCurses *ncinst)
 
bool is_notcurses_stopped () const noexcept
 
- Static Protected Member Functions inherited from Root
template<typename TRet = bool, typename TValue = int>
static TRet error_guard (TValue ret, TValue error_value)
 
template<typename TRet = bool, typename TValue = int>
static TRet error_guard_cond (TValue ret, bool error_value)
 
- Static Protected Attributes inherited from Root
static constexpr char ncpp_invalid_state_message [] = "notcurses++ is in an invalid state (already stopped?)"
 

Detailed Description

Definition at line 16 of file Visual.hh.

Constructor & Destructor Documentation

◆ Visual() [1/3]

Visual ( const char file)
inlineexplicit

Definition at line 19 of file Visual.hh.

21 {
22 visual = ncvisual_from_file (file);
23 if (visual == nullptr)
24 throw init_error ("Notcurses failed to create a new visual");
25 }
static NotCurses & get_instance()
Definition NotCurses.hh:49
Root(NotCurses *ncinst)
Definition Root.hh:34
static TRet error_guard(TValue ret, TValue error_value)
Definition Root.hh:39
ncvisual * ncvisual_from_file(const char *filename)
Definition visual.c:53
Here is the call graph for this function:

◆ Visual() [2/3]

Visual ( const uint32_t rgba,
int  rows,
int  rowstride,
int  cols 
)
inlineexplicit

Definition at line 27 of file Visual.hh.

29 {
30 visual = ncvisual_from_rgba (rgba, rows, rowstride, cols);
31 if (visual == nullptr)
32 throw init_error ("Notcurses failed to create a new visual");
33 }
ncvisual * ncvisual_from_rgba(const void *rgba, int rows, int rowstride, int cols)
Definition visual.c:776
Here is the call graph for this function:

◆ Visual() [3/3]

Visual ( const Plane p,
ncblitter_e  blit,
unsigned  begy,
unsigned  begx,
unsigned  leny,
unsigned  lenx 
)
inlineexplicit

Definition at line 35 of file Visual.hh.

37 {
38 visual = ncvisual_from_plane (p, blit, begy, begx, leny, lenx);
39 if (visual == nullptr)
40 throw init_error ("Notcurses failed to create a new visual");
41 }
ncplane * blit(const ncvisual_options *vopts) const NOEXCEPT_MAYBE
Definition Visual.hh:69
ncvisual * ncvisual_from_plane(const ncplane *n, ncblitter_e blit, int begy, int begx, unsigned leny, unsigned lenx)
Definition visual.c:1208
Here is the call graph for this function:

◆ ~Visual()

~Visual ( )
inlinenoexcept

Definition at line 43 of file Visual.hh.

44 {
46 ncvisual_destroy (visual);
47 }
bool is_notcurses_stopped() const noexcept
void ncvisual_destroy(ncvisual *ncv)
Definition visual.c:1225
Here is the call graph for this function:

Member Function Documentation

◆ at()

bool at ( int  y,
int  x,
uint32_t pixel 
) const
inline

Definition at line 104 of file Visual.hh.

105 {
106 if (pixel == nullptr)
107 throw invalid_argument ("'pixel' must be a valid pointer");
108
109 return error_guard (ncvisual_at_yx (visual, y, x, pixel), -1);
110 }
int y
Definition notcurses.h:1905
int int x
Definition notcurses.h:1905
int ncvisual_at_yx(const ncvisual *n, unsigned y, unsigned x, uint32_t *pixel)
Definition visual.c:1272
Here is the call graph for this function:

◆ blit()

ncplane * blit ( const ncvisual_options vopts) const
inline

Definition at line 69 of file Visual.hh.

70 {
72 }
notcurses * get_notcurses() const
const struct ncplane_options struct ncvisual struct ncvisual_options * vopts
Definition notcurses.h:3484
ncplane * ncvisual_blit(notcurses *nc, ncvisual *ncv, const struct ncvisual_options *vopts)
Definition visual.c:1136
Here is the call graph for this function:

◆ decode()

int decode ( ) const
inlinenoexcept

Definition at line 59 of file Visual.hh.

60 {
61 return ncvisual_decode (visual);
62 }
int ncvisual_decode(ncvisual *nc)
Definition visual.c:39
Here is the call graph for this function:

◆ decode_loop()

int decode_loop ( ) const
inlinenoexcept

Definition at line 64 of file Visual.hh.

65 {
66 return ncvisual_decode_loop (visual);
67 }
int ncvisual_decode_loop(ncvisual *nc)
Definition visual.c:46
Here is the call graph for this function:

◆ geom()

bool geom ( const struct ncvisual_options vopts,
ncvgeom geom 
) const
inline

Definition at line 99 of file Visual.hh.

100 {
101 return error_guard (ncvisual_geom (get_notcurses (), visual, vopts, geom), -1);
102 }
bool geom(const struct ncvisual_options *vopts, ncvgeom *geom) const NOEXCEPT_MAYBE
Definition Visual.hh:99
int ncvisual_geom(const notcurses *nc, const ncvisual *n, const struct ncvisual_options *vopts, ncvgeom *geom)
Definition visual.c:452
Here is the call graph for this function:

◆ operator ncvisual *()

operator ncvisual * ( ) const
inlinenoexcept

Definition at line 49 of file Visual.hh.

50 {
51 return visual;
52 }

◆ operator ncvisual const *()

operator ncvisual const * ( ) const
inlinenoexcept

Definition at line 54 of file Visual.hh.

55 {
56 return visual;
57 }

◆ polyfill()

int polyfill ( int  y,
int  x,
uint32_t  rgba 
) const
inline

Definition at line 94 of file Visual.hh.

95 {
96 return error_guard<int> (ncvisual_polyfill_yx (visual, y, x, rgba), -1);
97 }
int ncvisual_polyfill_yx(ncvisual *n, unsigned y, unsigned x, uint32_t rgba)
Definition visual.c:1344
Here is the call graph for this function:

◆ rotate()

bool rotate ( double  rads) const
inline

Definition at line 84 of file Visual.hh.

85 {
86 return error_guard (ncvisual_rotate (visual, rads), -1);
87 }
int ncvisual_rotate(ncvisual *ncv, double rads)
Definition visual.c:704
Here is the call graph for this function:

◆ set()

bool set ( int  y,
int  x,
uint32_t  pixel 
) const
inline

Definition at line 112 of file Visual.hh.

113 {
114 return error_guard (ncvisual_set_yx (visual, y, x, pixel), -1);
115 }
int ncvisual_set_yx(const struct ncvisual *n, unsigned y, unsigned x, uint32_t pixel)
Definition visual.c:1259
Here is the call graph for this function:

◆ simple_streamer()

bool simple_streamer ( ncvisual_options vopts,
const timespec tspec,
void curry = nullptr 
) const
inline

Definition at line 89 of file Visual.hh.

90 {
91 return error_guard (ncvisual_simple_streamer (visual, vopts, tspec, curry), -1);
92 }
int ncvisual_simple_streamer(ncvisual *ncv, struct ncvisual_options *vopts, const struct timespec *tspec, void *curry)
Definition visual.c:1238
Here is the call graph for this function:

◆ stream()

int stream ( const ncvisual_options vopts,
float  timescale,
ncstreamcb  streamer,
void curry = nullptr 
) const
inline

Definition at line 74 of file Visual.hh.

75 {
76 return error_guard<int> (ncvisual_stream (get_notcurses (), visual, timescale, streamer, vopts, curry), -1);
77 }
int ncvisual_stream(notcurses *nc, ncvisual *ncv, float timescale, ncstreamcb streamer, const struct ncvisual_options *vopts, void *curry)
Definition visual.c:64
Here is the call graph for this function:

◆ subtitle()

ncplane * subtitle ( Plane parent)
inlinenoexcept

Definition at line 79 of file Visual.hh.

80 {
81 return ncvisual_subtitle_plane (parent, visual);
82 }
ncplane * ncvisual_subtitle_plane(ncplane *parent, const ncvisual *ncv)
Definition visual.c:77
Here is the call graph for this function:

The documentation for this class was generated from the following file: