cjsmeele / Stipje
Programming Languages
Projects that are alternatives of or similar to Stipje
#+TITLE: Stipje, like XPM images, but C++-style #+AUTHOR: Chris Smeele
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.
** Synopsis
Requirements:
- GCC 8 for experimental c++2a support
- Kvasir MPL for metaprogramming assistance
#+BEGIN_SRC C++ #include "stipje.hh" #include
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;
} #+END_SRC
: g++ -Impl/src/kvasir -std=c++2a -Os -o example example.cc : ./example
[[./example.png]]
More docs to be written later :-)