Commit Graph

28 Commits (530dda100234a35dc5bdec82770b2d93be9fbf86)

Author SHA1 Message Date
nick black a4367fcfb5 rip out ncplane_ creation functions #985 4 years ago
nick black b7a57eaab7 convert all channel rgb calls #985 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 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 b49d1ad838
rewrite all unit tests to use testing_notcurses() #718 4 years ago
nick black b2dcc50606
notcurses_options: fold bools into flags 4 years ago
nick black 2c417ddb0c
yield demo: punch up with polyfills 4 years ago
nick black d73c12be6f
ncvisual_from_plane: argument inversion error #678 4 years ago
nick black 4f5c8ef3d7 eagle/outro support for non-multimedia builds 4 years ago
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
4 years ago
nick black 0766007a77
tester: kill off inhibit_alternate_screen #651 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 6edc6f098f
streamline unit test common initialization 4 years ago
nick black dcaf29323c
plane_rotate: fix unit tests 4 years ago
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
4 years ago
nick black d9bb9b03af notcurses-tester: run passing tests in C locale #325 4 years ago
nick black 646b8ba4a5
rotate unit test: don't depend on size 4 years ago
nick black c0c76342a8
rotate test: relax ncvisual_render() checks 4 years ago
nick black 173af7b3c6
unit test upper left of rotated visual #569 4 years ago
nick black f84435f708
unit test ncplane_rgba() #569 #559 4 years ago
nick black 94fcada67c
ncvisual_rotate: unify _cw/_ccw, take radians 4 years ago
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.
4 years ago
nick black 39548acc3a rename ncvisual_open_plane->ncvisual_from_file() #560 4 years ago
nick black 9e28e14001
move enforce_utf8() into main 4 years ago
Nick Black c6a9997554
Normalize ncplane_at_* / ncplane_set_base() (#479)
* ncplane_at_* and ncplane_at_cursor_*

We had notcurses_at_yx() expanding into three distinct parts of
the cell structure, and ncplane_at_yx() / ncplane_at_cursor()
writing directly to a cell. It was annoying to remember which
was which. The latter two now have a signature matching
notcurses_at_yx(), while the old functionality has been moved
to ncplane_at_yx_cell() and ncplane_at_cursor_yx(). #476
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 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