Commit Graph

419 Commits (b9628ca21a7dac6b7b31c74f4d7f5fc290d84871)

Author SHA1 Message Date
nick black fb13b148e9
add Pixel API 4 years ago
nick black 2c417ddb0c
yield demo: punch up with polyfills 4 years ago
nick black 633ef1f76c
add beginnings of yield demo 4 years ago
nick black b172d2b97e
NCVISUAL_OPTION_MAYDEGRADE -> NCVISUAL_OPTION_NODEGRADE, doc 'em 4 years ago
nick black 9a0f0c66fe
ncblit: accept an ncvisual_options #680 4 years ago
nick black b72a386aa3
ncplane_dup(): adjust for marginalia #679 4 years ago
nick black e1d34c4f43
ncplane_highgradient: only pass a single channel #676 4 years ago
Nick Black de23139111
Open some whoopass on ncvisual rotation (#677)
Whip the ol' llama's ass (fix ncvisual rotation)

* notcurses: flush cursor change requests #673
* rotator: verify ncplane_rgba and ncblit_rgba
* ncblit: rename, accept ncblitter_e #674
* rotator: render from rgba
* rotator: get to rotation
* rotator: add a pi/4 turn at the end
* normal: reuse incoming plane for rendering #672
* rotator poc: rotate a fullplane gradient #672
* normal demo: place visual correctly
* rotator: verify ncplane_rgba and ncblit_rgba
* ncblit: rename, accept ncblitter_e #674
* rotator: render from rgba
* rotator: add a pi/4 turn at the end
* normal: reuse incoming plane for rendering #672
* rotator poc: rotate a fullplane gradient #672
* normal demo: place visual correctly
* rotator poc: throw some red into gradient
* rotator poc: done #662
* oiio: ncvisual_resize() needs set ibuf pointer #662
* normal: only need erase at top of loop
* visual poc: shorter delay
* normal demo: center rendered visual
* comment ncvisual_resize() call
* ncvisual_rotate: call ncvisual_details_seed()
* ffmpeg ncvisual: fix rotation #662
4 years ago
nick black a8beaf8e56
notcurses-view: switch between blitters with 0--8 #671 4 years ago
nick black 2b31d6ce4d
ncvisual/ncreel: update some documentation 4 years ago
nick black d41c6d3627
notcurses-ncreel: add </>/* operators 4 years ago
nick black efa51e9cf2 quadrant blitter #648
Novel blitter using Unicode quadrant glyphs. 2:1 cell aspect ratio, but
double the horizonal resolution of the half block blitter.
4 years ago
nick black 23001ab792
geomdata -> notcurses_blitters if it must be public 4 years ago
nick black 2d3fef115e ncfadectx_setup(): remove timespec param #659 4 years ago
nick black 3deeecdf2e fade: finish out proposed API, basic unit tests #659 4 years ago
nick black 74e8e9c3d9 fade: move more reproduced code into common area #659 4 years ago
nick black 3ff083b73f Fade API: move control of delays into callback 4 years ago
nick black 8793fcd876 c++ Visual: add from_plane constructor, test #654 4 years ago
nick black 6a9bbad91e
Visual C++ constructor test #538 4 years ago
nick black 0331ae4c4c
introduce NCVISUAL_OPTION_BLEND #652 4 years ago
nick black f47bde1c4e
Graceful fallback among blitters #637
If we're in ASCII mode, no blitter except for NCBLIT_1x1 is going to
work. Whenever NCBLIT_DEFAULT is provided, select NCBLIT_1x1 if we're
in ASCII mode. Add NCVISUAL_OPTIONS_MAYDEGRADE and
NCPLOT_OPTIONS_MAYDEGRADE. Both serve to allow smooth degradation when a
blitter other than NCBLIT_DEFAULT has been provided. Closes #637.

Make calc_gradient_cell() static inline so our templated ncppplot
implementation can use it (ugh). When using NCBLIT_1x1 for plots in
ASCII mode, use space rather than full block, and invert colors.

Use NCBLIT_DEFAULT in the demo for the FPS plot.
4 years ago
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.
4 years ago
Marek Habersack b5d8549bb3 [C++] Allow multiple instances of `NotCurses`
This is to make it possible, in the future, to create multiple instances
of `NotCurses` for multiple terminals.  The first instance of
`NotCurses` becomes the default one, so that any instances of other
classes that aren't explicitly created with a pointer to another
`NotCurses` instance still work as expected.

Note that currently trying to call `notcurses_init` twice results in the
following error for me:

    0x55555559bfc0 is already registered for signals
    Couldn't drop signals: 0x55555559bfc0 != 0x5555555b6720
    terminate called after throwing an instance of 'ncpp::init_error*'

    Program received signal SIGABRT, Aborted.

The error is signalled by `setup_signals` and the pointer shown in the
message points to the first `struct notcurses` instance created.
4 years ago
nick black dbc20bd5c0
add man page for ncmetric(3) #631 4 years ago
Marek Habersack e0462ed53a
[C++] Sync API changes (#633)
Added:

  * NotCurses: can_utf8 (`notcurses_canutf8`)
  * NotCurses: debug (`notcurses_debug`)
  * Plane: center_abs (`ncplane_center_abs`)
  * Plane: set_channels (`ncplane_set_channels`)
  * Plane: set_attr (`ncplane_set_attr`)
  * Reader: clear (`ncreader_clear`)

Changed:

  * USAGE.md: clarfied when C++ throws exceptions
4 years ago
nick black 8971bda0c2 ncpp: stop() resets _instance, add unit test #538 4 years ago
Marek Habersack 9ca8d9c9c6 Correctly cast `ncpp::Plane` to `ncplane*`
Fixes: https://github.com/dankamongmen/notcurses/issues/616

SIGSEGV was caused by an invalid cast.

Short explanation: PEBKAC

Long explanation: `Selector.hh`, `Plot.hh` and `MultiSelector.hh` did
not include `Plane.hh`, they merely declared `class Plane;` because
inclusion of `Plane.hh` would cause circular dependencies to appear and
the compiler would be unhappy.  On top of that, yours truly wrenched the
compiler's hands and caused it to believe that a pointer to `Plane` is
really a pointer to `ncplane*` which was quite a silly thing to do as
the compiler, not having included `Plane.hh` and thus not knowing full
definition of the type, wasn't able to look up the type cast operator in
`Plane`.

Don't abuse `reinterpret_cast`, kids!
4 years ago
nick black 24dae2cf15
ncmetric: tighten up PREFIXFWIDTH macros 4 years ago
nick black cce9384ab8
ncmetric: adapt PREFIXFMT to multibyte #630 4 years ago
nick black 2b5546fc4c
plot: make 8x1 the default glyph geometry 4 years ago
nick black 7215bf92ad
throw somed attributes on a few functions 4 years ago
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.
4 years ago
nick black 0d696be0cc
ncpp: normalize Notcurses capitalization 4 years ago
nick black 99bd3fd597
recenter post-rotation in normal demo #617 4 years ago
nick black e80ac4ddb9
normal demo: work with odd number of columns :/ 4 years ago
nick black eb72a4612d
qprefix/bprefix: use uintmax_t for decimal 4 years ago
nick black 168ec1e71d
Update USAGE for streaming API changes #604 4 years ago
nick black 289b018612 view-demo: cleanup, opaque 4 years ago
nick black 78e30831dd move timespec 4 years ago
nick black 1c2f92b3bc
ncmetric: replace u with µ, define *COLUMNS #540 4 years ago
nick black 9a80750316
notcurses_canopen: split into images/videos #598 4 years ago
nick black 0f5333f103
subtle ncplane bugfixes
ncplane_dup(): properly set target plane attributes/channels
ncplane_move_below_unsafe(): speedup, at most one traversal
ncplane_rgba(): accept null glyph
ncvisual_from_plane(): dup the plane, own it in ncvisual
normal: spin the visual
4 years ago
nick black 7dae248a41 box demo: work in ASCII encoding #325 4 years ago
nick black 25baa10f72 special-case double/rounded boxes in ASCII #325 4 years ago
nick black 9f16034d02 add notcurses_debug() #594 4 years ago
nick black a440382fb5 demo: use NCPLOT_OPTIONS_EXPOENTIALD #470 4 years ago
nick black fbed12cd80
ncreel_options: add flag field #590 4 years ago
nick black 66bafd59b3
subproc, fdplane, plot, selector, mselector: flag words #590 4 years ago
nick black eaaa36f0c8
ncreader: ncplane as first arg #590 4 years ago
nick black 9446840b97
ncmenu: move to flag field #590 4 years ago