{"id":25026084,"url":"https://github.com/nicolasbauw/blitter","last_synced_at":"2025-07-06T14:40:56.640Z","repository":{"id":57517951,"uuid":"235381836","full_name":"nicolasbauw/blitter","owner":"nicolasbauw","description":"Yet another bitmap blitting library for Rust.","archived":false,"fork":false,"pushed_at":"2021-08-14T13:23:01.000Z","size":107,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-15T03:55:11.182Z","etag":null,"topics":["bitmap","blit","blitter","blitting","framebuffer","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/nicolasbauw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-01-21T15:58:19.000Z","updated_at":"2023-11-18T19:25:13.000Z","dependencies_parsed_at":"2022-09-26T18:01:33.624Z","dependency_job_id":null,"html_url":"https://github.com/nicolasbauw/blitter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolasbauw%2Fblitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolasbauw%2Fblitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolasbauw%2Fblitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolasbauw%2Fblitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolasbauw","download_url":"https://codeload.github.com/nicolasbauw/blitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710438,"owners_count":21149188,"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":["bitmap","blit","blitter","blitting","framebuffer","rust"],"created_at":"2025-02-05T17:19:02.568Z","updated_at":"2025-04-13T11:51:13.870Z","avatar_url":"https://github.com/nicolasbauw.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blitter\n\n[![Current Crates.io Version](https://img.shields.io/crates/v/blitter.svg)](https://crates.io/crates/blitter)\n[![Downloads badge](https://img.shields.io/crates/d/blitter.svg)](https://crates.io/crates/blitter)\n\nThis library performs various blitting and drawing operations on a raw 32 bits framebuffer, whatever the encoding.\n- Bitmap blitting / cropping\n- Blit a part of bitmap (ie. bitmap fonts)\n- Blit with a color or bits mask\n- Pixel plotting\n- Optional PNG decoding feature\n\nExample:\n```\n// Framebuffer initialization\nlet mut pixels: Vec\u003cu32\u003e = vec!(0; WIDTH * HEIGHT);\nlet mut fb = Framebuffer {width: WIDTH, height: HEIGHT, pixels: \u0026mut pixels};\n\n// For example, you can push all the bitmaps in a single vec to give ownership of all bitmaps\nlet mut bitmaps = Vec::new();\nbitmaps.push(Bitmap {w: 10, h: 10, x: 0, y: 0, pixels: \u0026image::PIXELS});\n\nwhile *display loop with some display library* {\n    blitter_test(\u0026mut fb, \u0026mut bitmaps);\n    *your display lib display update function with buffer \u0026fb.pixels*\n}\n\n// For testing : moves a 10x10 square and prints a 4x4 pixel at the center of the screen\nfn blitter_test(mut fb: \u0026mut Framebuffer, bitmaps: \u0026mut Vec\u003cBitmap\u003e) {\n    fb.clear_area(640, 10, 0, 0, 0).unwrap();\n    bitmaps[0].blit(\u0026mut fb).unwrap();   //copies a bitmap to the framebuffer\n    if bitmaps[0].x \u003c WIDTH - 10 { bitmaps[0].x = bitmaps[0].x+3; } else { fb.clear(0); }\n    fb.draw_fatpixel(320,240,4,0xffffffff).unwrap();\n}\n```\n\nYou can also view and run some (very basic) examples using the [minifb library](https://crates.io/crates/minifb) in the 'examples' directory:\n```\ncargo run --example demo --features=\"png-decode\"\ncargo run --example minifb --features=\"png-decode\"\ncargo run --example square\n```\n\n[![Screenshot](resources/screenshot.png)]\n\nLicense: MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasbauw%2Fblitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolasbauw%2Fblitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolasbauw%2Fblitter/lists"}