Commit Graph

339 Commits (b2dcc50606a7ec217cd9e22bd27a22272ffea39e)

Author SHA1 Message Date
nick black 87136c37d3
flesh out two more Wide+Narrow tests #475 4 years ago
nick black 05cdd1514b pull in PlaneStompsWideGlyph from render.cc 4 years ago
nick black 1c41705d99 flesh out NarrowPlaneAtopWide unit test #475 4 years ago
nick black 295ae0a8d0
extract wide glyph unit tests into their own file #475 4 years ago
nick black b0fc654444 Check that cell is not wide right in render #362 4 years ago
nick black b0aa6b9a7f simplify wide handling in putc_yx #362 4 years ago
nick black e6a80ab98d Strip down OverWide unit test 4 years ago
nick black d26b111f35 new unit test Ncplane::OverWide #362 4 years ago
nick black e005940acf
ncplot: fix unit tests following #457 (#464) 4 years ago
Nick Black c2a645e9af
Rust wrapper work (#454)
* packaging: s/libtinfo/Terminfo/g
* rust: add stddim_yx()
* rust: check for valid init in unit tests
* rust: serialize up tests
* constify notcurses_term_dim_yx()
* rust: add dim wrappers
* remove notcurses_resize() from public API #367
* call notcurses_resize() from notcurses_refresh() #367
4 years ago
nick black a7f17040ce another scrolling unit test 4 years ago
nick black 601e84df83 another scrolling unit test #323 4 years ago
nick black 0f12bcdb4c add 2 scrolling unit tests, both currently fail #323 4 years ago
nick black c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439 4 years ago
nick black 6b74ea7718 plot: fix off-by-one on wide window shift, asdd unit test 4 years ago
nick black fc2dc68619 AugmentCycle2 Unit Test #430 4 years ago
nick black a3f7dd486b plot: AugmentSample5 test case 4 years ago
nick black 5bccf6b446 ncplot: implement x windowing #430 4 years ago
nick black b3cda0d09f notcurses-keyplot: throw a perimeter around base plane 4 years ago
nick black d2fe768c30 plot unit tests #430 4 years ago
nick black e87fbb3003 Throw up an ncplot unit test 4 years ago
nick black a45d888601
All fill-type functions return cells changed
Fill-type functions used to return 0 for success, and -1
on failure. They now return the number of cells written
on success, similarly to ncvisual_render(). Resolves #427.
4 years ago
nick black a3323fb22c
Enforce UTF8 where necessary in unit tests #428
Certain unit tests required UTF8 encoding on the output
terminal to work (#428). This includes anything which does
any kind of fill. Add enforce_utf8() checks to all such
tests that were missing them. Unit tests once again pass in
a pure ASCII environment.
4 years ago
nick black a77774f4dc
notcurses_at_yx(): value-result u32+u64, not cell
Resolves #410. notcurses_at_yx() accepted a cell*, but the
gcluster of this cell was always set to 0. The EGC is instead
a heap-allocated copy, returned as the primary return value.
This is due to the absence of an egcpool to bind against.
Existing callers can be converted thus:

* instead of passing cell 'c', pass &(c)->attrword, &(c)->channels
* either initialize 'c' with CELL_TRIVIAL_INITIALIZER, or set its
   gcluster field to 0 following the call

I've updated all calls from tests/demos, updated the docs, and
updated the C++ and Python wrappers.
4 years ago
nick black 73b61f6a69 Add bound planes (#71) plus docs/tests
Add ncplane_bound(3). This allows a new plane N to be created in the
*bound* state relative to another ncplane B. If B moves, N moves the
same amount. If N is moved, the coordinates are taken relative to B
as opposed to the standard plane. If B is destroyed, N is destroyed.
Each plane can have many planes bound to it, but can only be bound to
a single plane. Add ncplane_reparent(3). This allows a plane to be
detached from any plane to which it is bound, and optionally rebound
to a new plane. The standard plane cannot be reparented.
Documentation and unit tests have been added for both.
4 years ago
nick black ae1421db15
ncvisual_render() API change/documentation #422
ncvisual_render() now returns the number of cells emitted
rather than just 0/-1. -1 is still returned on failure.
Rather than 0 for length meaning "all possible length", it
now means 0, and -1 means "all possible length". All demos,
tests, and PoCs have been updated. #422
4 years ago
Nick Black 2b7b384e91
Most of notcurses-tetris, mergedown fixes (#420)
* ncplane_mergedown() fix for small planes #417
* tetris game needed for the book
4 years ago
nick black c3feca6ded ncplane_polyfill: reject null glyph + test #418 4 years ago
nick black 7e71ad8e11 implement ncplane_mergedown() #361 4 years ago
nick black eead4c1414
notcurses_highgradient() added #398 4 years ago
Nick Black 4e58747709
ncplane_rotate_cw() and ncplane_rotate_ccw() (#396)
Introduce limited plane rotation capability. We currently support clockwise and counterclockwise rotation of planes. Square and rectangular geometries are both supported, but there must be an even number of columns. The atomic unit of rotation is a 2x1 "square" (this assumes .5 cell aspect ratio). We can only rotate those glyphs which have rotated equivalents, and not even all of those. We currently handle only:

* null glyph
* space
* upper half block
* lower half block
* full block

I've added unit tests as well. This functionality is used by our Tetris example in the book
4 years ago
nick black 3498956370
ncplane_mouseevent_p()->ncplane_translate_abs()
ncplane_mouseevent_p() is retired--it was poorly named, and
ncplane_translate_abs() does what it does, plus more, plus
more generally (it works on any y, x, not necessarily an
ncinput). update c++ wrappers #394.
4 years ago
nick black bb579d0d05
notcurses_directmode()->ncdirect_init() 4 years ago
nick black 5b4c6c14e3
gradient: implement + test 1d fills 4 years ago
nick black 40428fd05e
Cell: non-OPAQUE always sets non-default bit 4 years ago
nick black 9b0603bb32
Implement + test ncplane_mouseevent_p() #305 4 years ago
Nick Black 745e742a12
Fix gradient engine #368 (#372)
Simplify and correct the gradient engine, resolving all test breakage.
4 years ago
nick black 002e8be574
implement ncplane_format() #347 4 years ago
nick black 35d850f008
Implement + test ncplane_putegc_stainable() #352 4 years ago
Nick Black e6637e81cc
Prep for serious rusting #101 (#354)
* CMake: add USE_PANDOC, USE_DOXYGEN options #101
* README: mention rust
* start integrating rust into build #101
* CMake: add USE_NETWORK option for cargo
* Debian: build-dep on doxygen
* rust: colloquy checks in Cargo.lock
* extract NCKEY defines into their own include
* colloquy: use clap to parse CLI args
* CMake: unify option namespace
* Python: update include path
* Rust: fix up --frozen workings for -DUSE_NETWORK=off
* CMake: abstract out colloquy a little
* Sync direct.hh to the New Way
4 years ago
nick black 39d5063518
Yank out our copy of doctest, use system copy 4 years ago
nick black 438ee1257b
remove doctest, rely on system 4 years ago
nick black 2114cc2eda demo: rewrite handloop with ncplane_gradient() 4 years ago
nick black 7addd06341 more gradient work, more unit tests #340 4 years ago
nick black 61fe5f5b7e gradient + unit test #340 4 years ago
nick black c6520ab84c add notcurses_drop_planes, use from demo #346 4 years ago
nick black 124004c87c add nplane_polyfill_yx() #340 4 years ago
nick black 9fc53e811f
ncplane_perimeter() plus unit test 4 years ago
nick black d8c42d4d1e
ncmenu_selected() fills in an ncinput #333 4 years ago
nick black 08bef99244
Debian: remove comments from watch file 4 years ago
nick black 74b9690cf3
ncmenu: remove dumb restrictions/special casing 4 years ago
nick black 71dbfd74f7 ncmenu: step around alignment NULL #332 4 years ago
nick black b7a92e0321
notcurses-tester(1) man page #326 4 years ago
nick black 0a6fddb549
blend test: fix uninitialized var 4 years ago
nick black 01d160f40b
menu test: work with older Clang 4 years ago
nick black 8d7e6482dd
test: use utf-8 rather than unicode literal 4 years ago
nick black 736717f58b
DFSG: unit test using only free multimedia #326 4 years ago
nick black 3cdac5ce28 high-contrast text, simple linear average model #181 4 years ago
nick black 85e377e652
Accept US-ASCII/C encoding, with warning. 4 years ago
nick black 74775b97ec
enmetric->ncmetric #324 4 years ago
nick black 89f516dcaa
tablet->nctablet, add ncreel to python #324 4 years ago
nick black c519c95fff
panelreel -> ncreel #324 4 years ago
nick black b284901d18
prep for 1.1.6 4 years ago
nick black 4d613217b3
ncmenu: only allow one at a time 4 years ago
nick black 10a269c963
ncmenu: reject double menu 4 years ago
nick black 039a390877
ncmenu: print item shortcut aligned right #179 4 years ago
nick black 79a92fcfb1
ncmenu: highlight shortcut keys for menu items 4 years ago
nick black 3821b66bc7
menu: highlight (bold+uline) section shortcuts 4 years ago
nick black 17c21a2c7b
menu unit test for long menu 4 years ago
nick black 5cd4fc9a1f
menu: reject empty sections #179 4 years ago
nick black 5cf1bba5f5
menu: unit test with section #179 4 years ago
nick black 31a07dab33
menu: extend across width of screen #179 4 years ago
nick black 54c57b3487 s/CELL_STYLE/NCSTYLE/ throughout 4 years ago
nick black 8984422f1e basics of menu #179 4 years ago
nick black fad612bd2f
Use column width in selector calculations #302 4 years ago
nick black 5982707f9e
add mbswidth() function, unit tests, docs 4 years ago
nick black be133b0105
unit tests for scrolling selector 4 years ago
nick black 3991b3e53a
selector: implement maxdisplay. unit tests! 4 years ago
nick black ac2b951fa9
ncselector_selected(), unit tests 4 years ago
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.
4 years ago
nick black ec5e857a6c
palette256: fix up unit tests 5 years ago
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
5 years ago
nick black 3e9347a339
palette color: unit test for alpha clear 5 years ago
nick black b02acd8631
Curry a void* to fader callbacks #284 5 years ago
nick black 08f6fa0e79 implement ncplane_dup() 5 years ago
nick black 38b2b3d075 render: fix bad reference in final pass 5 years ago
nick black 0e70304596 palette indexing: set up attributes #230 5 years ago
nick black dfcdd10cb5 more palette support/testing #230 5 years ago
nick black 684bcdcc8c introduce palette256 #230 5 years ago
Nick Black 7ec022d067
Painter's algorithm #255 (#274)
* notcursesI.avi 30 -> 60fps
* painter's algorithm works #255
5 years ago
nick black 7c687faea0
pulsing text + unit test + docs #163 5 years ago
nick black 2ebc3e2bfe blend: conditionally blend in alpha 5 years ago
nick black 309211e308
enmetric() for small values #256 5 years ago
nick black b37ea582a3
enmetric()ize total time output in demo summary 5 years ago
nick black 7e59cf1053
don't print Term line with suppress_banner 5 years ago
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
5 years ago
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
5 years ago
nick black 2ea4f77875
introduce ncplane_aligned() #237 5 years ago
nick black ed980f1059 pull _get from all accessors 5 years ago
nick black 014afa348b rename ncplane default -> base #236 5 years ago
nick black db8b99d594
notcurses_render: simplify using new alpha rules 5 years ago
nick black ca40c93d1c
properly weigh colors for blending #234 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 21c3861804
s/bannner/banner/g, heh 5 years ago
nick black 113a8f8f62 tests: fix up -p 5 years ago
nick black f024cee3a1
unittests: support -p argument #218 5 years ago
Nick Black ce2a390b52
Out with googletest, in with doctest #202 (#231)
* introduce doctest over googletest #202
* call dtester in in targets
* doctest conversion #202
* channel.cpp -> doctest #202
* egcpool tests -> doctest #202
* input tests to doctester
* zaxis -> doctest
* drone: always define LANG
* libav to doctest #202
* panelreel tests to doctest #202
* spec that a C++17 compiler is now required for doctest #202
* enmetric tests -> doctest #202
* fade tests -> doctest #202
* notcurses test case -> doctest #202
* last conversion to doctest #202
* finish move to doctest #202
* drone: set up make test
5 years ago
nick black 66057e0363
eliminate most uniglyphs from unit tests #196 5 years ago
nick black f6aebe55a7
libav: fix unit test for DISABLE_FFMPEG case 5 years ago
nick black 132793211c
capabilities testing for fade/ffmpeg 5 years ago
nick black 37a45955ad
FreeBSD: declare array explicitly 5 years ago
nick black fb0e03fe89 UMOK: fadecb for faders #162 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 1d9bf7bb59
update unit tests for ../data move 5 years ago
nick black 1de8611e2f
move test data to data/, simplify install rule 5 years ago
nick black ab47ab8976
notcurses_mouse_on()/_off() #165 5 years ago
nick black 046d0314b9
add links to useful man pages 5 years ago
nick black 2aeb303e94
samoa, mother samoa, tula'i ma sisi ia lau fu'a, lou pale lea! 5 years ago
nick black 708159c686
x-ray demo 5 years ago
nick black a710222df1
enmetric(): support localized decimal separator #192 5 years ago
nick black a3923142f6
fix up bgalpha unit tests 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 e628030740
ncvisual_render(): use true transparency #186 5 years ago
nick black 32e9fd0a1d
notcurses_reset_stats() added + test #164 5 years ago
nick black b257f40a35 sync input documentation for char32_t #172 5 years ago
nick black 6532ea858b start eagle demo #167 5 years ago
nick black 3cfe88ee0c ncscale_e enumeration for ncvisuals #168 5 years ago
nick black 97ecbdb0e5
sigh, probably gotta kill DMCA lure 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 48adc31260 unit test for z-axis rendering #146 5 years ago
nick black 599b7a6d9a z-axis unit tests #71 5 years ago
nick black dac4f78ee6 basic unit tests for z-axis #71 5 years ago
nick black 58cc6927ac 256-color cube is not ansi, don't muddy the waters 5 years ago
nick black 65858b4495 unit test 256-index quantizing #4 5 years ago
nick black a916d929db
RGBtoANSI: fixup lower grey onversions, looks reasonable now #4 5 years ago
nick black cfccd0c39c
RGBtoANSI unit test, fix up bases 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 91f74901c2
verify cell_load() of ascii results in simple #140 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 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 a1c90a347a
add ncplane_box() corner masking 5 years ago
nick black 6e49bbce45
panelreel: don't treat putc() return as bool #132 5 years ago
nick black 0001fa955d
on a wide enough screen, this test breaks 5 years ago
nick black 7c72b0ce83
emoji unit test 5 years ago
nick black 23f8a070b3
unit tests: don't try to close a NULL outfp_ 5 years ago
nick black ca2f0471c3
setlocale(LC_ALL, "") everywhere 5 years ago
nick black 1821867e35
move outfp out of notcurses_options #130 5 years ago