Commit Graph

414 Commits

Author SHA1 Message Date
nick black
dd2b36ce0a
drone: set TERM on debian 2020-06-28 07:21:22 -04:00
nick black
33667df40e
drone: set TERM for fedora 2020-06-28 07:00:20 -04:00
Nick Black
d5dca33e00 ncneofetch: don't print (null) for distro_pretty 2020-06-28 06:43:29 -04:00
Nick Black
d52ced823c make Wide unit tests sensitive to local irregularities #741 2020-06-28 06:40:00 -04:00
nick black
f927af00f2
tester: pass NCOPTION_NO_QUIT_SIGHANDLERS 2020-06-28 05:56:07 -04:00
nick black
354152b48b
Redefine CELL_ALPHA_ in their natural forms
CELL_ALPHA_OPAQUE et al were defined as 0..3, meaning
CELL_ALPHA_SHIFT had to be used to compare them to their
channel representations. Instead, define them in said
representation outright, eliminating the need to shift while
retaining arithmetic properties, and zero initialization for
CELL_ALPHA_OPAQUE. Eliminate CELL_ALPHA_SHIFT #738.
2020-06-28 01:53:42 -04:00
nick black
7ca5a7e82c
ncneofetch: create info plane #550 2020-06-17 19:39:37 -04:00
nick black
5b99ebc9fc
ncplane_puttext(): four more unit tests #691 2020-06-16 02:47:21 -04:00
nick black
6ff0bec2fa
ncplane_puttext: more unit tests, check for spcae before width #691 2020-06-16 02:42:08 -04:00
nick black
cfe764bd57
ncplane_puttext() unit test + fix #691 2020-06-16 02:12:11 -04:00
nick black
97517d0473
ncplane_puttext: another test, another bug #691 2020-06-16 01:22:40 -04:00
nick black
d1f8b9237d
ncplane_puttext: new unit test, fix breakage #691 2020-06-16 01:08:48 -04:00
nick black
2be041b1f4
Beef up ncplane_puttext() tests, fix a problem #691 2020-06-16 00:30:02 -04:00
nick black
b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 2020-06-15 23:58:43 -04:00
nick black
a46dcc5fe4
tester: introduce testing_notcurses() #718 2020-06-15 23:52:11 -04:00
nick black
64c4a4be53
unit tests: require utf8 for quadblitter 2020-06-14 17:43:18 -04:00
nick black
8ff0d92ad7
testing-checklist: add LANG=C, needed for debuilder 2020-06-14 17:39:58 -04:00
nick black
59bf168e55
quadblitter: emit ▌, not ▋, you fool #667 2020-06-14 05:11:11 -04:00
nick black
d710bb24b2 unit test for quadblitter #667 2020-06-14 03:54:10 -04:00
nick black
d69d369304 fill out NCBLIT_2x1 Dualblitter unit test #667 2020-06-14 03:54:10 -04:00
nick black
ab4243d9be quadblitter/dualblitter unit test bases 2020-06-14 03:54:10 -04:00
Nick Black
0084dbaa6d
qrcode generalization #699 (#713)
Add convenience function ncplane_home(). Add an ncblitter_e param
to ncplane_qrcode(), and split int maxversion into value-result
int* ymax and int* xmax. Write the actual sizes of the resulting
visual into these parameters. Update the qrcode demo. Add the
qrcode PoC. Update demos to ncplane_home(), where possible.

ncplane_qrcode() now takes an ncblitter_e and two value-result int*s
in the place of a single value int. The final size of the displayed qrcode
is written to *ymax and *xmax. If the code can't fit within the specified
dimensions, an error is returned. Standard rules for pluggable blitters
apply regarding fallback etc. #699
2020-06-13 22:24:50 -04:00
nick black
3936d1b528
adapt callers of ncvisual_geom() 2020-06-12 00:53:34 -04:00
nick black
70183ee283
Rewrite plot tests using C interface #703
The Plot unit tests were reaching directly into the objects,
which meant the implementations couldn't include anything
we didn't want public. This was annoying, so I've changed it.
This required adding ncdplot_sample() and ncuplot_sample(),
which we should have had anyway.
2020-06-12 00:13:01 -04:00
Nick Black
28431914a8
First go at ncplane_puttext() (#690)
Very simple take at ncplane_puttext(), a new function for linebroken text. Also some very basic unit tests. I doubt this works very well yet, but it handles the simplest cases #682. Added nclog(), internal function for logging. #520
2020-06-08 03:01:58 -04:00
nick black
b2dcc50606
notcurses_options: fold bools into flags 2020-06-07 05:08:46 -04:00
nick black
2c417ddb0c
yield demo: punch up with polyfills 2020-06-06 05:11:45 -04:00
nick black
b648868361
PolyfillOnGlyph unit test fix 2020-06-06 01:58:55 -04:00
nick black
633ef1f76c
add beginnings of yield demo 2020-06-05 15:14:07 -04:00
nick black
d73c12be6f
ncvisual_from_plane: argument inversion error #678 2020-06-05 02:31:36 -04:00
nick black
75f458d69a
ncplane_yx: results are relative to bound plane 2020-06-03 12:17:51 -04:00
nick black
96a47de845
merge cell unit tests 2020-06-03 04:25:31 -04:00
nick black
a863daf4f6
cell tests: accept short widths for wide chars #229 2020-06-02 22:50:23 -04:00
nick black
0cda775900
metric: use FE_TONEAREST instead of TOWARDZERO #615 2020-06-01 08:25:59 -04:00
nick black
4f5c8ef3d7 eagle/outro support for non-multimedia builds 2020-06-01 04:44:02 -04:00
nick black
2d3fef115e ncfadectx_setup(): remove timespec param #659 2020-06-01 04:44:02 -04:00
nick black
fd2bb53f83 fade: more unit tests, verify abort on callback #659 2020-06-01 04:44:02 -04:00
nick black
3deeecdf2e fade: finish out proposed API, basic unit tests #659 2020-06-01 04:44:02 -04:00
nick black
3ff083b73f Fade API: move control of delays into callback 2020-06-01 04:44:02 -04:00
nick black
8793fcd876 c++ Visual: add from_plane constructor, test #654 2020-05-31 21:56:09 -04:00
nick black
6a9bbad91e
Visual C++ constructor test #538 2020-05-29 19:59:46 -04:00
nick black
0331ae4c4c
introduce NCVISUAL_OPTION_BLEND #652 2020-05-29 14:53:53 -04:00
nick black
33318254b2
absorb first ncvisual_decode into ncvisual_from_file() #655 2020-05-29 08:39:11 -04:00
nick black
89ffb6658e
CMake: improvements to testing usability
Replace USE_TESTS with BUILD_TESTING variable already exported by CTest.
Use the CMake 3.17 CMAKE_CTEST_ARGUMENTS to pass "-V" to ctest. #651
2020-05-29 02:47:29 -04:00
nick black
0766007a77
tester: kill off inhibit_alternate_screen #651 2020-05-29 02:30:57 -04:00
nick black
e88bc5c04b
Metric tests: observe local customs #650 2020-05-29 02:24:41 -04:00
Nick Black
ebcba82d4b
Fully general ncvisual layer (#647)
This represents an essentially complete rewrite of ncvisual and associated code. It had two major goals:

Improve the ncvisual API based off lessons learned, pursuant to the upcoming API freeze. In particular, I wanted to:

decouple ncvisuals from ncplanes. It should be possible to render a ncvisual to multiple planes, with different scaling each time. It should be possible to create an ncvisual without a plane, etc.
normalize the various ways of constructing an ncvisual -- file, memory, plane, etc.
Support multiple blitters, from 7-bit ASCII to Sixel. This required writing the blitters in several cases, and they're not yet in their final implementations (but the API is fine)
I have not yet unified Plots and Visuals, and might not, given that the Plot code works fine. We could at this point implement Plots in terms of Visuals, though -- the blitter backend range has been unified. Sixel is not yet implemented, though it is listed.

There is a new POC tool, blitter. It renders its arguments using all possible blitter+scaling combinations. Another new POC, resize, displays its argument, then resizes it to the screen size and displays that, explicitly making use of ncvisual_resize() rather than a scaling parameter to ncvisual_render().

This also eliminates some memory leaks and bugs we were seeing in trunk, and brings in Sixel scaffolding.

The C++ wrapper will also need patching back up; I cut most of it down while wrestling with this crap, urk.

Closes #638, #562, and #622.
2020-05-28 21:16:58 -04:00
nick black
8971bda0c2 ncpp: stop() resets _instance, add unit test #538 2020-05-24 03:34:46 -04:00
nick black
8e649ebe46 ncpp: test NotCurses construction/stop 2020-05-24 03:34:46 -04:00
nick black
7af027b895
ncpp unit tests: check get_instance exception #538 2020-05-20 18:36:25 -04:00
nick black
f120ab883f
tests: collapse RGB conversions into one TEST_CASE 2020-05-20 18:35:47 -04:00
nick black
37a4114f42
O(1) z-axis moves #623
Replace the singly-linked z-axis with a doubly-linked list,
and reimplement all z-axis moves as O(1) functions.
Eliminate ncplane_move_{above/below}_unsafe(), as there are no
longer unsafe moves.
2020-05-20 15:32:27 -04:00
nick black
8f78a8fdc0 fade tests: don't use CLOCK_MONOTONIC_RAW 2020-05-19 03:32:09 -04:00
nick black
3a7ee4b757
direct mode unit tests: allow init failure 2020-05-17 08:07:25 -04:00
nick black
6edc6f098f
streamline unit test common initialization 2020-05-17 07:57:21 -04:00
nick black
dcaf29323c
plane_rotate: fix unit tests 2020-05-17 07:23:16 -04:00
nick black
30f049d2e6
metric: don't allow scales that cause overflow #611 2020-05-17 04:16:02 -04:00
nick black
c01d0b227f
ncmetric unit tests for small values #607 2020-05-17 03:27:25 -04:00
nick black
b7a9b11f0c
test::reset_terminal(): properly check tigetstr() 2020-05-17 03:09:50 -04:00
nick black
25fee034cb
ncplot: print EGC before breaking on small glyph #605 2020-05-16 20:33:06 -04:00
nick black
1c2f92b3bc
ncmetric: replace u with µ, define *COLUMNS #540 2020-05-13 10:50:42 -04:00
Nick Black
f602c440a6
ncvisual_rotate() for arbitrary radians (#600)
* normal/visual: need dup stdplane for rotate
* add ncplane_center(), unit tests
* ncplane_center_abs(): add, unit tests
* ncvisual_bounding_box() for #599
* ncvisual_rotate(): works via bounding box #599
* normal demo: comment out broken section
* rotate: resize underlying plane as needed #599
* ncvisual_rotate: support negative rads #599
2020-05-12 22:57:28 -04:00
nick black
9a80750316
notcurses_canopen: split into images/videos #598 2020-05-12 20:10:53 -04:00
nick black
999c6c0742
geometry unit tests: shut down nc in finalizer 2020-05-12 18:40:14 -04:00
nick black
99d05f67e7 add ncplane_center(), unit tests 2020-05-12 18:25:44 -04:00
nick black
0bab14f654 tester: enable Visual tests #325 2020-05-11 05:59:55 -04:00
nick black
d9bb9b03af notcurses-tester: run passing tests in C locale #325 2020-05-11 05:59:55 -04:00
nick black
646b8ba4a5
rotate unit test: don't depend on size 2020-05-10 22:19:34 -04:00
nick black
fbed12cd80
ncreel_options: add flag field #590 2020-05-09 09:19:34 -04:00
nick black
eaaa36f0c8
ncreader: ncplane as first arg #590 2020-05-09 08:41:19 -04:00
nick black
fec423264f
selector: undo switch to notcurses from ncplane 2020-05-09 07:51:23 -04:00
nick black
5a3e0625a4
enmetric unit tests: kill duplicated fesetround() 2020-05-08 22:00:27 -04:00
nick black
1c394dc103 modernize c++ according to clang-tidy-11 2020-05-08 21:42:04 -04:00
nick black
e2a94817e7 tests: lots of NULL->nullptr 2020-05-08 21:42:04 -04:00
nick black
989ca7ff9a selector->ncselector, multiselector -> ncmultiselector #580 2020-05-08 21:42:04 -04:00
nick black
4e94d942b0 reader unit test visualization #403 2020-05-08 21:42:04 -04:00
nick black
d174431187 ncreader_create: accept const options #403 2020-05-08 21:42:04 -04:00
nick black
7683973ee4 ncreader_options, bad options tests #403 2020-05-08 21:42:04 -04:00
nick black
4819c0e1c3 selector/multiselect: accept notcurses 2020-05-08 21:42:04 -04:00
nick black
c0c76342a8
rotate test: relax ncvisual_render() checks 2020-05-07 12:57:34 -04:00
nick black
cbf46402f8
tests: portable find_data() 2020-05-07 00:53:01 -04:00
nick black
ed548ab590
tests: apply clang modernizations 2020-05-07 00:52:40 -04:00
nick black
a571f4daaa
tests/wide.cpp: use modern range loop 2020-05-07 00:52:16 -04:00
nick black
173af7b3c6
unit test upper left of rotated visual #569 2020-05-06 23:50:24 -04:00
nick black
f84435f708
unit test ncplane_rgba() #569 #559 2020-05-06 23:16:00 -04:00
nick black
43a685be1e
ncsubproc: update unit tests for exit propagation #554 2020-05-06 19:53:59 -04:00
nick black
94fcada67c
ncvisual_rotate: unify _cw/_ccw, take radians 2020-05-06 05:49:22 -04:00
nick black
f63325db60 Lots of ncvisual work
Unify ffmpeg/oiio/null implementations, where possible. This effectively
required placing all three in the same file, which meant they're all now
C++. Update FFmpeg implemenation to be C++-usable. Implement
ncvisual_rotate_cw() and ncvisual_rotate_ccw() #515. Move most of tetris
over to Visual from Plane #558. Add bgra_to_rgba(), necessary for
creating ncvisual from BGRA memory. Implement ncvisual_from_rgba()
and ncvisual_from_bgra() #557. Add unit tests on ncvisual rotation.
2020-05-06 01:02:46 -04:00
nick black
39548acc3a rename ncvisual_open_plane->ncvisual_from_file() #560 2020-05-06 01:02:46 -04:00
nick black
cd2cbd0d88
export enforce_utf8() via internal.h #451 2020-05-02 15:52:11 -04:00
nick black
c8322e6cb1
ncfdplane: on non-following planes, break out on 0 read 2020-05-02 11:57:38 -04:00
nick black
a23efbb463
rigourize ncsubproc destruction
We need support three distinct paths for destruction of
ncsubprocs: (1) external call to ncsubproc_destroy() while
the subprocess is running, (2) external call to
ncsubproc_destroy() after the subprocess has terminated, and
(3) internal call to ncsubproc_destroy() without any external
call. To do this properly, we always waitid() on the subprocess
in our ncsubproc thread, and do not cancel said thread. This
guarantees that the subprocess has been reaped if the thread
has exited. We throw a pidfd_send_signal() into the thread
prior to the waitid(), because this is safe with pidfds. The
thread reclaims no resources otherwise. ncsubproc_destroy(),
instead, reclaims them, after joining the ncsubproc thread.
It sends SIGKILL before the join, which is once again safe
thanks to pidfds. Resolves #552.
2020-05-02 04:34:37 -04:00
nick black
c9088ff37b
subproc unit test rename 2020-05-02 03:49:16 -04:00
nick black
e156bd42be
plot: match delete, not free, with new 2020-04-29 05:32:08 -04:00
nick black
5210e410f4
visual unit test: use notcursesI.avi, which OIIO can decode #547 2020-04-28 21:23:36 -04:00
nick black
294e8fd90a
subproc tests: pass outofline_cancelled through as curry 2020-04-28 00:27:07 -04:00
nick black
36bfa45d6c
notcurses-tester: fix double-free 2020-04-27 07:16:49 -04:00
nick black
595dd20950
cells unit test: downgrade problematic unicode to WARN #517 2020-04-25 17:34:51 -04:00
Nick Black
9a075ae5d0
Support image decoding with OpenImageIO #453 (#534)
* fedora: dep on OpenImageIO, and use it
* fedora: dep on libqrcodegen-devel
* fedora: BuildRequires OpenEXR-devel
* tight check on USE_MULTIMEDIA
* CMake: enable notcurses-view for ffmpeg OR oiio
* notcurses-view: don't reach into libav
* oiio: ncvisual_render() #453
* oiio: need our own properly-offset ncvisual_plane()
* `visual` poc: accept optional command line argument
* oiio: work for 3-channel images #453
* oiio: destroy ncvisual's plane if we own it #453
* notcurses_visual.3: s/FFmpeg/multimedia/g
2020-04-25 15:52:23 -04:00
nick black
0b4ada19b1 Remove AVFrame from API #532 2020-04-24 04:17:56 -04:00