mirror of
https://github.com/nicbarker/clay.git
synced 2025-11-06 21:06:17 +00:00
Added initial image support. Renders using characters with several options (ascii, foreground, background, unicode, etc). Note that each image object should only be used once (or at least with only one size), otherwise the cached results will conflict for each size and rendering will take longer and reduce responsiveness. |
||
|---|---|---|
| .. | ||
| resources | ||
| CMakeLists.txt | ||
| main.c | ||
| readme.md | ||
Termbox2 renderer demo
Terminal-based renderer using termbox2
This demo shows a color palette and a few different components. It allows changing configuration settings for colors, border size rounding mode, characters used for borders, and transparency.
Keybinds:
c/C - Cycle through color modes
b/B - Cycle through border modes
h/H - Cycle through border characters
i/I - Cycle through image modes
t/T - Toggle transparency
d/D - Toggle debug mode
q/Q - Quit
Configuration can be also be overriden by environment variables:
CLAY_TB_COLOR_MODENORMAL256216GRAYSCALETRUECOLORNOCOLOR
CLAY_TB_BORDER_CHARSDEFAULTASCIIUNICODENONE
CLAY_TB_IMAGE_MODEDEFAULTPLACEHOLDERBGASCII_FGASCIIUNICODEASCII_FG_FASTASCII_FASTUNICODE_FAST
CLAY_TB_TRANSPARENCY10
CLAY_TB_CELL_PIXELSwidthxheight
Building
Build the binary with cmake
mkdir build
cd build
cmake ..
make
Then run the executable:
./clay_examples_termbox2_demo
Attributions
Resources used:
512px-Shark_antwerp_zoo.jpeg- Retrieved from https://commons.wikimedia.org/wiki/File:Shark_antwerp_zoo.jpg
- License: Creative Commons Attribution 3.0 Unported
- No changes made