Check out my first novel, midnight's simulacra!

Notcurses: Difference between revisions

From dankwiki
No edit summary
No edit summary
Line 16: Line 16:
* Subregion fade in/out
* Subregion fade in/out
* [[#Linear_interpolation|Linear interpolation]] for coloring geometric objects
* [[#Linear_interpolation|Linear interpolation]] for coloring geometric objects
==Rendering==
The vast majority of functions draw to <tt>ncplane</tt> objects. A partial order (currently a total order) always exists over the planes. There is always at least one plane, the "standard plane". This plane cannot be resized, deleted, moved relative to the visible area, or reparented. Whenever notcurses updates its idea of the visible area's dimensions, it will resize the standard plane (references to the standard plane are <b>not</b> invalidated). Planes may otherwise be any size (invisible regions will not be rendered, and count only against memory), and can be moved to any position relative to the visible area. All planes, including the standard plane, can be freely moved along the z axis.
Every plane, and the notcurses object as a whole, maintains a per-row <i>damage map</i>, one boolean entry per line of the plane.
When <tt>notcurses_render()</tt> is called, the visual area is constructed from the top left to the bottom right, row by row and column by column.
Each row is considered undamaged until proven otherwise. At each column, the character to be emitted (and its styling) is computed. This will require consulting some number of planes (see [[#Transparency/Contrasting|Transparency]] for more information). A damage value is computed as the boolean union over all relevant damage map entries. Relevant entries are those from the toplevel damage map, and the damage maps of all planes which contributed to the output glyph or styling.


==Transparency/Contrasting==
==Transparency/Contrasting==