{"id":30694692,"url":"https://github.com/dempfi/embedded-rgba","last_synced_at":"2025-09-02T06:44:02.001Z","repository":{"id":310607997,"uuid":"1040517369","full_name":"dempfi/embedded-rgba","owner":"dempfi","description":"A lightweight, no_std RGBA framebuffer, canvas with alpha compositing for embedded-graphics ecosystem","archived":false,"fork":false,"pushed_at":"2025-08-29T05:14:48.000Z","size":131,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-29T07:38:11.045Z","etag":null,"topics":["embedded-graphics","embedded-rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dempfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-08-19T05:25:06.000Z","updated_at":"2025-08-29T05:14:51.000Z","dependencies_parsed_at":"2025-08-19T07:21:33.779Z","dependency_job_id":"f9eb560b-fcd3-48c1-8af9-bbb0b4809965","html_url":"https://github.com/dempfi/embedded-rgba","commit_stats":null,"previous_names":["dempfi/embedded-rgba"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dempfi/embedded-rgba","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fembedded-rgba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fembedded-rgba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fembedded-rgba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fembedded-rgba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dempfi","download_url":"https://codeload.github.com/dempfi/embedded-rgba/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dempfi%2Fembedded-rgba/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244302,"owners_count":25070959,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["embedded-graphics","embedded-rust"],"created_at":"2025-09-02T06:44:01.303Z","updated_at":"2025-09-02T06:44:01.974Z","avatar_url":"https://github.com/dempfi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Embedded RGBA](./docs/demo.png)\n\n# embedded-rgba\n\nA lightweight, no_std RGBA framebuffer and canvas abstraction for the [`embedded-graphics`](https://github.com/embedded-graphics/embedded-graphics) ecosystem. It adds **alpha blending**, **buffering strategies**, and a practical way to manage drawing pipelines on microcontrollers and resource‑constrained devices.\n\nCheck out the [MiniType](http://github.com/dempfi/minitype) for a font format that takes full advantage of RGBA canvas.\n\n## ✨ Features\n\n- ✅ **Alpha blending** – draw `Rgba` pixels onto RGB framebuffers with fast per‑pixel transparency.\n- ✅ **Flexible buffering** – choose between **double buffering**, **single buffering**, or **scanline buffering (coming soon)** depending on memory and performance tradeoffs.\n- ✅ **Drop‑in integration** with `embedded-graphics`’s `DrawTarget` and `PixelColor`.\n- ✅ **No heap allocation** – designed for MCUs without a heap.\n- ✅ **Optimized for speed** – fast fill paths and alpha blending.\n\n## 🚀 Usage\n\n### Create a canvas\n\n```rust\nuse embedded_rgba::Canvas;\nuse embedded_graphics::mock_display::MockDisplay;\nuse embedded_graphics::pixelcolor::Rgb565;\n\nlet display = MockDisplay::new();\n\n// Create a double buffered canvas\nlet mut canvas = Canvas::\u003c_, _, {240 * 320}, 240, 320\u003e::double_buffered(display);\n// or a single buffer\nlet mut canvas = Canvas::\u003c_, _, {240 * 320}, 240, 320\u003e::single_buffered(display);\n```\n\n### ✨ Draw with Rgba colors\n\n```rust\n// `Rgba` is a normal embedded_graphics color\nlet transparent_orange = Rgba::new(Rgb565::CSS_ORANGE, 128);\nlet style = PrimitiveStyleBuilder::new().fill_color(transparent_orange).build();\n// `canvas.alpha()` is a temporary draw target that can be drawn onto with `Rgba` color\nRectangle::new(Point::zero(), Size::new(50, 50)).draw_styled(\u0026style, \u0026mut canvas.alpha())?;\n// Commit the update pixels to the display\ncanvas.flush().unwrap();\n```\n\n## 📊 When to use which buffer?\n\n- **Double buffer** → flicker‑free updates, at the cost of RAM (2 full framebuffers).\n- **Single buffer** → less RAM, may tear if drawn while refreshing.\n- **Line buffer** → minimal RAM (1 row), best for preplanned scanline rendering.\n\n## 🔮 Roadmap\n\n- [ ] SIMD‑style blending optimizations for all RGB colors\n- [ ] Region‑based dirty rectangle updates\n- [ ] Line buffer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdempfi%2Fembedded-rgba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdempfi%2Fembedded-rgba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdempfi%2Fembedded-rgba/lists"}