Commit Graph

463 Commits (master)

Author SHA1 Message Date
nick black d8cc3569ac
Block some signals while writing
Writing a partial escape can easily lock up a terminal. This
is especially relevant when working with bitmaps, as they're
thousands or even millions of times longer than a typical
escape. Immediately before writing, block SIGINT, SIGQUIT, and
SIGTERM in the writing thread, and unblock them upon emerging
(at which point we'll immediately see any queued signal
get delivered). Don't block signals like SIGSEGV that would
seem indicative of actual problems. For this to actually work,
all other threads must also have the signals masked; we thus
now add them to the signal mask of notcurses_getc(), rather
than deleting them. Closes #1416.
3 years ago
nick black e43a9955cd
channel_* functions -> ncchannel_* #1570 3 years ago
Nick Black c8680255be
palette256 -> ncpalette #1570 (#1573)
everything prefixed with palette256 is now prefixed with ncpalette
3 years ago
nick black f4aa419a31
add notcurses_canhalfblock()/notcurses_canquadrant() #1575 3 years ago
nick black 6c7b40debf
add stats for sprixel emissions/elisions #1563 3 years ago
nick black d5b58d9f58
v2.2.8 3 years ago
nick black eefc4fb91f
v2.2.7 3 years ago
nick black 6b7195a387 document new function ncvisual_inflate() #1546 3 years ago
nick black 32500239ac
cell_extract() -> nccell_extract() 3 years ago
Nick Black e591ec2e98
cell -> nccell throughout much of remaining API (#1535)
cell -> nccell throughout much of the API #1532
3 years ago
nick black e017dcba89
v2.2.6 3 years ago
nick black 0c566cd74a [ncvisual] pipe transcolor through #1518 3 years ago
nick black d504e972cc
cell_release -> nccell_release 3 years ago
nick black cf3a6317aa export ncdirect_stream() 3 years ago
Nick Black 04b1ba8ed2
Dankamongmen/unify geom (#1514)
deprecate ncvisual_geom() in favor of new ncvisual_blitter_geom(), which allows caller to get the blitter used. replace the checks and calculations in ncvisual_render() with a call to ncvisual_blitter_geom(), unifying the two paths (and eliminating several bugs in the unloved ncvisual_geom()).
3 years ago
nick black f294c6bb0b
add ncplane_pixelgeom() #1507 3 years ago
nick black 05082fc277
ncplane_as_rgba(), returns pixel geometry along with bitmap #1508 3 years ago
nick black 8c78b089e1
v2.2.5 3 years ago
nick black 57114c8005
[bitmaps] remove redundant PixelWipeBlocks test 3 years ago
nick black 78c8e70933 [planes] add NCPLANE_OPTION_MARGINALIZED #1472 3 years ago
nick black 86de98c5d2 Fix cell blit / plane vertical alignment
Deprecate ncplane_align(), after rewriting it as a passthrough
to new function ncplane_halign(). Add ncplane_valign(). Update
all callers. Closes #1468.
3 years ago
nick black 6105913d06 [planes] add NCPLANE_OPTION_VERALIGNED #1465 3 years ago
nick black 828cce634a [capabilites] remove redundant notcurses_canpixel() 3 years ago
nick black 852b0ad0ec
[NEWS] mention nctabbed for 2.2.4 3 years ago
nick black f8b68947f3 [NEWS] mention NCVISUAL_OPTION_HORALIGNED #1443 3 years ago
nick black 33d408b4a3
[sixel] call sprite_sixel_init at proper time #1436 3 years ago
nick black a6548fbcc8 [ncvisual] refuse to blit bitmaps to standard plane 3 years ago
nick black f35e2eb982
notcurses_visual.3: link to sixel/kitty 3 years ago
nick black bc84987af5
v2.2.3 3 years ago
nick black 4a203ef0a9
direct mode: optimize out redundant SETAF, nice 3 years ago
nick black 49ce0d1c57
mention SIGCONT along with SIGWINCH 3 years ago
nick black 100a89291b hide cell_{b,f}channel(), cell_set_{b,f}channel() 3 years ago
nick black 6c7c9be6d2 require explicit check for pixel support
Add `notcurses_check_pixel_support()` and
`ncdirect_check_pixel_support()` per #1367. Removes
NCOPTION_VERIFY_SIXEL, again per #1367. Adds
`free_terminfo_cache()`, and calls it from both
`notcurses_stop_minimal()` and `ncdirect_stop()`.
Update all documentation. Closes #1371 and #1367.
3 years ago
nick black e782287142 add NCBLIT_PIXEL to NEWS 3 years ago
nick black fe8abbecc5 NEWS: mention nctree for 2.2.3 3 years ago
nick black 2221120543 add SIGILL to documented fatal signals #1357 3 years ago
nick black c10f5a40ce
v2.2.2 3 years ago
nick black 1df9d85f28
Lock accesses to notcurses_stats #1139
notcurses_stats() and notcurses_stats_reset() now take the
new statlock member, as do stat modifications from render,
raster, writeout, resize, plane creation, and plane
destruction. Add nonnull attributes to stats API. Initialize
and destroy statlock as part of notcurses struct. Update
documentation. Free pilelock on error paths. Closes #1139.
3 years ago
nick black 1b1e0b88be
ncplane_qrcode: drop blitter argument, update docs 3 years ago
nick black be4a9154a8
v2.2.1 3 years ago
nick black 3cdf7160de
v2.2.0 3 years ago
nick black 6b126f4049
add notcurses_canbraille() capability test 3 years ago
nick black 54ca2249df
v2.1.8 3 years ago
nick black b3569b6aef
Initialize Readline on demand
Eliminate NCDIRECT_OPTION_NO_READLINE (it was only introduced in
Notcurses 2.1.6). Add a new function, ncdirect_readline(). Upon
first call to this function, initialize libreadline. Destroy
libreadline in ncdirect_stop() iff we initialized it. Add
hilodirect guessing game PoC from #1325. Rename
notcurses_directmode.3 to notcurses_direct.3. Closes #1326.
3 years ago
nick black 2491b693ba
Add missing channel_set_palindex()
Implement channels_set_fg_palindex() and channels_set_bg_palindex()
in terms of channel_set_palindex(). Add missing entries to
notcurses_channels.3 man page. Use uint32_t in place of unsigned
when dealing with channels in notcurses.h.
3 years ago
nick black 7eafcfe598
rename notcurses-tetris -> nctetris 3 years ago
nick black 121f10a9c5
v2.1.7 3 years ago
nick black 57271d09ce
v2.1.6 3 years ago
nick black 45c389a709 document *_core_init() #1301 3 years ago
nick black 1631818784
rename notcurses-view to ncplayer #1299 3 years ago
Nick Black 9112185657
Split up notcurses/notcurses-core (#1297)
Extract `libnotcurses-core` from `libnotcurses`. The former contains everything except multimedia code. The latter contains multimedia stuff (a wrapper around FFmpeg or OIIO). If built with `-DUSE_MULTIMEDIA=none`, there will not be any `libnotcurses.so` generated. `libnotcurses.so` uses library constructors/destructors to insert its implementation into the `ncvisual` stack at runtime. Users linking `-lnotcurses` will get the full implementation; users linking `-lnotcurses-core` only will get the stack less multimedia code.

The upshot of this is that someone can compile/install only `libnotcurses-core`, and a program linked against it will work just fine. This eliminates the need to install the full (large) dependency stack of the multimedia code unless necessary. This will hopefully be useful for e.g. installers etc. Closes #339.
3 years ago
nick black 3ecdde74d0
v2.1.5 3 years ago
nick black 1108ebb5b6
Fix up some subtle pile issues
ncplane_destroy() needs to call ncplane_reparent_family(), not
ncplane_reparent() as it was doing (closes #1291). ->absy and
->absx actually are absolute; return them directly for an O(1)
ncplane_abs_yx() (down from O(N), huzzah). Add some unit tests
related to destroying and reparenting (#1286). Add ncplane_abs_y()
and ncplane_abs_x(), document them, etc.
3 years ago
nick black 1c0a623b8b
document new function ncplane_abs_yx() #1286 3 years ago
nick black 0a165a9de8
paint: solve for egc following colors #1068 3 years ago
nick black 68b340e3c8
ncdirect: prep readline for use #1120 3 years ago
nick black 15386d57ce
nontrivial stacking unit test #1068 3 years ago
nick black e617acecc7
v2.1.4 3 years ago
nick black 998cf02f34
add NCDIRECT_NO_QUIT_SIGHANDLERS #1271 3 years ago
nick black 70b74a749b
v2.1.3 3 years ago
nick black f1253560ad
ncdirect: set_ on rgb functions #1261 4 years ago
nick black 76d8e2dfce
ncdirect_{fg, bg}_default() -> ncdirect_set_{fg, bg}_default() #1261 4 years ago
nick black 638dde7657
remove unnecessary args from ncdirect_raster_frame() #1248 4 years ago
nick black 1d8fcbb5e4
ncdirect: styles{set, on, off} -> _styles #1247 4 years ago
nick black 55d563b646
v2.1.2 4 years ago
nick black 4d8efcab82
Progress towards NCBLIT_3x2 by default
Add a new member 'sextants' to the terminfo cache (both
notcurses and ncvisual contain one of these, and both
initialize it the same way -- interrogate_terminfo()).
Add a new function, 'notcurses_media_defblitter()', and
deprecate 'ncvisual_default_blitter()' (the latter didn't
receive enough information to return NCBLIT_3x2). Update
all callers. Add new *internal* function rgba_default_blitter(),
so this logic can be freely changed in the future. If
sextants are available, and we're scaling, return NCBLIT_3x2.
Once we detect sextant availability, we'll have sexblitter
as a default -- stay tuned! #1114
4 years ago
nick black e1b1654d1e
NEWS: mention ncdirect image render split 4 years ago
nick black 248dd1fff2
add dynamic linesig control #1228 4 years ago
nick black d6d5757b1d
v2.1.1 4 years ago
nick black d56ea8b5e7 progbar: remove egcs options 4 years ago
nick black 6edafd1f84
v2.1.0 4 years ago
nick black fd2acde1b1 rename cell->nccell, keep alias #1200 4 years ago
nick black 8497ee1877
v2.0.12 4 years ago
nick black 5fc0577529
NEWS: mention ncplane_resize_maximize() 4 years ago
nick black eb485cda21
v2.0.11 4 years ago
nick black a3220b8a73
add ncplane_descendant_p(), unit test it #1192 4 years ago
nick black 361a253aea
v2.0.10 4 years ago
nick black 6fb5c1e512 Fill out some API holes, improve some comments
- Disambiguate the docs for ncplane_erase()
- Add ncpile_top(), ncpile_bottom()
- Refuse attempts to modify the standard plane's resizecb
- Copy alignment and resizecb in ncplane_dup()
- Add cell_load_egc32()
4 years ago
nick black 8083b46e3b
v2.0.9 4 years ago
nick black 2a45620cd6
v2.0.8 4 years ago
nick black e3b2c91999
add NOTCURSES_VERSION_COMPARABLE #1131 4 years ago
nick black 202e3535d5 document new NCSTYLE_STRUCK #1138 4 years ago
nick black fd97aa844c implement ncpile_{render, rasterize}() 🦀🦀 #1135 4 years ago
nick black b2516d8534 Declare ncpile_render() and ncpile_rasterize() #1135 4 years ago
nick black aa5b881e84 NEWS: purge empty sections 4 years ago
nick black a2c35735d1 finish out NEWS for multipiles #1078 4 years ago
nick black 740dc2497d NEWS: mention integer version defines 4 years ago
nick black b6e5b60374 ncpile_create() not NCPLANE_OPTION_NEWPILE #1078 4 years ago
nick black b747af2ae8 drop NCPLANE_OPTION_NEWPILE #1078 4 years ago
nick black 0da6a8c44b add NCPLANE_OPTION_NEWPILE #1078 4 years ago
nick black 73b2f1bf19
v2.0.7 4 years ago
nick black acdcf9e41f
v2.0.6 4 years ago
nick black 537caa2173
v2.0.5 4 years ago
nick black 65ed8c0d86
undeprecate ncplane_new(); why break running code? 4 years ago
nick black c0cb5c7ff9
add ncplane_resizecb() #1124 4 years ago
nick black 6084105c68
add ncplane_set_resizecb() #1124 4 years ago
nick black a92e5d97e0 don't threaten to remove ncplane_new() #1115 4 years ago
nick black 61baabe9a1 eagle, HUD: use default blitter 4 years ago
nick black eef6df8c0a death to horiz #1115 4 years ago
nick black a9fbe41f2b document the New Way 4 years ago
nick black 7622cefc3a
v2.0.4 4 years ago
nick black 0d31a03be9
v2.0.3 4 years ago
nick black 8a81d06b4b
ncreader: implement reamining shortcuts #983 4 years ago
nick black 1b1d727169
ncreader: support ctrl-a and ctrl-e #983 4 years ago
nick black 4203c2402f notcurses-demo: improve usage() for 25 demos #736 4 years ago
nick black 7ad0ed2cc2 blitters don't count transparent cells against written count 4 years ago
nick black 8189d21709
v2.0.2 4 years ago
nick black b35c680f48 add LoopVideo unit test #1066 4 years ago
nick black 8919d6fe70 ncvisual_rewind 4 years ago
nick black a4546c86e3
v2.0.1 4 years ago
nick black 0b825c619e
add notcurses_stddim_yx_const() 4 years ago
nick black 34442f263f demo: let ncmenu handle section shortcuts #1058 4 years ago
nick black 3229fa53b3
add ncinput_equal_p() predicate #1059 4 years ago
nick black 6623fc92a0
ncmenu_item_set_status: man page, NEWS, python, c++ #1057 4 years ago
nick black 65974aeb0b
v2.0.0 4 years ago
nick black fbd3d7fc7f
add 2.0.0 release notes 4 years ago
nick black 8c9611d085
v1.7.6 4 years ago
nick black 4493ac3fa2 note putwc -> putwch in NEWS 4 years ago
nick black d101d2d2d9 add ncdirect_init() inhibit cbreak flag #1049 4 years ago
nick black c6c157a5ad
notcurses_stats_alloc() everywhere 4 years ago
nick black f9e2c7863b
add notcurses_stats_alloc #1043 4 years ago
nick black b4f1065f69 declare notcurses_render_to_buffer() #214 4 years ago
nick black 222861de13 add ncstats to USAGE.md 4 years ago
nick black 20a49d053d
v1.7.5 4 years ago
nick black 683217ef07 normalize style setters #1034 4 years ago
nick black c236b65266 name standard plane 'std' 4 years ago
nick black a591e11c96 retain nctablet_ncplane() as deprecated alias 4 years ago
nick black 20bf1ae2d4
nctablet_ncplane() -> nctablet_plane() 4 years ago
nick black ec85dd1c3b
ncreel_destroy: return void 4 years ago
nick black f02263e977
v1.7.4 4 years ago
nick black 2d9598b913
introduce ncplane_resize_realign #364 4 years ago
nick black 7b51bab79a add resizecb to ncplane_options struct #869 4 years ago
nick black 97dc50db1a kill stray entry in NEWS 4 years ago
nick black 36aed3c521 add ncplane_create() + ncplane_options #1020 4 years ago
nick black 607c03edc4
rename _rgb_clipped functions rgb8_clipped 4 years ago
nick black 4459efa216
v1.7.3 4 years ago
nick black a4367fcfb5 rip out ncplane_ creation functions #985 4 years ago
nick black e42dbdfd60 _stainable() -> _stained() #985 4 years ago
nick black 0e34bec3fb start converting rgb->rgb8 #985 4 years ago
nick black 4bb1f3fc85 mbswidth -> ncstrwidth() #985 4 years ago
nick black dca9db9687
ncreel: conform to the New Way #627 4 years ago
nick black c3e5e47a2a
ncreader: conform to the New Way #627 4 years ago
nick black 4f04f1bc31 remove bgchannels field from selector_options #627 4 years ago
nick black 306948507f ncmultiselect: normalize per new widget API #627 #1006 4 years ago
nick black bc097a5674
v1.7.2 4 years ago
nick black af05ae7a92 man pages: document NCREADER_OPTION_CURSOR 4 years ago
nick black f88c8ae79c
expose ncvisual_default_blitter(), name blitter in notcurses-view #995 4 years ago
nick black 70f062aff5
v1.7.1 4 years ago
nick black 2f28420034 rename ncplane_putsimple() -> ncplane_putchar() #912 4 years ago
nick black 4c7a1d0427 ncdirect_init: add flags parameter #976 4 years ago
nick black 5fc6705ce3
add notcurses_ucs32_to_utf8() 4 years ago
nick black c93243fd54
v1.6.20 4 years ago
nick black e1863317a3
CMake: conform to cmake capitalization conventions 4 years ago
nick black a48e840542 document ncreel a bit more 4 years ago
nick black 66f80c77f9
add ncplane_y() and ncplane_x() 4 years ago
nick black e92b7fd6ea
v1.6.19 4 years ago
nick black 8f65211bf8 declare ncdirect input layer #919 4 years ago
nick black 6d7f9eb501
v1.6.18 4 years ago
nick black 9d75f575db
ncplane_set_[fb]channels 4 years ago
nick black 70a28feb63
ncreader: horizontal scrolling mostly works #839 4 years ago
nick black 7cbb2e9110 zoo demo: show cursor in reader box #835 4 years ago
nick black a53d5a21a8 disable/enable cursor for rasterize 4 years ago
nick black cab19cf790 Cursor work (placement, drop RETAIN_CURSOR) #953
notcurses_enable_cursor() now accepts placement arguments.
both it and notcurses_disable_cursor() now return int rather
than void. add notcurses_cursor_move_yx().
4 years ago
nick black 4dd1d6a4c8 Annihilate nc_err_e and all infrastructure #948 4 years ago
nick black 026b94969d cffi heap allocations are zero-initialized #942 4 years ago
Nick Black 73dc0a7d69
Zoo 2, electric boogaloo (#939)
* Reimplement the widget zoo demo. The previous PoC
  was a multithreaded monster with behavior dependent
  on screen geometry. Replace it with a single thread state
  machine. Closes #936.
* Support titles for ncplot. Adds title to the ncplot_options
  struct, which may be NULL. Closes #941 .
* Properly color ncplot according to maxchannels and
  minchannels. Closes #940
* Add tools/function-table.sh script for generating public API list.
4 years ago
nick black 32d352173b
ncdirect_flush: struct ncdirect is const 4 years ago
nick black 4ebf8f748c
v1.6.16 4 years ago
nick black 5c533c9f1a
ncplot: support legend styling 4 years ago
nick black 6bb8f447b5
add ncdirect_flush() #926 4 years ago
nick black 706d492ecd add channels_set_*_palindex() 4 years ago
nick black 2e5a8b78d5
add trivial new iprefix() 4 years ago
nick black 05da44b06b
hide blending functions #917 4 years ago
nick black a2c95814b7 Remove cell_simple_p()
Get notcurses-tetris working again, since its collision
detection relied on simple vs non-simple EGCs, which are
no longer an operative concept. Closes #899.
4 years ago
nick black 7933f2baa7
dispose of 1.6.14. PYTHHHHHONNNN 4 years ago
nick black dc99d56ac1
v1.6.14 4 years ago
nick black e897de3700
v1.6.13 4 years ago
nick black 50ba30b113 NEWS: mention notcurses_palette_size() 4 years ago
nick black 16ff667325 blissful endianness-opacity
not caring about endianness is the opiate of the masses.
happy, happy masses. remove endianness.h and all its baleful
influence by explicitly breaking up the cell structure. #892
4 years ago
nick black 9704f5cbe7
v1.6.12 4 years ago
Nick Black 11d6a4eb89
New reel layout algorithm #818 (#870)
New reel layout algorithm based on trimming and sifting. Fixes the original issue of #818, though I'm not marking that bug fixed until I've resolved the little issues remaining with this one.
Back off CMake version dependency, see if we can get by with 3.11.4 for EPEL8 #851
Simplify tablet drawing tremendously by separating tablet border and data planes. Callbacks no longer need worry about the borders; they can simply fill the plane they're handed. #833
Improve notcurses_debug() a bit
Add ncplane_new_named() and friends to expose plane naming to the user.
Add internal ncplane_genocide() to kill a plane and all its bound descendents
New industrial-strength ncreel unit testing
notcurses-ncreel now accepts -ln for log level n
Add ncplane_parent() and ncplane_parent_const()
4 years ago
nick black c21f0fb812 ncselector_dim_yx: eliminate boundary checks 4 years ago
nick black c618096083
ncselector_redraw(): don't call notcurses_render() #627 4 years ago
nick black fa76f5a432
v1.6.11 4 years ago
nick black ead60d06cc
unexport cell_egc_idx() 4 years ago
nick black 78a7b4d255 constify ncreader_options->egc 4 years ago
nick black 384232efd1
layout tests: enforce utf8 where necessary 4 years ago
nick black f8c16ceb79
v1.6.8 4 years ago
nick black 4f8673b0e9
v1.6.7 4 years ago
nick black 6ea968c522 declare ncmenu_mouse_selected() #819 4 years ago
nick black 604747c8f2 notcurses_puttext: use libunistring for wordbreaking #772 4 years ago
nick black 104bbfef50
add notcurses_lex_blitter() 4 years ago
nick black 308b49da5a
v1.6.5 4 years ago
nick black b2e924319b
v1.6.4 4 years ago
nick black 37ceb753bf
notcurses-view: print blitter name #805 4 years ago
nick black a4ee5bd9c7
v1.6.3 4 years ago
nick black 3f544a4ed1
v1.6.2 4 years ago
nick black 1cc0371373
v1.6.1 4 years ago
nick black 4a97c139e6
add ncplane_putstr_stainable() #754 4 years ago
nick black a6b002fa77 add ncdirect box-drawing functions #753 4 years ago
nick black c783244185 ncdirect_hline_interp(), ncdirect_vline_interp(), dirlines PoC #753 4 years ago
nick black 3ef1a3a07d
add notcurses_version_components() 4 years ago
Nick Black 162f9910c2
Tons of work on ncreel (#776)
Tons of work on ncreel (#627, #749, #694)
Improve reel demo: get input wired up once more, avoid the FPS demo at bottom, print pointer and line count in each tablet, use new ncreel API. Improve notcurses-ncreel explorer: kill memory leaks (#694), draw tablets better, use new ncreel API. Fix bug in ncreel core where cruft could be left on the screen, via a very gross brute force algorithm. I'll likely come back and make this a bit less ghastly in the future #749. Remove weird one-off input system from ncreel, residue from outcurses. Make some of the normalizing changes speced out in #627

* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* more terminal environment variable notes
* TERMS.md: add Sakura, st
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* ncreel: give each tablet an index, and print it #749
* reel: eliminate FIXME + param to insert_tabler() #749
* ncreel: label tablets with their adress to correlate against debugging logs #749
* ncreel: move legend out of reel proper
* ncreel_options: dump min/max_supported_rows/cols #627
* ncreel: remove weird one-off input layer #627
* ncreel: add ncreel_offer_input()
* reel demo: call demo_getc()
* reel demo: rig up input to demo main
* ncreel: drop ncreel_del_focused(), properly bind tablets
* reel demo: don't free up necessary plane
* ncreel: don't pull absolute locations of tablets
* ncreel: place tablets correctly in boundrel
* reel demo: add back support for left/right
* reel demo: restore thread movement
* ncreel: remove a great deal of complexity
* reel demo: stay out of FPS graph's way
* reel: tighten up reel following redraw
* reel: fix upper-left corner of topless perimeter
* ncreel: print linecount, return clipped value
* reel: draw focused tablet relative to reel
* reel: brute force decruftification, how embarrassing #749
4 years ago
nick black 479dd00739
ncreel: purge {tblr}off fields; these are ncplane properties #627 4 years ago
nick black b6330d142b
add notcurses_render_file() #491 4 years ago
nick black 284dfc4fad
v1.6.0 4 years ago
nick black b4490dfc97
1.5.4->1.6.0. describe new TTY interactions 4 years ago
nick black 85893fb927 NEWS entry for ncdirect_render_image() 4 years ago
nick black 6ab11e679f
v1.5.3 4 years ago
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.
4 years ago
nick black 78c2cef7e9
Use NCBLIT_2x2 by default with NCSCALE_STRETCH
We're not using NCBLIT_2x2 by default because it warps the
aspect ratio. If we're using NCSCALE_STRETCH, though, we've
(1) already indicated that aspect ratio isn't terribly
important to us and (2) are trying to maximize the space.
Since NCBLIT_2x2 is best for large images anyway, make it
the default when NCSCALE_STRECTH is being used.

Remove all explicit uses of NCBLIT_2x2 when NCSCALE_STRETCH
is being used in notcurses-demo.
4 years ago
nick black 64d42212a3
v1.5.2 4 years ago
nick black 97a996927f
ncdirect_render_image: return NCERR_UNIMPLEMENTED #725 4 years ago
nick black 4a3d436e5b
drone: update builders 4 years ago
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