Commit Graph

256 Commits

Author SHA1 Message Date
nick black
85f042c644
add selector to README #302 2020-01-31 17:33:47 -05:00
nick black
d30df23f43
selector: support non-zero default idx #302 2020-01-30 22:42:25 -05:00
nick black
09d2e35372 C++ wrappers: kill Visual::destroy_plane() #299
ncvisual_destroy() already calls ncplane_destroy() when
appropriate. There's never a need for the C++ wrappers
to explicitly free the Visual's underlying Plane. With
this change, valgrind no longer complains upon exiting
notcurses-view(1).
2020-01-30 22:17:07 -05:00
nick black
a57f0f234c
selector styling 2020-01-30 22:16:03 -05:00
nick black
3991b3e53a
selector: implement maxdisplay. unit tests! 2020-01-30 19:37:21 -05:00
nick black
ac2b951fa9
ncselector_selected(), unit tests 2020-01-30 16:40:02 -05:00
Nick Black
da0283ac25
Selector widget #166, subtitles #95 (#301)
Get rid of annoying empty line in notcurses-view (and ncvisuals at offsets in general)
Implement most of the Selector widget. Need to add styling and scrolling still. #166
Reenable ubuntu focal build
Subtitles! We decode them, and display them in notcurses-view. If ncvisual_simple_streamer() is provided an extra ncplane, it will use it to display subtitles. #95
We now build Python by default, as things are working much better.
ncplane_set_base() now takes channel, attrword, and EGC, so you can usually avoid having to set up and release a cell. ncplane_set_base_cell() takes over duty from ncplane_set_base() for ease of conversion.
notcurses-demo and notcurses-view now both accept a 0 for delay multiplier, meaning 'go as fast as you possibly can'. Very small multipliers (e.g. 0.00001) no longer cause floating point exceptions.
fading routines no longer cause floating point exceptions on very small timescales.
2020-01-30 08:55:01 -05:00
Marek Habersack
cd6d1e16d1 Properly clean up when NotCurses instance is destructed
We need to set `_instance` to `nullptr` or we'll leave a dangling
pointer.
2020-01-27 02:18:05 -05:00
nick black
1fd0563093
Direct mode with its own type #77
Introduce the new type 'ncdirect', a stripped-down 'notcurses'
suitable for inline modification of regular output. Used the new
type because otherwise there were going to be if(directmode) checks
everywhere. Direct mode encompasses only colorizing and styling.
Add new man page notcurses_directmode(3). Add new section to README.
Add new PoC using direct mode RGB. Update demo table summary to use
direct mode.
2020-01-25 01:13:04 -05:00
nick black
3d4e157af6 direct-mode coloring #77 2020-01-24 04:06:41 -05:00
nick black
2ea10d4b28 Remove clear_screen_start option
As it turns out, we can't portably load the initial terminal contents
(there are some hacks of various EXTREME nature, but none of them are
worth it for the rather limited benefit). The O(1)-time damage
inference requires knowledge of what was previously present to
inibit unnecessary draws. We would then need some special cell value
indicating "not yet written to" to distinguish a purposeful null
cell from an initial cell. Again, we could do this, but for what value?

Finally, the idea of clearing new area on SIGWINCH was always flawed,
as we can't do that from a signal handler.

With the advent of direct mode #77, the reason for this largely goes
away in any case.
2020-01-24 04:06:41 -05:00
nick black
55699c6a3c
render summary: autoscale all times 2020-01-22 08:28:56 -05:00
Marek Habersack
75a90461dd Add C++ bindings 2020-01-22 06:47:43 -05:00
nick black
be3a53f3cf
input: function key defs through kf59 2020-01-20 00:00:09 -05:00
nick black
507c3e1d00
expunge wayward fragment of comment 2020-01-19 15:15:42 -05:00
nick black
4ece4a9075
demo: skip demos which we don't have support for 2020-01-19 06:09:59 -05:00
Nick Black
3d612aebcb
ruins color cycling demo #253 (#287)
* palette_set: update pal256 damage map #230
* drone: use newest builders
* palette: send oc on exit for color reset #285
* palette_new: copy existing palette in #230
* Python: use checkRGB everywhere
* more palette unit testing
* add ncplane_set_*_palindex()
* render fg palindex #230
* palette index color is out of 1000
* jungle demo works #253
2020-01-18 20:42:29 -05:00
nick black
3e9347a339
palette color: unit test for alpha clear 2020-01-17 11:49:21 -05:00
nick black
b02acd8631
Curry a void* to fader callbacks #284 2020-01-17 09:30:53 -05:00
nick black
1b01494c79 implement ncplane_greyscale() #280 2020-01-17 08:35:28 -05:00
nick black
08f6fa0e79 implement ncplane_dup() 2020-01-17 08:35:28 -05:00
nick black
209d4f41f4 palette: add necessary predicates #230 2020-01-17 08:35:28 -05:00
nick black
0e70304596 palette indexing: set up attributes #230 2020-01-17 08:35:28 -05:00
nick black
6365fc0917 encode palette index into channels/attr #230 2020-01-17 08:35:28 -05:00
nick black
684bcdcc8c introduce palette256 #230 2020-01-17 08:35:28 -05:00
nick black
67b5a20758 implement ncplane_putwc_yx() 2020-01-15 04:50:54 -05:00
nick black
dd7f8eff4b
ncvisual_stream: add timescale param 2020-01-14 15:50:17 -05:00
nick black
23b5078ed1
pulsing text declarations 2020-01-14 01:09:26 -05:00
nick black
56a54b5441
break apart render/rasterize #155 2020-01-12 23:01:03 -05:00
nick black
2ebc3e2bfe blend: conditionally blend in alpha 2020-01-12 07:46:38 -05:00
nick black
3faffaa847 channels_blend() : don't blend in wide status #260 2020-01-12 07:46:38 -05:00
nick black
922c639355 cell: add clipped 2020-01-12 07:46:38 -05:00
nick black
0f60af347d add clipped set functions 2020-01-12 07:46:38 -05:00
nick black
306045116f API: always call complex from static simple 2020-01-07 16:15:27 -05:00
nick black
acef43c759
avcodec_parameters_to_context() #215 2020-01-07 09:30:50 -05:00
Nick Black
f5c6297902
Chun Li demo (#251)
* chun li demo
* ncvisual_decode: allow multiple renders of the same frame
* add -H to notcurses-demo man page
* update section 1 man page versions
2020-01-04 07:21:54 -05:00
nick black
5dd90f3735 add ncplane_dim_[yx] quick accessors 2020-01-04 04:34:29 -05:00
Nick Black
f6975d11d5
Docs/API sweep for 1.0.0 #244 #249 (#250)
* sync up some docs #244
* sync README and man page
* notcurses_output() man page work
* pull attr/channels from output functions #244
* witherworm: clean up explicit moves #244
* still more man page work
* notcurses_lines, last of the man pages i think
* panelreel man page #244
* debian: ruby-ronn->pandoc
* debian: full multiarch compliance
* debian: symbols file
* pandoc: fix syntax for lexgrog
* fm6.mkv: strip audio
* pandoc: fix up apropos man syntax #249
* ncurses_lines man page
2020-01-04 02:37:55 -05:00
nick black
2ada135fc2
add ncplane_resize_simple() 2020-01-03 21:37:06 -05:00
nick black
0de1856e38 accept a loglevel for libav 2020-01-03 05:51:27 -05:00
Nick Black
2fbc94e41c
Higher planes obliterate bisected wide glyphs #158 (#243)
* higher planes stomp wide glyphs
* broken unit test
* develop out widestomp PoC
* fix notcurses_at_yx()
* fix up dig_visible_cell() return value
* refuse wide glyph on last column #242
* set adjacent cell wide when rendering #158
* xray: eliminate weird color flicker
* witherworm: don't eat wide glyphs
* unit test for boxed glyph
* uniblock: no need to emit so many U+200Es
* witherworm: remove wide glyph hack
2020-01-01 06:41:19 -05:00
nick black
35aa7f6e85
move cell_egc_copy() to internal.h 2019-12-31 21:29:57 -05:00
nick black
e81e58035e
notcurses_at_yx() added 2019-12-31 20:51:20 -05:00
nick black
2ea4f77875
introduce ncplane_aligned() #237 2019-12-30 02:28:40 -05:00
nick black
ed980f1059 pull _get from all accessors 2019-12-30 01:10:10 -05:00
nick black
014afa348b rename ncplane default -> base #236 2019-12-30 01:10:10 -05:00
nick black
c21a04137c curry a void* through ncvisual_stream #113 2019-12-29 23:28:14 -05:00
nick black
db8b99d594
notcurses_render: simplify using new alpha rules 2019-12-29 19:37:24 -05:00
nick black
924d80f0d5
don't blend default colors #235 2019-12-29 17:49:38 -05:00
nick black
46b1b8e622
notcurses_stats man page #213 2019-12-29 03:24:32 -05:00
nick black
663e7e2eef
setting default also sets opaque #235 2019-12-29 02:13:28 -05:00
nick black
daad1c7ea3
more man pages (#213) 2019-12-28 21:02:54 -05:00
nick black
7c5a13e7ac
notcurses_init(3) man page #213 2019-12-28 19:58:05 -05:00
nick black
21c3861804
s/bannner/banner/g, heh 2019-12-28 18:37:44 -05:00
nick black
e9890eefc0 general foreground elision #131 2019-12-27 20:27:12 -05:00
nick black
5b322add56 glyph-based background spec elision #131
When we emit a glyph that has no background pixels (i.e.
the U+2588 FULL BLOCK glyph), there's no need to emit a
background color change.

Eagle demo currently has hand-coded elision. Results from
80x70 runs using the `-c` parameter:

No optimization: 12.63MiB
Hand-optimized: 12.48MiB
New scheme, no hand-coded optimization: 12.45MiB

w00t!
2019-12-27 20:27:12 -05:00
nick black
132793211c
capabilities testing for fade/ffmpeg 2019-12-27 05:13:29 -05:00
nick black
f1453d106e freebsd: fix attribute ordering 2019-12-27 02:48:13 -05:00
nick black
bd034c983a input: handle modifiers+mouse (alt, shift, ctrl) #226 2019-12-27 02:48:13 -05:00
nick black
fb0e03fe89 UMOK: fadecb for faders #162 2019-12-27 02:48:13 -05:00
Nick Black
63ada9289c
Implement CELL_ALPHA_BLEND, improve transparency semantics #191 (#219)
* channels_blend() introduced
* implement CELL_ALPHA_BLEND #191
* maxcolor demo: slidingpanel
* much improved transparency semantics #191
* maxcolor: show all transparencies #191
2019-12-25 06:36:35 -05:00
nick black
cb2bf16a73 support building sans ffmpeg #153 2019-12-25 02:24:10 -05:00
nick black
452e1d302e
output API enhancements #210 #209
Allow -1 in move specification to remain where we are on that
axis (#210), necessary for context-sensitive aligned output.
Add _aligned forms to printf and vprintf. Invert various output
functions so that simpler form is static inline wrapper around
more complicated form, rather than complicated form being a
static inline composition, facilitating atomic move+output. All
output forms now have a simple form (no alignment, placement at
cursor), an _aligned() form, and a _yx() form.
2019-12-23 23:12:29 -05:00
nick black
f742676aee Mouse support using button event tracking #165
Request and parse up mouse messages. We handle up to 11 mouse
buttons, 3 modifiers (currently thrown away), motion while
holding down a button, and loss/gain of focus. I've added twelve
new NCKEYs: one for each button, and one for release. In addition,
I've introduced the 'ncinput' struct, which encodes the nckey plus
extra data. The only extra data thus far is coordinates for mouse
events. It is not necessary to provide a ncinput to all input
functions; NULL can be provided if the caller doesn't care about
details. All demos are updated. notcurses-input has been updated
to decode full information of returned ncinputs.

The primary resource for this work was Dickey at al's "XTerm Control
Sequences", https://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
2019-12-23 19:08:12 -05:00
nick black
aceda89261 input: add NCKEY_MOUSEEVENT, match against CSI prefix #165 2019-12-23 19:08:12 -05:00
nick black
fc17a104b4
notcurses_options: clear screen on start 2019-12-23 03:36:37 -05:00
nick black
ab47ab8976
notcurses_mouse_on()/_off() #165 2019-12-23 02:47:34 -05:00
Nick Black
3ad2124246
Partial visual renders #170 (#193)
* ncvisual_render() accept four bounding dims #175
* ncvisual_render(): partial renders #175
2019-12-21 16:02:27 -05:00
Nick Black
0e0925a84e
Planereel exploration app, panelreel logic fixes (#188)
* planereels tester #180
* suppress_banner in all tests
* tabletcb: start passing back tablet
* properly initialize fbbytes stat
* panelreel: logic fixes #178
* install all testing data
2019-12-20 20:38:13 -05:00
nick black
3f326ee0a8 fix up ncplane_set_{bf}g 2019-12-20 09:42:41 -05:00
nick black
6a9d6fa122
add ncplane_printf_yx() 2019-12-20 04:12:30 -05:00
nick black
5bec85746d
allow banners to be suppressed 2019-12-20 00:34:21 -05:00
nick black
32e9fd0a1d
notcurses_reset_stats() added + test #164 2019-12-20 00:05:03 -05:00
nick black
d6bcb3211f eagles level starts at lower-right 2019-12-19 22:20:18 -05:00
nick black
0861b96bde wchar_t -> char32_t in input stack #171 2019-12-19 22:20:18 -05:00
nick black
3cfe88ee0c ncscale_e enumeration for ncvisuals #168 2019-12-19 22:20:18 -05:00
nick black
94722c0f28
Merge branch 'master' of github.com:dankamongmen/notcurses 2019-12-18 11:06:21 -05:00
nick black
ddfd5219ed
notcurses_getc() needs return wchar_t #161 2019-12-18 11:06:16 -05:00
Nick Black
957549105b
Wide character rigor (#117) (#157)
* unidamage PoC
* add cell_load_simple()
* clear CELL_WIDEASIAN_MASK in cell_load()
* split out render code
* add CELL_SIMPLE_INITIALIZER
* widecolor: fix message plane
* widecolor: simplify color increments
* document wide character handling
* unit tests for wide obliteration #117
* widechar obliteration hardening #117
* widecolor -> widechomper, update man page
2019-12-18 04:38:43 -05:00
nick black
040607c6f9
fix up linear interpolations 2019-12-18 00:07:11 -05:00
Nick Black
dfc7623119
Implement notcurses_refresh() #150 (#156)
* boxdemo: clean up colors
* Fix crash on certain resizes due to corruption of damage map #152
* Rewrite ncplane_move_yx(), throwing out ~25 line of code
* implement notcurses_refresh() #150
2019-12-17 23:07:21 -05:00
nick black
c5acdaaef0 don't allow moving a plane above/below itself #71 2019-12-16 21:31:18 -05:00
nick black
dac4f78ee6 basic unit tests for z-axis #71 2019-12-16 21:31:18 -05:00
Nick Black
2de07f8a48
Per-line damage map, ~50% increase in FPS on notcurses-demo (#144)
Implement a fairly conservative, line-granularity, two-level damage map. One on the overall notcurses object is dirtied by planar moves, creations, deletions, and resizes. One on each ncplane is dirtied by glyph output, media rendering, fades, and erasure. #83 This has some definite false positives: a hidden plane which moves will damage a bunch of lines unnecessarily. For now, don't do things like that :D.

Extra byte per line per plane, shouldn't be a problem.

Two new stats for cell elisions and emissions

Allow keypress to interrupt view-demo

ncvisual_stream() now allows a callback per frame

Allow ncvisual_open() to create its own, perfectly-sized, ncplane #128

Typical performance prior to this PR:

4655 renders, 18.3s total (0.000305s min, 0.196s max, 0.0039s avg 253.9 fps)
401046.505KB total (9.688KB min, 139.697KB max, 86.15KB avg)
Emits/elides: def 1082115/116196 fg 10547624/7236460 bg 10602717/6208644
 Elide rates: 9.70% 40.69% 36.93%
4680 renders, 18.4s total (0.000285s min, 0.15s max, 0.0039s avg 255.0 fps)
403078.188KB total (9.688KB min, 139.697KB max, 86.13KB avg)
Emits/elides: def 1088994/116196 fg 10604983/7267750 bg 10655426/6237472
 Elide rates: 9.64% 40.66% 36.92%
4699 renders, 17.8s total (0.000227s min, 0.192s max, 0.0038s avg 263.8 fps)
403266.907KB total (9.688KB min, 139.697KB max, 85.82KB avg)
Emits/elides: def 1086511/116196 fg 10601709/7359116 bg 10661910/6326744
 Elide rates: 9.66% 40.97% 37.24%

After this PR:

5625 renders, 15s total (9.36e-05s min, 0.187s max, 0.0027s avg 375.2 fps)
168365.640KB total (0.930KB min, 139.600KB max, 29.93KB avg)
Emits/elides: def 310575/116196 fg 4486002/4473416 bg 4116835/4630666
 Elide rates: 27.23% 49.93% 52.94%
Cells emitted; 9928000 elided: 12572000 (55.88%)
5642 renders, 14.2s total (9.17e-05s min, 0.154s max, 0.0025s avg 397.0 fps)
168669.009KB total (0.605KB min, 139.600KB max, 29.90KB avg)
Emits/elides: def 310819/116196 fg 4499833/4482134 bg 4118562/4652470
 Elide rates: 27.21% 49.90% 53.04%
Cells emitted; 9962160 elided: 12605840 (55.86%)
5650 renders, 14.3s total (0.000118s min, 0.143s max, 0.0025s avg 395.7 fps)
169461.884KB total (0.860KB min, 139.600KB max, 29.99KB avg)
Emits/elides: def 305431/116196 fg 4515396/4456376 bg 4149967/4613668
 Elide rates: 27.56% 49.67% 52.65%
Cells emitted; 9945200 elided: 12654800 (55.99%)

on netcurses-demo, we're eliding about half of the total cells via this damage map. that's pretty fucking sweet! FPS increase of about 50% -- I'll take that any day of the fuckin' week, boyo. w00t!

https://www.youtube.com/watch?v=XbGs_qK2PQA
2019-12-15 13:46:47 -05:00
nick black
8bd4607e9b
Merge branch 'master' of github.com:dankamongmen/notcurses 2019-12-15 05:22:19 -05:00
nick black
f374682134
panelreel: add tablet curry accessors 2019-12-15 05:22:12 -05:00
nick black
4ea62e3c67
input: handle function keys through f30 2019-12-15 02:18:54 -05:00
nick black
364db519bb
stop shifting style bits stupidly 2019-12-15 02:06:18 -05:00
nick black
26c575a262
spelling 2019-12-14 18:39:56 -05:00
nick black
3b2f72538e
decode more special keys in notcurses-input #134 2019-12-14 18:37:09 -05:00
nick black
c9b6f84dec
fix up default elision in alpha channels #143 2019-12-14 17:59:39 -05:00
Nick Black
8bd8055f72
Distinct fg/bg alpha channels #139 (#141)
* improved alpha macros
* demo: use new alpha macros
* add ncplane_set_*_alpha()
* explicitly set fg for uniblock
* outro: background is a space #139
* distinct alpha channels for fg/bg #139
* rename 'background' cell to 'default' #142
* doc palette fades
2019-12-14 17:34:10 -05:00
nick black
4ad1321dce
remove double-define from README 2019-12-14 07:11:26 -05:00
nick black
89b6af2166
docs docs docs, all day long 2019-12-14 07:04:43 -05:00
Nick Black
ff463d464e
Channels API sanity #119 (#138)
* orthogonalize channel/channels/cells APIs #119
* sync README.md with new ncplane channels api #119
2019-12-14 05:33:34 -05:00
nick black
88163325fa
widecolor: proceed without keypress #135 2019-12-13 20:10:39 -05:00
nick black
a1c90a347a
add ncplane_box() corner masking 2019-12-13 19:40:22 -05:00
nick black
71a2660b57
fatal_handler: grab ABRT as well 2019-12-13 19:18:24 -05:00
nick black
e6d35978d4
add notcurses_refresh() declaration 2019-12-13 18:02:35 -05:00
nick black
18a33a0328
handle still more key sequences #134 2019-12-13 17:18:54 -05:00