Commit Graph

1110 Commits (43c81ed94439017709b7fa95738ba4c13cd51def)

Author SHA1 Message Date
nick black c21a04137c curry a void* through ncvisual_stream #113 5 years ago
nick black db8b99d594
notcurses_render: simplify using new alpha rules 5 years ago
nick black 924d80f0d5
don't blend default colors #235 5 years ago
nick black 46b1b8e622
notcurses_stats man page #213 5 years ago
nick black 663e7e2eef
setting default also sets opaque #235 5 years ago
nick black daad1c7ea3
more man pages (#213) 5 years ago
nick black 7c5a13e7ac
notcurses_init(3) man page #213 5 years ago
nick black 21c3861804
s/bannner/banner/g, heh 5 years ago
nick black e9890eefc0 general foreground elision #131 5 years ago
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!
5 years ago
nick black 132793211c
capabilities testing for fade/ffmpeg 5 years ago
nick black f1453d106e freebsd: fix attribute ordering 5 years ago
nick black bd034c983a input: handle modifiers+mouse (alt, shift, ctrl) #226 5 years ago
nick black fb0e03fe89 UMOK: fadecb for faders #162 5 years ago
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
5 years ago
nick black cb2bf16a73 support building sans ffmpeg #153 5 years ago
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.
5 years ago
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.
5 years ago
nick black aceda89261 input: add NCKEY_MOUSEEVENT, match against CSI prefix #165 5 years ago
nick black fc17a104b4
notcurses_options: clear screen on start 5 years ago
nick black ab47ab8976
notcurses_mouse_on()/_off() #165 5 years ago
Nick Black 3ad2124246
Partial visual renders #170 (#193)
* ncvisual_render() accept four bounding dims #175
* ncvisual_render(): partial renders #175
5 years ago
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
5 years ago
nick black 3f326ee0a8 fix up ncplane_set_{bf}g 5 years ago
nick black 6a9d6fa122
add ncplane_printf_yx() 5 years ago
nick black 5bec85746d
allow banners to be suppressed 5 years ago
nick black 32e9fd0a1d
notcurses_reset_stats() added + test #164 5 years ago
nick black d6bcb3211f eagles level starts at lower-right 5 years ago
nick black 0861b96bde wchar_t -> char32_t in input stack #171 5 years ago
nick black 3cfe88ee0c ncscale_e enumeration for ncvisuals #168 5 years ago
nick black 94722c0f28
Merge branch 'master' of github.com:dankamongmen/notcurses 5 years ago
nick black ddfd5219ed
notcurses_getc() needs return wchar_t #161 5 years ago
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
5 years ago
nick black 040607c6f9
fix up linear interpolations 5 years ago
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
5 years ago
nick black c5acdaaef0 don't allow moving a plane above/below itself #71 5 years ago
nick black dac4f78ee6 basic unit tests for z-axis #71 5 years ago
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
5 years ago
nick black 8bd4607e9b
Merge branch 'master' of github.com:dankamongmen/notcurses 5 years ago
nick black f374682134
panelreel: add tablet curry accessors 5 years ago
nick black 4ea62e3c67
input: handle function keys through f30 5 years ago
nick black 364db519bb
stop shifting style bits stupidly 5 years ago
nick black 26c575a262
spelling 5 years ago
nick black 3b2f72538e
decode more special keys in notcurses-input #134 5 years ago
nick black c9b6f84dec
fix up default elision in alpha channels #143 5 years ago
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
5 years ago
nick black 4ad1321dce
remove double-define from README 5 years ago
nick black 89b6af2166
docs docs docs, all day long 5 years ago
Nick Black ff463d464e
Channels API sanity #119 (#138)
* orthogonalize channel/channels/cells APIs #119
* sync README.md with new ncplane channels api #119
5 years ago
nick black 88163325fa
widecolor: proceed without keypress #135 5 years ago
nick black a1c90a347a
add ncplane_box() corner masking 5 years ago
nick black 71a2660b57
fatal_handler: grab ABRT as well 5 years ago
nick black e6d35978d4
add notcurses_refresh() declaration 5 years ago
nick black 18a33a0328
handle still more key sequences #134 5 years ago
nick black e1fb283018
input: handle more sequences #134 5 years ago
nick black c2c017831f
add ncplane_get_channels() 5 years ago
nick black 1821867e35
move outfp out of notcurses_options #130 5 years ago
nick black 8de3696268
add ncplane_putwstr_aligned(), update docs #102 5 years ago
nick black de595380b6
ncplane_putstr_aligned(), use it in intro #102 5 years ago
nick black 5735e5966a
add _yx-suffixed output forms #102 5 years ago
nick black c0b10a8f32
enable sgr/sgr0 #73 5 years ago
nick black 194b76a9d3
input: update comment, no longer driven through cell 5 years ago
nick black 208077b95c
enmetric unit tests 5 years ago
nick black 8672ae3caa
update docs regarding input 5 years ago
Nick Black 0d2c43603b
Luigi in Mega Man world (#127)
* uniblock-demo: reset background to black
* warning about quantization
* some luigi love
* update cell documentation
* add unit test for move of stdplane
* MoveToLowerRight unit test
* ncplane_move_yx(): error to move stdscr
* better box permutations test
* luigi in megaman2 world
* stats: don't print 'em if we haven't got 'em
5 years ago
nick black 93231c26eb input: use SPUA-B for special keys #118 5 years ago
Nick Black 38a10d9065
Transparency via alpha channels (#122)
* outro: bevel message window's corners
* egcspool: use full 25 bits available for 32MB pools
* render: remove unused inheritance mask
* interfaces + unit tests for 2-bit alpha
* notcurses_*g_alpha() acccessors
* cell alpha + unit tests
* panelreel: support a background channel
* notcurses: transparency via alpha channel
* remove unused CELL_ALPHA_MASK
5 years ago
nick black 08859aeb29
use CELL_STYLE_SHIFT rather than bare 16u 5 years ago
nick black 756eebc060
add ncplane_putwegc() and unit test #120 5 years ago
nick black 1b1729133c
add ncplane_putwstr(), add unit test #120 5 years ago
nick black 7566af57e3
introduce ncplane_set_[fb]g 5 years ago
nick black 222889c7c6
add ncplane_*_rgb() 5 years ago
nick black 8afcd04446
sync cell/ncplane fg/bg API naming 5 years ago
nick black bacc69380a
uniblock: restore backgrounds 5 years ago
nick black 3c93030177
notcurses_*_default_prep() 5 years ago
nick black 774f8e5a23
summary: fix minima trackers 5 years ago
nick black ac845b28a4
handle function keys, insert, end/home, etc #78 5 years ago
nick black af7ca02f36 Decode input escape sequences to special keys #78
Add the necessary input buffer, non-blocking reads, escape trie,
and unit tests to support extended keys, including arrow keys.
Update notcurses-input to print Unicode Control Glyphs instead of
a blank space for control chars.
5 years ago
nick black 37b0e416c0 get everything prepped for reliable keyboard escapes #78 5 years ago
Nick Black c0a1ee0f31
Spruce up slider demo, fix up uniblock demo #66 #72 (#112)
Slider demo: paint chunks in a pattern, then shuffle them up #72
Right-to-left unit tests #66
Fix up damage to uniblock demo using cup explicit cursor move #66
5 years ago
nick black ae711b7e75 h/vline gradient unit tests #42 5 years ago
nick black a55e02836b ncplane_box: accept ctlword (#42) 5 years ago
Nick Black 6f9b1e0379
Locking #82 (#106)
* remove unused simple_gcluster_p()
* detail statistics
* add byte statistics on rendering
* lock around notcurses_render() #82
* lock nc in notcurses_putc() #82
* lock ncplane_styles() and friends #82
5 years ago
Nick Black 8e8cb92c54
Improved cell API #97 (#103)
* cell/ncplane: simplify box API (#97)
* widecolor: use new box api (#97)
* uniblock: use new box API #97
* intro: use new box api #97
* panelreel: use new box api
* boxdemo: use new box API #97
* sliding: use new box API #97
* maxcolor: use new box api #97
* factor out notcurses_channel_prep() #97
* maxcolor: use new channel API #97
* sliding: use new channel API #97
* intro: use new channel API #97
* new output functions with no need for a cell
* add ncplane_putegc() and ncplane_putsimple(). the former takes an EGC, the latter a simple char less than 0x80. (#97)
* cell_prime: directly load all parts of a cell with immediates
* widecolor: use new output API #97
* boxdemo: properly initialize cells
* slider: total time cap of 5 * delaydemo
* maxcolor: use new output API #97
5 years ago
nick black e21594b4e9
ncplane_*_box_cells() -> cells_*_box() #97 5 years ago
nick black 5554b3fccb
persist elision/emission stats, expose them in API 5 years ago
nick black 415e238b3d transparent planes #10 5 years ago
nick black 957af8151e view-demo: add video element 5 years ago
nick black 966239747c add ncplane_fadein() #40 5 years ago
nick black 02b30c822e fix cel_rgb_get[bf]b() #40 5 years ago
nick black 4426ef0574 first go at ncplane_fadeout() #40 5 years ago
Nick Black 426f632300
Panelreels port #52 (#90)
Port of panelreels, unit tests, and panelreel-demo from outcurses #52.
Doesn't completely work yet, but is surprisingly close!
5 years ago
nick black 36ed25fb46 fix cell_fg_default() and cell_bg_default() 5 years ago
nick black 28fac736bb notcurses-view: stop() before printing error
implement ncvisual_render()
5 years ago
nick black d106ebf0d3 libav: check for AVERROR_EOF #86 5 years ago
nick black 531340a145 libav: return averr to caller #86 5 years ago
nick black c2f377d599 ncplane_background()/ncplane_set_background() #69 5 years ago
nick black b993360f53 add ncplane API 5 years ago
Nick Black a7d50b557d
ncplane_at_cursor (#76), CCCflag, nonblocking stdin (#78) (#84)
* put stdin into nonblocking mode, retry on short write to stdout #78
* wrap getc_blocking() around a poll #78
* get CCCflag from terminfo. stop clearing the screen in render/startup
* implement ncplane_at_cursor() #76
* ncplane_at_cursor() unit test for simples #76
* PlaneAtCursorComplex unit test #76
* PlaneAtCursorInsane() unit test #76
* nplane_at_cursor: return number of bytes, not just 0/-1
* uniblock-demo: add a bunch of pages from Unicode 12
* demo: make -d delay multiplier a float
* egcpool: check offset against poolsize in check_validity()
* notcurses_init(): set smkx/rmkx to NULL with pass_through_esc
* PlaneAtCursorAttrs unit test #76
* add ncplane_styles() accessor
5 years ago
nick black b3c6f9232a add renderfp option to render to a file 5 years ago
nick black 8c6d0495ee
input: decode special keys, call notcurses_resize() #79 5 years ago
nick black e391bfbb81
input: add pass_through_esc option, otherwise run smkx #78 5 years ago
nick black cb60c11f09
input: factor out handle_getc(), export cell_simple_p() #8 5 years ago
nick black c76735cb2a
notcurses_getc(): read from stdin 5 years ago
nick black a037cdfe5a
add new notcurses-input binary #8 5 years ago
Nick Black 7f9ac490b0
ncplane_resize(), slider demo (#64) (#74)
* sliding: bounding box around puzzle
* slider: make moves, deleting planes #61
* implement z-index move functions
* demo: allow demos to be chosen via command-line option
* allow default bg/fg to be explicitly chosen
* ncplane_resize() unit test #64
* useful links
* slider: use random colors
* use find_above() in ncplace_destroy()
* ncplane_resize() work #64
5 years ago
nick black fe14403f9e
ncplane_double_box_cells(), used in sliding-demo #67 5 years ago
nick black 494ce69ebf export styles unshifted, fix test in cell_get_style() #11 5 years ago
nick black f65d168d83 notcurses_render(): call term_setstyles() for sgr stuff #11 5 years ago
nick black bc662e92bb notcurses_render(): add term_setstyle() #11 5 years ago
nick black 01beeb07b8 declare ncvisual_render() #61 5 years ago
nick black d5cc65715e ncplane userptr routines + unit tests #26 5 years ago
nick black 9a41257669 libavutil/libswscale versions in intro 5 years ago
nick black 5dfb07183c libav: throw an swscaler in the mix #61 5 years ago
nick black 9ed5a8b6c7 decode AVPacket into AVFrame #61 5 years ago
nick black 4b2bf26ee2 ncvisual_destroy() implemented 5 years ago
nick black 2080e0bff3 unit tests for exercised egcpool #59 5 years ago
Nick Black ba648dbd74
What a miserable evening tracking #57 (#60)
* widecolor-demo: don't emit spaces
* notcurses_init: newline before splash
* boxdemo: ncplane_erase() on entry #58
* uniblock-demo: print even wide chars #49
5 years ago
nick black ee2e16736c
signal handlers for INT, QUIT, WINCH #27 5 years ago
nick black f14ee490f2
CMake: visibility=hidden by default #56 5 years ago
nick black ccb3c137b3 add ncplane_box_sized() and ncplane_rounded_box_cells() 5 years ago
nick black 80519c92fa libav: add LoadVideo unit test #35 5 years ago
nick black f20e8fde4b add notcurses_image_open() #23 5 years ago
nick black 7aaa0fcce1
track wide char as reported by wcwidth(), add unit test #6 5 years ago
nick black 6b877f89a9
retain stdscr across a resize #28 5 years ago
nick black f67a97edfb
correctly handle ASCII + combining chars, add unit tests #36 5 years ago
nick black 095d9035fb notcurses_options: provide retain_cursor bool #29 5 years ago
nick black da607561e3 move ncplane management all together #26 5 years ago
nick black 979f6828ed
erase in grid demo 5 years ago
nick black f5a0c1920b
EGC, not wchar_t 5 years ago
nick black 27e90d9204 cell: implement fg/bgdefault bits 5 years ago
nick black 9934c1d45d declare ncplane_box() #9 5 years ago
nick black 0ae550f5d1 declare cell_release() 5 years ago
Nick Black b93bcebf0b
Extended grapheme clusters (#15)
Introduce egcpool for attached storage
Hook up style support
Switch entirely to UTF-8 char from wchar_t (#14)
Pull out next EGC in cell_load (#14)
5 years ago
nick black 0d10fdad79
spelling ugh 5 years ago
nick black affb0c120b
kill duplicate decl and obsolete FIXME 5 years ago
nick black 13931aee60
implement ncplane_getc() #9 5 years ago
nick black f9b88c5079
implement notcurses_palette_size() 5 years ago
nick black a509cb6320
someone set us up the bomb 5 years ago
nick black e4f041f522
start moving to utf-8 from wchar_t #14 5 years ago
nick black 7cb951ccc4
purge duplicate ncplane definitions 5 years ago
nick black 8856f67822
ncplane: background directcolor works 5 years ago
nick black fd04c55d16
implement ncplane_putwstr #9 5 years ago
nick black 2f9821ce39
notcurses: interrogate terminfo for styles 5 years ago
Nick Black 7e92c8bb82
documentation and declarations (#13)
ncplane: flesh out API
ncplane: line and erase APIs
README.md: document differences from ncurses
notcurses_init(): print long term name
CMake: link librt into notcurses
cell: move functionality out to header
5 years ago
nick black a8721df75a
ncplane: flesh out API 5 years ago
nick black 94c67af64d
notcurses_version: add to README 5 years ago
nick black 4fb5c9db71
readme touches 5 years ago
nick black 2dffc5ae1e
document basic use 5 years ago
nick black b94e428277 ncplane: add ncplane_putwc() 5 years ago
nick black d6aef3d2e6 notcurses_render: blit wchar_t arrays #5 5 years ago
nick black 691d3d97b8 some ncplane unit tests 5 years ago
nick black a916c66052 introduce z-buffer of ncplanes 5 years ago
nick black d3f9329737 notcurses_options: allow outfd to be specified 5 years ago
nick black 54ed3e108e introduce notcurses_options struct #3 5 years ago
nick black 0f6e19dd92
notcurses_setrgb(): plug into direct mode when RGB flag is set 5 years ago
nick black f88a26f55f
introduce notcurses_render() 5 years ago
nick black c1f4219dc1
notcurses_term_dimensions() + unit test 5 years ago
nick black 1fcae27627
just the basics 5 years ago
nick black 70df86ba17
version string, notcurses_version() 5 years ago