Commit Graph

49 Commits (641f0cb89499a8dee185865d13fd97de8c9ddee4)

Author SHA1 Message Date
nick black 79d3ae67e4
add notcurses_cantruecolor() 4 years ago
nick black d084513172
ncvisual_geom: account for scaling #726 4 years ago
nick black 7ca5a7e82c
ncneofetch: create info plane #550 4 years ago
nick black 3f114f4305
ncplane_puttext(): allow NULL for sbytes 4 years ago
nick black 0657267274
v1.5.1 4 years ago
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
4 years ago
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.
4 years ago
nick black 185742fd08
Rendering now does tripartite fallback to basecell
Each plane has a "base cell", which like all other cells is
initialized to the null glyph, opaque default foreground color,
and opaque default background color. Prior to this change, at
each cell of a plane, we decided whether to use that cell (the
"viscell") or the base cell depending on whether the viscell had
a non-null glyph. We now evaluate each component independently.
If the viscell has a null glyph, we use the base cell's glyph.
If the viscell has a default foreground, we use the base's fg.
If the viscell has a default background, we use the base's bg.
This was done because (a) it seems more intuitive (if I set a cell
to red, I expect red, not red iff there's a glyph in that cell
for this plane), and (b) because otherwise it was impossible to
do a multicolor overlay without blowing away underlying glyphs
(since without a glyph, you always reduced to the same base cell,
which could have only one fore- and background per render).

Existing code will need to change any instances where cells
lacking glyphs are colored, and those colors are not desired.
Since any such coloring had no effect before, it seems unlikely
that any ought exist (this did bring to light an instance in
the "qrcode" demo where we were staining overmuch of the plane).

This closes #395, the last big open worry regarding our API.
4 years ago
nick black af46077775
ncvisual_geom: take degradation into account #697
In order to properly determine the scaling of an ncvisual to
be rendered, ncvisual_geom() needs know the blitting method.
For this reason, it took an ncblitter_e argument. It also,
however, needs handle degradation, which means knowing whether
NCVISUAL_OPTIONS_NODEGRADE is in use. It thus really wants the
struct ncvisual_options. Pass and accept it. Closes #697, and
fixes the "yield" demo in ASCII mode (#696).
4 years ago
nick black 470c4f13e2
remove duplicate NEWS entry 4 years ago
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
4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black d863220e23
add pixels PoC 4 years ago
nick black fb13b148e9
add Pixel API 4 years ago
nick black 3bc9a4cfa2
v1.4.5 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 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 354ece5826
v1.4.4.1 4 years ago
nick black 230f3af8e1
v1.4.4 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 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
nick black 4347cd956a merge in master changes 4 years ago
nick black c08c9b7f7f
v1.4.3 4 years ago
nick black bec9691999
NEWS: document *PREFIXFMT macros #630 4 years ago
nick black 00d63c0b69
add USE_STATIC option to CMake #625 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 32d3ae91c8
v1.4.2.3 4 years ago
nick black e132c6bb24
v1.4.2.2 4 years ago
nick black 49fb03655e
v1.4.2.1 4 years ago
nick black 38e67abd9d
v1.4.2 4 years ago
nick black eb72a4612d
qprefix/bprefix: use uintmax_t for decimal 4 years ago
nick black e1c55041c7
mention mouse/margin translation in NEWS 4 years ago
nick black 532c1689a4
NEWS: stream API updates 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 d6e349209c
v1.4.0 4 years ago
nick black 3a8b0b9716
v1.4.0 4 years ago
nick black 5a46aee74b
release.sh: NEWS not CHANGELOG 4 years ago
nick black 9446840b97
ncmenu: move to flag field #590 4 years ago
nick black fec423264f
selector: undo switch to notcurses from ncplane 4 years ago
nick black d89d8c52e9
notcurses_options: add flags field 4 years ago
nick black d2c968b948
notcurses_init(): interpret NULL as /dev/tty #571 4 years ago
nick black 06e4b9f06b NEWS: mention ncplane_set_channels() 4 years ago
nick black 989ca7ff9a selector->ncselector, multiselector -> ncmultiselector #580 4 years ago
nick black 66d0fe5596 NEWS: add ncreader and ncplane_content() 4 years ago
nick black 289aba6f68 CHANGELOG.md -> NEWS.md #570 4 years ago