{"id":22562222,"url":"https://github.com/max1220/lfb","last_synced_at":"2025-08-19T23:07:30.785Z","repository":{"id":101936888,"uuid":"55278635","full_name":"max1220/lfb","owner":"max1220","description":"Lua framebuffer binding(Using ioctl \u0026 /dev/fb*)","archived":false,"fork":false,"pushed_at":"2018-03-08T21:47:09.000Z","size":188,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T10:47:34.707Z","etag":null,"topics":["drawing","drawing-library","framebuffer","lua"],"latest_commit_sha":null,"homepage":null,"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/max1220.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}},"created_at":"2016-04-02T05:02:23.000Z","updated_at":"2024-04-02T17:40:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"5eed57cb-55e3-4e4a-a07d-e9e1d9da6f43","html_url":"https://github.com/max1220/lfb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/max1220/lfb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flfb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flfb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flfb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flfb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/max1220","download_url":"https://codeload.github.com/max1220/lfb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max1220%2Flfb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271236280,"owners_count":24723978,"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-08-19T02:00:09.176Z","response_time":63,"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":["drawing","drawing-library","framebuffer","lua"],"created_at":"2024-12-07T22:12:08.136Z","updated_at":"2025-08-19T23:07:30.753Z","avatar_url":"https://github.com/max1220.png","language":"C","readme":"lfb\n===\n\nBinding to Linux Framebuffers, using no external dependencys.\n\n\n\nInstall\n-------\n\n`make`\n\nThere is no installation, just copy the lfb.so file to where ever you need it.\nYou can check where lua looks for modules with: `lua -e \"print(package.cpath:gsub(';', '\\n'):gsub('?', '[filename]'))\"`\n\n\n\nUsage\n-----\n\nSince version 1.0 lfb uses a buffer for all drawing operations that is then drawn to the framebuffer.\nDon't expect compability with versions \u003c 1.\n\nlfb coordinates start at 0,0 and go to width-1,height-1. r,g,b are in the range 0-255.\n\n\n\ncommand                         | description\n------------------------------- | -----------\nlfb.version()                   | Version string\nfb = lfb.new_framebuffer(fbdev) | Creates a new framebuffer userspace object \u0026 returns it. fbdev is a string, for example \"/dev/fb0\"\ndb = lfb.new_drawbuffer(w,h)    | Creates a new drawing buffer.\n\ncommand               | description\n--------------------- | -----------\nfb:get_varinfo()      | Get variable info in a table (See http://lxr.free-electrons.com/source/include/uapi/linux/fb.h#L240)\nfb:get_fixinfo()      | Get fixed info in a table (See http://lxr.free-electrons.com/source/include/uapi/linux/fb.h#L156)\nfb:set_varinfo(vinfo) | Sets variable info (Variable names are as in getvarinfo; You don't need to specify all of them, only the ones you want to change)\nfb:close()            | Closes the framebuffer\nfb:__tostring()       | Returns an identifier for the framebuffer device (For example: \"Framebuffer: /dev/fb0 (inteldrmfb)\")\n\ncommand                          | description\n-------------------------------- | -----------\ndb.width                         | Width\ndb.height                        | Height\nr,g,b,a = db:get_pixel(x,y)      | Gets r,g,b,a at x,y\ndb:set_pixel(x,y,r,g,b,a)        | Sets x,y to r,g,b,a\ndb:set_rect(x,y,w,h,r,g,b,a)     | Fills the rectangle specified via x,y,w,h to r,g,b,a\ndb:set_box(x,y,w,h,r,g,b,a)      | Draws the outline of the rectangle w,h at x,y in r,g,b,a\ndb:set_line(x0,y0,x1,y1,r,g,b,a) | Draws a line from x0,y0 to x1,y1 in r,g,b,a\ndb:clear(r,g,b,a)                | Fill with r,g,b,a\ndb:pixel_function(function(x,y,r,g,b,a) return r,g,b,a end) | Execute a function for each pixel in db that should return the new r,g,b,a values at x,y\ndb:draw_to_framebuffer(fb, x, y) | Draws db to the fb at x,y\ndb:draw_to_drawbuffer(tdb, tx, ty, ox, oy, w, h)  | Draws db to tdb at tx,ty. ox,oy is the offset in the origin drawbuffer. w,h set the area to draw.\n\n\n\n\nExamples\n--------\nSee examples/ folder.\n\n\n\n\nScreenshots\n-----------\n\n##examples/colors.lua##\n![colors example](https://raw.githubusercontent.com/max1220/lfb/master/screenshots/colors.png)\n\n\n##examples/spin.lua##\n![spin example](https://raw.githubusercontent.com/max1220/lfb/master/screenshots/spin.png)\n\n\n##examples/rect_benchmark.lua##\n![rectangle benchmark example](https://raw.githubusercontent.com/max1220/lfb/master/screenshots/rect_benchmark.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax1220%2Flfb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax1220%2Flfb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax1220%2Flfb/lists"}