cega 0.1.3

CGA and EGA binary image file processing library
Documentation

cega

CGA/EGA graphics binary file parsing for Rust

Crates.io Crates.io License License Contributors

Warning

This is currently very much in an alpha state. Output to a usable file format is not currently implemented. It's currently a preview tool that uses ANSI escape codes for a terminal view and SDL2 for a gui preview window.

Usage

This can be used as a library or executable. Pending finalizing internal API I'll demonstrate the CLI usage instead (check main.rs for how to call etc). Actual --help from CLI will always be up to date even if the docs aren't.

The binary handles arguments (and thus help) via clap 4

Usage: cega [OPTIONS] <IMAGE>

Arguments:
  <IMAGE>  

Options:
  -t, --terminal-output <TERMINAL_OUTPUT>
          [possible values: a, c, p, h]
          a = plain ascii
          c = colored ascii
          p = full pixels via ansi bg color
          h = horizontal half pixels
          Images may be wider than terminal and will then crop
  -p, --palette [<PALETTE>]
          ega palette can be used for cga, but not the inverse
           [default: ega] [possible values: cga0, cga0i, cga1, cga1i, ega]
  -i, --image-parser <IMAGE_PARSER>
          [default: cga] [possible values: ega_row_planar, erp, cga]
  -c, --custom-ascii <CUSTOM_ASCII>
          4 chars palette like -a " +%0"
  -w, --width <WIDTH>
          
  -m, --max-width <MAX_WIDTH>
          [default: 320]
  -r, --retile-height <RETILE_HEIGHT>
          
  -s, --sdl
          
  -q, --quiet
          
  -h, --help
          Print help
  -V, --version
          Print version

cega can parse tiled/spritesheet style cga and output "pixels" to the terminal

cega ../../assets/game/CGATILES.BIN -w 16 -r 16 -i cga -t p:

cega will output some suggestions, like if it's not a CGA fullscreen image, but you don't specify tiling:

cega ../../assets/game/CGATILES.BIN -t a:

cega will ouput in different preview formats, such as colored ASCII or a gui window:

cega ../../assets/game/CGATILES.BIN -w 16 -r 16 -i cga -t c -c "1234" -s:

Acknowledgements & References