4.10. libcaca – Color ASCII Art library

4.10. `libcaca` – Color ASCII Art library
上一页 | 第 4 章 Video output devices | 下一页

## 4.10. `libcaca` – Color ASCII Art library

The `libcaca` library is a graphics library that outputs text instead of pixels, so that it can work on older video cards or text terminals. It is not unlike the famous `AAlib` library. `libcaca` needs a terminal to work, thus it should work on all Unix systems (including Mac OS X) using either the `slang` library or the `ncurses` library, on DOS using the `conio.h` library, and on Windows systems using either `slang` or `ncurses` (through Cygwin emulation) or `conio.h`. If `./configure` detects `libcaca`, the caca libvo driver will be built.

The differences with `AAlib` are the following:

- 16 available colors for character output (256 color pairs)

- color image dithering

But `libcaca` also has the following limitations:

- no support for brightness, contrast, gamma

You can use some keys in the caca window to change rendering options:

Key | Action
--- | ---
d | Toggle `libcaca` dithering methods.
a | Toggle `libcaca` antialiasing.
b | Toggle `libcaca` background.

`libcaca` will also look for certain environment variables:

`CACA_DRIVER`

  Set recommended caca driver. e.g. ncurses, slang, x11.

`CACA_GEOMETRY (X11 only)`

  Specifies the number of rows and columns. e.g. 128x50.

`CACA_FONT (X11 only)`

  Specifies the font to use. e.g. fixed, nexus.

Use the `-framedrop` option if your computer is not fast enough to render all frames.

上一页 | 上一级 | 下一页
4.9. AAlib – text mode displaying | 起始页 | 4.11. VESA - output to VESA BIOS