Stipje reads XPM-style image strings and converts them to 32-bit pixel buffers at compile-time.
Several image formats are included as well, to (at runtime) output images in PNM, PAM or true-color console block drawing characters. Other formatters can be trivially added.
Requirements:
- GCC 8 for experimental c++2a support
- Kvasir MPL for metaprogramming assistance
#include "stipje.hh"
#include <iostream>
int main() {
constexpr auto example =
" "
" ooooooo "
" o o #### ##### # ##### # ###### "
" o # o # # # # # # # "
" o # o #### # # # # # ##### "
" o ### o # # # ##### # # "
" o o # # # # # # # # "
" ooooooo #### # # # #### ###### o "
" "_stipje
(" 00000000" // rgba
"o ff0000ff"
"# ffffffff"_stipje_palette,
uint_<49> {}, // width
uint_< 9> {}, // height
stipje::pixel_format::rgba{});
stipje::format(std::cout, example, stipje::image_format::console256_squared{});
return 0;
}
g++ -Impl/src/kvasir -std=c++2a -Os -o example example.cc ./example
More docs to be written later :-)