{"id":49184344,"url":"https://github.com/tinic/constixel","last_synced_at":"2026-04-23T03:07:43.403Z","repository":{"id":83216756,"uuid":"558088979","full_name":"tinic/constixel","owner":"tinic","description":"constixel is a single header minimalistic constexpr C++20 2D graphics rendering library","archived":false,"fork":false,"pushed_at":"2025-07-24T19:40:49.000Z","size":57431,"stargazers_count":28,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-25T00:54:30.620Z","etag":null,"topics":["consteval","constexpr","debugging","debugging-tool","debugging-tools","embedded","graphics","graphics-engine","graphics-library","header-only","header-only-library","render-engine","rendering","rendering-2d-graphics","rendering-engine","sixel","sixel-encoder","sixel-graphics","unit-testing","unit-tests"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-26T21:54:53.000Z","updated_at":"2025-07-24T19:40:53.000Z","dependencies_parsed_at":"2025-06-03T07:46:01.263Z","dependency_job_id":"687d3556-6163-4c5b-ae12-f244c3a2aa50","html_url":"https://github.com/tinic/constixel","commit_stats":null,"previous_names":["tinic/constixel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tinic/constixel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinic%2Fconstixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinic%2Fconstixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinic%2Fconstixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinic%2Fconstixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinic","download_url":"https://codeload.github.com/tinic/constixel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinic%2Fconstixel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32163870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T02:19:40.750Z","status":"ssl_error","status_checked_at":"2026-04-23T02:17:55.737Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consteval","constexpr","debugging","debugging-tool","debugging-tools","embedded","graphics","graphics-engine","graphics-library","header-only","header-only-library","render-engine","rendering","rendering-2d-graphics","rendering-engine","sixel","sixel-encoder","sixel-graphics","unit-testing","unit-tests"],"created_at":"2026-04-23T03:07:42.554Z","updated_at":"2026-04-23T03:07:43.394Z","avatar_url":"https://github.com/tinic.png","language":"C++","readme":"# constixel.hpp\n\n[![CMake on multiple platforms](https://github.com/tinic/constixel/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/tinic/constixel/actions/workflows/cmake-multi-platform.yml)\n[![CodeQL Advanced](https://github.com/tinic/constixel/actions/workflows/codeql.yml/badge.svg)](https://github.com/tinic/constixel/actions/workflows/codeql.yml)\n\nconstixel is a single header minimalistic constexpr C++20 palette based 2D graphics rendering library with the ability to output to a sixel image stream and png images which can be viewed in a modern terminal like Windows Terminal.\n\n##### Table of Contents  \n[Primary features and goals](#primary-features-and-goals)  \n[Applications](#applications)  \n[Requirements](#requirements)  \n[Minimal example](#minimal-example)  \n[Text drawing example](#text-drawing-example)  \n[Consteval sixel example](#consteval-sixel-example)  \n[Consteval image example](#consteval-embedded-image-data-example)  \n[Saving a PNG to a file example](#saving-a-png-to-a-file-example)  \n[API](#api)  \n\n## Primary features and goals\n\n- Completely constexpr. All graphics rendering, including generating the sixel output stream can happen during compilation.\n- No dynamic allocations. The backbuffer and the very few internal data structures can live as global static variables.\n- Minimalistic interface and single header implementation.\n- 1, 2, 4 and 8bit palette based back buffers for minimal memory usage. Reasonable standard palettes are provided. 24bit and 32bit back buffers are also provided if the target is something else than sixel.\n- Simple fill_rect(), fill_round_rect(), draw_line() and fill_circle() drawing functions among others.\n- Render proportional text, optionally with kerning, using pre-rendered font textures generated by a custom version of [fontbm](https://github.com/vladimirgamalyan/fontbm). Repository includes a set of pre-made (open source) fonts which are trivial to use. UTF-8 is supported.\n- An uncompressed png encoder is included to reduce dependencies.\n- Blit raw 32-bit RGBA image buffers into the palette based back buffer (with or without dithering). Also convert back into a RGBA buffer when needed.\n- Code is cpplint compliant, has a .clang-tidy profile, passes cppcheck and is of course consteval runnable.\n- Code compiles with \"-Wall -Wextra -Wpedantic -Weffc++ -Werror\" so it can be easily used in any existing C++ project without creating noise.\n- Resistance to unbound behavior (i.e. potential for DoS) when passing unreasonable values.\n- Various other simple image manipulation operations.\n\n\u003e [!NOTE]\n\u003e This library is not designed for high fidelity graphics generation and should be more thought of a utility library for software development purposes and embedded devices. Despite that, on HiDPI screens like on Macs the results generally look fairly good. If you want a high fidelity header only 2D C++ rendering library I recommend [canvas_ity](https://github.com/a-e-k/canvas_ity)\n\n## Applications\n\n- Interface rendering on embedded devices. Perfect to target monochrome or grayscale OLED screens or just to save memory when rendering to full RGB OLED screens.\n- Send graphical data to your terminal through a serial or ssh connections from embedded or remote devices.\n- Add graphical output to unit tests.\n- Programmatically render static graphical assets.\n- Help debug dynamic memory handling issues in complex C++ projects.\n- Add text overlays to RGBA8 buffers.\n- ...\n\n## Requirements\n\n- C++20, i.e. gcc 13.3 or newer, clang 16 or newer, MSVC 17 or newer\n- For viewing the sixel image you will need a sixel capable terminal. [Windows Terminal](https://github.com/microsoft/terminal), [iTerm2](https://iterm2.com/) on MacOS and [some](https://www.arewesixelyet.com/) Linux terminals will work. In Visual Studio Code sixel rendering can be enabled for all terminals using the ```\"terminal.integrated.enableImages\": true``` setting (Seems to be broken on Windows as of 4/2025, but works on MacOS and Linux). There is also an option to output to a [kitty](https://sw.kovidgoyal.net/kitty/graphics-protocol/) graphics enabled terminal.\n\n\u003e [!NOTE]\n\u003e The Terminal app on MacOS does not support sixel, please use iTerm2.\n\n\u003e [!NOTE]\n\u003e If you want to consteval either the sixel or image data you likely need to increase the constexpr ops limit. With g++ use '-fconstexpr-ops-limit=268435456' with clang use '-fconstexpr-steps=33554432'. The default limit in MSVC usually seems adequate.\n\n## Usage\n\nOption 1: Simply copy the header file to your project and include it. Optionally copy the fonts you want from the fonts directory.\n\nOption 2: If you prefer you can add this git repo as a cmake library:\n\n```find_package(constixel REQUIRED)\n...\nadd_subdirectory(constixel)\n...\ntarget_link_libraries([your target name] PRIVATE constixel::constixel)\n...\n```\n\nAfter that you can simply do this:\n\n```\n#include \"constixel/constixel.hpp\"\n#include \"constixel/fonts/[whatever font you want].hpp\"\n```\n\nDon't forget to enable C++20/23:\n\n```\nset(CMAKE_CXX_STANDARD 20)\n```\n\n## Minimal example\n\n```c++\n#define CONSTIXEL_ENABLE_COUT\n#include \"constixel.hpp\"\n\nint main() {\n    static constixel::image\u003cconstixel::format_8bit, 256, 256\u003e image;\n\n    for (int32_t y = 0; y \u003c 16; y++) {\n        for (int32_t x = 0; x \u003c 16; x++) {\n            image.fill_rect({.x = x * 16, .y = y * 16, .w = 16, .h = 16, \n                             .col = static_cast\u003cuint8_t\u003e(y * 16 + x)});\n        }\n    }\n\n    image.sixel_to_cout();\n}\n```\n\n![constixel](./media/constixel.jpg \"Example in iTerm\")\n\n## Text drawing example\n\nInclude a text font and pass the struct name as a template parameter to the draw_string function. The pre-made available fonts in this repo are viewable [here](./tests/constixel_fonts.png \"Fonts\"). More can be easily added/modified, for instance if you need more than just ASCII character ranges or want symbols/icons.\n\n```c++\n#define CONSTIXEL_ENABLE_COUT\n#include \"constixel.hpp\"\n#include \"fonts/ibmplexsans_medium_48_mono.hpp\"\nusing large_font = constixel::ibmplexsans_medium_48_mono;\n\nint main() {\n    using namespace constixel;\n\n    static constexpr std::array\u003cconst char *, 5\u003e strings {\n        \"ABCDEFGHIJKLM\", \"NOPQRTSUVWXYZ\", \"abcdefghijklm\", \"nopqrstuvwxyz\",\"1234567890\u0026@.,?!'\"\"\"\n    };\n\n    image\u003cformat_8bit, 512, 312\u003e image;\n    for (size_t i = 0; i \u003c strings.size(); i++) { \n        uint8_t col = color::GRAY_RAMP_STOP - static_cast\u003cuint8_t\u003e(i * 3);\n\n        image.draw_string_mono\u003clarge_font\u003e({.x = 16, .y = 48 * static_cast\u003cint32_t\u003e(i) + 16, \n                                            .str = strings.at(i), .col = col});\n    }\n\n    image.sixel_to_cout();\n}\n```\n\n![constixel](./media/constixel_text.jpg \"Example in iTerm\")\n\n## Consteval sixel example\n\nAs std::vector can not escape consteval (yet) so we use std::array. Output of this example should be \"Actual byte size: 18537\" and the sixel image. The binary will contain the evaluated sixel string.\n\nCompile as such (clang needs -fconstexpr-steps=33554432):\n\n```bash\n\u003e g++ -fconstexpr-ops-limit=268435456 -std=c++23 constixel.cpp -o constixel -Os\n```\n\n```c++\n#include \"constixel.hpp\"\n\n#include \u003ciostream\u003e\n#include \u003ccstring\u003e\n\nconsteval auto gen_sixel() {\n    constixel::image\u003cconstixel::format_8bit, 256, 256\u003e image;\n\n    for (int32_t y = 0; y \u003c 16; y++) {\n        for (int32_t x = 0; x \u003c 16; x++) {\n            image.fill_rect(x * 16, y * 16, 16, 16, static_cast\u003cuint8_t\u003e(y * 16 + x));\n        }\n    }\n\n    std::array\u003cchar, 32767\u003e sixel{};\n    char *ptr = sixel.data();\n    image.sixel([\u0026ptr](char ch) mutable {\n        *ptr++ = ch;\n    });\n    *ptr++ = '\\n';\n    *ptr++ = 0;\n\n    return sixel;\n}\n\nint main() {\n    static const auto sixel = gen_sixel();\n\n    std::cout \u003c\u003c \"Actual byte size: \" \u003c\u003c strlen(sixel.data()) \u003c\u003c \"\\n\";\n    std::cout \u003c\u003c sixel.data() \u003c\u003c std::endl;\n}\n```\n\n## Consteval embedded image data example\n\nThis example will consteval gen_image_1bit() into a std::array, while dynamically generating the sixel string.\n\n```c++\n#include \"constixel.hpp\"\n\n#include \u003ccstring\u003e\n\nconsteval auto gen_image_1bit() {\n    constixel::image\u003cconstixel::format_1bit, 256, 256\u003e image;\n    for (int32_t y = 0; y \u003c 16; y++) {\n        for (int32_t x = 0; x \u003c 16; x++) {\n            image.fill_rect(x * 16, y * 16, 16, 16, static_cast\u003cuint8_t\u003e(y + x) \u0026 1);\n        }\n    }\n    return image;\n}\n\nint main() {\n    static const auto image = gen_image_1bit();\n\n    printf(\"image width x height: %d %d x 1bit depth\\n\", int(image.width()), int(image.height()));\n    printf(\"image instance byte size: %d\\n\", int(image.size()));\n\n    size_t count = 0;\n    image.sixel([\u0026count](char ch) mutable {\n        putc(ch, stdout);\n        count++;\n    });\n    putc('\\n', stdout);\n\n    printf(\"sixel byte size: %d\\n\", int(count));\n}\n```\n\n![constixel](./media/constixel_1bit.jpg \"Example in iTerm\")\n\n## Saving a PNG to a file example\n\n```c++\n#include \"constixel.hpp\"\n#include \u003ciostream\u003e\n#include \u003cfstream\u003e\n\nint main() {\n    static constixel::image\u003cconstixel::format_8bit, 256, 256\u003e image;\n\n    for (int32_t y = 0; y \u003c 16; y++) {\n        for (int32_t x = 0; x \u003c 16; x++) {\n            image.fill_rect(x * 16, y * 16, 16, 16, static_cast\u003cuint8_t\u003e(y * 16 + x));\n        }\n    }\n\n    std::ofstream file(\"constixel.png\", std::ios::binary);\n    image.png([\u0026](char ch){ file.put(ch); });\n}\n\n```\n\n## API\n\nFull doxygen generated API docs are at [constixel.dev](https://constixel.dev)\n\nThe following image formats are available. [Width] is the width in pixels, [Height] is the height in pixels. [Grayscale] will set the palette to a grayscale palette with black being the first entry in the palette and white being the last entry in the palette. [UseSpan] allows to pass in an existing std::span/std::array to be used as a backbuffer if so desired.\n\n```c++\nconstixel::image\u003cconstixel::format_1bit,  [Width], [Height], [Unused=false],    [UseSpan=false]\u003e\nconstixel::image\u003cconstixel::format_2bit,  [Width], [Height], [Grayscale=false], [UseSpan=false]\u003e\nconstixel::image\u003cconstixel::format_4bit,  [Width], [Height], [Grayscale=false], [UseSpan=false]\u003e\nconstixel::image\u003cconstixel::format_8bit,  [Width], [Height], [Grayscale=false], [UseSpan=false]\u003e\nconstixel::image\u003cconstixel::format_24bit, [Width], [Height], [Unused=false],    [UseSpan=false]\u003e\nconstixel::image\u003cconstixel::format_32bit, [Width], [Height], [Unused=false],    [UseSpan=false]\u003e\n```\n\nA quick overview of some functionality of image, refer to the [full documention here](https://constixel.dev):\n\n```c++\n// Colors in the fixed internal palette\nenum color : uint8_t {\n    BLACK = 0,\n    BLACK_OPAQUE = 16,\n    WHITE = 1,\n    RED = 2,\n    GREEN = 3,\n    BLUE = 4,\n    YELLOW = 5,\n    CYAN = 6,\n    MAGENTA = 7,\n    GRAY_80 = 8,\n    GRAY_60 = 9,\n    GRAY_40 = 10,\n    GRAY_20 = 11,\n    DARK_RED = 12,\n    DARK_GREEN = 13,\n    DARK_BLUE = 14,\n    DARK_YELLOW = 15\n};\n\nclass image {\n    // Size in bytes of the image buffer\n    int32_t size();\n\n    // Width in pixel of the image buffer\n    int32_t width();\n\n    // Height in pixels of the image buffer\n    int32_t height();\n\n    // Return a reference to the internal pixel buffer\n    std::array\u003cuint8_t, T\u003cW, H, S\u003e::image_size\u003e \u0026data_ref();\n\n    // Return a clone of this image, data will be copied.\n    image\u003cT, W, H, S, GR\u003e clone();\n\n    // Clear the image, i.e. set everything to color 0\n    void clear();\n\n    // Copy another image into this instance. Overwrites the contents, no compositing occurs.\n    void copy(const image\u003cT, W, H, S, GR\u003e \u0026src);\n\n    // Draw monochrome utf8 text. #include a monochrome font and specify the included struct as the template parameter.\n    // Rotation can be 0, 90, 180 or 270 degrees\n    // Returns the current x caret position in pixels.\n    template \u003ctypename FONT, bool KERNING = false, ROTATION = DEGREE_0\u003e\n    constexpr int32_t draw_string_mono(int32_t x, int32_t y, const char *str, uint8_t col);\n\n    // Draw smoothed utf8 text. #include a antialiased font and specify the included struct as the template parameter.\n    // Rotation can be 0, 90, 180 or 270 degrees\n    // Returns the current x caret position in pixels.\n    // NOTE: This only works with constixel::format_8bit/constixel::format_32bit images\n    template \u003ctypename FONT, bool KERNING = false, ROTATION = DEGREE_0\u003e\n    constexpr int32_t draw_string_aa(int32_t x, int32_t y, const char *str, uint8_t col);\n\n    // Get the width of a utf8 string in pixels. #include a monochrome or antialiased font and specify the included struct as the template parameter\n    template \u003ctypename FONT, bool KERNING = false\u003e\n    constexpr int32_t string_width(const char *str);\n\n    // Draw a line\n    void draw_line(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint8_t col, uint32_t stroke_width = 1);\n\n    // Draw an 1-pixel wide antialiased line with the specified color and thickness.\n    // NOTE: This only works with constixel::format_8bit/constixel::format_32bit images\n    void draw_line_aa(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint8_t col);\n\n    // Draw a filled rectangle\n    void fill_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t col);\n\n    // Draw a stroked rectangle\n    void stroke_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t col, int32_t stroke_width = 1);\n\n    // Draw a rounded rectangle\n    void fill_round_rect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint8_t col);\n\n    // Draw a stroked rounded rectangle\n    void stroke_round_rect(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint8_t col, int32_t stroke_width = 1);\n\n    // Draw a rounded rectangle with antialiasing\n    // NOTE: This only works with constixel::format_8bit/constixel::format_32bit images\n    void fill_round_rect_aa(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint8_t col);\n\n    // Draw a stroked rounded rectangle\n    // NOTE: This only works with constixel::format_8bit/constixel::format_32bit images\n    void stroke_round_rect_aa(int32_t x, int32_t y, int32_t w, int32_t h, int32_t radius, uint8_t col, int32_t stroke_width = 1);\n\n    // Draw a filled circle\n    void fill_circle(int32_t x, int32_t y, int32_t radius, uint8_t col);\n\n    // Draw a filled circle with antialiasing\n    // NOTE: This only works with constixel::format_8bit images\n    void fill_circle_aa(int32_t x, int32_t y, int32_t radius, uint8_t col);\n\n    // Get closest matching color in the palette for given rgb values\n    uint8_t get_nearest_color(uint8_t r, uint8_t g, uint8_t b);\n\n    // Get a populated RGBA buffer with the contents of this instance.\n    // Color 0 is special and will be set to 0x0000000 in the returned buffer, \n    // while all the other colors will be converted to a 0xffBBGGRR format.\n    std::array\u003cuint32_t, W * H\u003e RGBA_uint32();\n    std::array\u003cuint8_t, W * H * 4\u003e RGBA_uint8();\n\n    // Flip the contents of this image horizontally\n    void flip_h();\n\n    // Flip the contents of this image vertically\n    void flip_v();\n\n    // Flip the contents of this image horizontally\u0026vertically\n    void flip_hv();\n\n    // Return a transposed version of this image\n    template \u003cbool FLIP_H = false, bool FLIP_V = false\u003e\n    image\u003cT, H, W, S, GR\u003e transpose();\n\n    // transpose this image into another\n    template \u003cbool FLIP_H = false, bool FLIP_V = false\u003e\n    transpose(image\u003cT, H, W, S, GR\u003e \u0026dst);\n\n    // Blit an RGBA (little endian) buffer into this instance. Colors are quantizied to the internal palette. \n    // NOTE: This is a slow operation due to the brute force color quantization and will likely not consteval.\n    void blit_RGBA(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n    void blit_RGBA(const rect\u003cint32_t\u003e \u0026r, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n\n    // Blit an RGBA (little endian) buffer into this instance using line diffusion for better quality.\n    // NOTE: This is a slow operation due to the brute force color quantization and will likely not consteval.\n    void blit_RGBA_diffused(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n    void blit_RGBA_diffused(const rect\u003cint32_t\u003e \u0026r, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n\n    // Blit an RGBA (little endian) buffer into this instance using line diffusion in linear color space for best quality.\n    // NOTE: This is a very slow operation due to the brute force color quantization and will likely not consteval.\n    void blit_RGBA_diffused_linear(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n    void blit_RGBA_diffused_linear(const rect\u003cint32_t\u003e \u0026r, const uint8_t *ptr, int32_t iw, int32_t ih, int32_t stride);\n\n    // Generate an uncompressed png file. Provide a lambda function in the form of:\n    //\n    // image.png([](char ch) {\n    //    [do something with the character]\n    // });\n    //\n    void png(F \u0026\u0026charOut);\n\n    // Convert the current instance into a sixel stream. Provide a lambda function in the form of:\n    //\n    // image.sixel\u003c[scale factor]\u003e([](char ch) {\n    //    [do something with the character]\n    // });\n    //\n    // Optionally you can provide a rectangle to get a portion of the image only.\n    //\n    template\u003cSCALE_FACTOR = 1\u003e\n    void sixel(F \u0026\u0026charOut);\n    template\u003cSCALE_FACTOR = 1\u003e\n    void sixel(F \u0026\u0026charOut, const constixel::rect\u003cint32_t\u003e \u0026r);\n\n    // Convert the current instance into a sixel stream and output it to std::cout\n    template\u003cSCALE_FACTOR = 1\u003e\n    void sixel_to_cout();\n\n    // Convert the current instance into a png and display it in iTerm\n    void png_to_iterm();\n\n    // Convert the current instance into a png and display it in a terminal with kitty graphics support\n    void png_to_kitty();\n\n    // Send a escape command to std::cout to clear the screen of a vt100 compatible terminal.\n    void vt100_clear();\n    // Send a escape command to std::cout to home the cursor of a vt100 compatible terminal.\n    void vt100_home();\n\n    /*! Data formats for the convert functions */\n    enum device_format {\n        STRAIGHT_THROUGH,     /*!\u003c Just copy the data as is. */\n        RGB565_8BIT_SERIAL,   /*!\u003c RGB565 pixel data is stored from left to right, each two bytes containing 1 pixel value in the x direction.\n                                   Byte encoding: 0xRRRRRGGG 0xGGGBBBBB */\n        RGB666_8BIT_SERIAL_1, /*!\u003c RGB565 pixel data is stored from left to right, each three bytes containing 1 pixel values in the x direction.\n                                   Byte encoding: 0x00RRRRRR 0x00GGGGGG 0x00BBBBBB */\n        RGB666_8BIT_SERIAL_2  /*!\u003c RGB565 pixel data is stored from left to right, each three bytes containing 1 pixel values in the x direction.\n                                   Byte encoding: 0xRRRRRR00 0xGGGGGG00 0xBBBBBB00 */\n    };\n\n    // Convert the current instance into a byte stream formatted for embedded displays.\n    void convert\u003cdevice_format\u003e(F \u0026\u0026char_out);\n    bool convert_chunk\u003cdevice_format\u003e(char *dst, size_t chunk_size, size_t \u0026chunk_actual, size_t \u0026chunk_index);\n\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinic%2Fconstixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinic%2Fconstixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinic%2Fconstixel/lists"}