{"id":21747330,"url":"https://github.com/mpaland/vic","last_synced_at":"2025-07-03T07:37:30.554Z","repository":{"id":17355613,"uuid":"20127208","full_name":"mpaland/vic","owner":"mpaland","description":"High performance video graphic library for embedded systems","archived":false,"fork":false,"pushed_at":"2020-04-02T17:42:24.000Z","size":3803,"stargazers_count":36,"open_issues_count":6,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T06:53:22.500Z","etag":null,"topics":["alpha-numeric-displays","antialiasing","c-plus-plus","display-driver","driver","gradient","graphics","graphics-library","graphics-primitives","sprites","video"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpaland.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}},"created_at":"2014-05-24T10:31:52.000Z","updated_at":"2025-03-29T21:27:03.000Z","dependencies_parsed_at":"2022-08-07T08:15:57.322Z","dependency_job_id":null,"html_url":"https://github.com/mpaland/vic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mpaland/vic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpaland%2Fvic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpaland%2Fvic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpaland%2Fvic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpaland%2Fvic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpaland","download_url":"https://codeload.github.com/mpaland/vic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpaland%2Fvic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263284293,"owners_count":23442510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["alpha-numeric-displays","antialiasing","c-plus-plus","display-driver","driver","gradient","graphics","graphics-library","graphics-primitives","sprites","video"],"created_at":"2024-11-26T08:08:39.803Z","updated_at":"2025-07-03T07:37:30.515Z","avatar_url":"https://github.com/mpaland.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Interface Controller library\r\n#### VIC is an universal, lightweight, extremly fast and powerful C++ library for driving graphic, dot, alpha numeric and seven-segment displays.\r\n\r\n\r\n**The VIC lib is beta and still under heavy development. If you have specific questions, do not hesitate to contact me!  \r\nv0.3.0 with major design improvements is coming up!**\r\n\r\n## Highlights\r\n- Universal library for graphic and alpha numeric displays\r\n- HEADER ONLY implementation, no module compilation\r\n- Platform and CPU independent code, NO dependencies, NO STL, NO new/delete, NO `float` - just clean and pure C++11\r\n- Platform independent driver design, the very same low level display driver runs everywhere\r\n- High performance primitive rendering of lines, circles, triangles, boxes, text etc.\r\n- Support of advanced controls like gauges, bars, (radio) buttons, checkboxes etc.\r\n- Support of unlimited number of sprites for moving objects\r\n- Multiple heads support, as many displays as you may like in one system\r\n- Multihead driver, combine any number of (even different) single displays to one big display\r\n- Support of various color formats from 1 to 32 bpp displays\r\n- Support for different font formats (proportional, monospace), ASCII/UTF-8 support\r\n- Brush shape support for line drawing\r\n- Antialiasing support for smooth primitive and text/font rendering\r\n- Framebuffer and viewport support\r\n- Clipping region support\r\n- Gradient color rendering support\r\n- Alpha blending support\r\n- NO floating point math, only fast integer operations\r\n- VERY clean and stable C++ code, LINT and L4 warning free, automotive ready\r\n- Very easy to use and fast implemention of own/new display drivers\r\n- Doxygen commented code\r\n- MIT license\r\n\r\n## What is VIC NOT?\r\nVIC is not meant to be a full bloated window manager, widgets, dialogs, theme rendering framework.\r\nIf you need an advanced windowed GUI, there are many other cool libraries around, like µC/GUI, StWin etc.\r\n\r\n## To be done (and implemented)\r\n- Improve anti aliasing support\r\n- Sprite support\r\n- Add more standard and high quality fonts\r\n\r\n\r\n## Design of VIC\r\nBasicly every display needs a driver. But unlike as in many other designs, the driver is the highest class of which the head\r\n(display) is instanciated.\r\nA graphic driver only needs to implement `drv_pixel_set_color` and `drv_pixel_get` functions. But most modern\r\ndisplay controllers can provide more sophisticated functions for native line/box rendering, block moving etc.\r\nIf a controller can provide such special functions, the according function is implemented in the driver by simply overriding the virtual function of the `gpr` base class.\r\nAll graphic functions which the controller/driver can't provide natively are handled by the `gpr`.\r\nOf cource, native rendering on a specialized LCD controller is always faster and should be prefered.\r\n\r\n\r\n## Class design\r\n![](https://cdn.rawgit.com/mpaland/vic/master/doc/vgxlib.svg)\r\n\r\n### base\r\nThe base class provides common functions.\r\n\r\n### gpr\r\nThe Graphic Primitive Renderer provides fast rendering functions for graphic primitives.\r\nThe `gpr` doesn't use any floating point math, only fast integer operations.\r\nFurthermore the `gpr` should be a collection of reference implementations of the most modern, fast and reliable primitive rendering algorithms.\r\nSo, if you find any errors, have speed improvements or even a better algorithm for some primitives - **please** share and\r\ncontribure!\r\n\r\n### txr\r\nThe Text Renderer is responsible for rendering text fonts on graphic displays. It supports monospaced and proportional fonts.\r\n\r\n### drv\r\nThe base class of the head driver which adds some mandatory driver routines.\r\nAll color calculations are done in ARGB 32 bit format. If a display has less colors, like 15 bit RGB, the specific driver\r\nclass is responsible for color reduction. Conversion routines provides the `drv` class.\r\n\r\n### head\r\nThe specific display driver. A display together with its controller is referenced here as `head`. And `head` is the namespace of all specific drivers.\r\nAll virtual functions of the `gpr` and `drv` are overridden here.\r\n\r\n### ctrl\r\nThe base class for advanced controls like gauges, progress bars, checkboxes, buttons etc.\r\n\r\n\r\n## Usage\r\nUsing VIC is really easy and fun.\r\nIn a single head design (just one display in the system) you create your head first by instancing the according driver.\r\nE.g. on a Windows (emulation/test) platform this would be:\r\n```c++\r\n// Create a screen of 240 * 120 pixel with a viewport of the same size (240 * 120)\r\n// The viewport has an offset of 0,0 and the window is placed at 100,100 on the windows desktop\r\n// For development convinience a horizontal and vertical zoom factor of 4 is selected\r\nvíc::head::windows\u003c240,120,240,120\u003e _head(0, 0, 100, 100, 4, 4);\r\n_head.init();  // explicit head init\r\n```\r\n\r\nNow you can perform any operations on the head:\r\n```c++\r\n_head.pen_set_color(vic::color::brightblue);  // select bright blue drawing color\r\n_head.line(10, 10, 40, 40);                   // draw a line from 10,10 to 40,40\r\n\r\n// write some text\r\n_head.pen_set_color(vic::color::yellow);\r\n_head.text_set_font(vic::font::arial_num_16x24_aa4);\r\n_head.text_string_pos(10, 50, (const std::uint8_t*)\"12,34.56-7890\");\r\n```\r\n\r\nIf you need multiple displays in your design, we are talking about a \"multiple heads\" scenario. All heads are independent.\r\nLet's create two independent heads:\r\n```c++\r\nvic::head::windows\u003c240,120,240,120\u003e _head0(0, 0, 0,  00, 2, 2);\r\nvic::head::windows\u003c240,120,240,120\u003e _head1(0, 0, 0, 200, 2, 2);\r\n_head0.init();  // explicit head 0 init\r\n_head1.init();  // explicit head 1 init\r\n```\r\nUsing head 0:\r\n```c++\r\n_head0.pen_set_color(vic::color::brightblue);\r\n_head0.line(10, 10, 40, 40);\r\n```\r\nAnd using head 1 (eg. for system debug, status. etc):\r\n```c++\r\nhead1.pen_set_color(vic::color::red);\r\nhead1.box(100, 100, 120, 120);\r\n```\r\n\r\nOr you can combine multiple single displays to one big screen. It's a common way to create big screens out of single modules.\r\nThis is done by using the `multihead` driver.\r\n```c++\r\n// Create 3 MAX7219 heads with a rotation of 90° on SPI device ID 1,2 and 3\r\n// The single heads have a resolution of 8 * 8 pixels\r\nvic::head::MAX7219\u003c8U, 8U\u003e _head0(drv::orientation_90, 1U);\r\nvic::head::MAX7219\u003c8U, 8U\u003e _head1(drv::orientation_90, 2U);\r\nvic::head::MAX7219\u003c8U, 8U\u003e _head2(drv::orientation_90, 3U);\r\n// Create the multihead out of the three heads with offsets of 0, 8 and 16 pixels\r\n// So the multihead has a srceen resolution of 24 * 8 pixels\r\nvic::head::multihead\u003c24U, 8U, 3U\u003e _multihead = { {_head0, 0U, 0U}, {_head1, 8U, 0U}, {_head2, 16U, 0U} };\r\n\r\n// Now, use the multihead like a normal head\r\n_multihead.line(0, 0, 23, 7);\r\n```\r\n\r\n\r\n## License\r\nvic is written under the MIT licence.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpaland%2Fvic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpaland%2Fvic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpaland%2Fvic/lists"}