1.\" 2.\" Copyright (c) 2024 Netflix, Inc. 3.\" 4.\" SPDX-License-Identifier: BSD-2-Clause 5.\" 6.Dd February 6, 2024 7.Dt GFX.LUA 8 8.Os 9.Sh NAME 10.Nm gfx.lua 11.Nd Fx Lua gfx module 12.Sh DESCRIPTION 13The built-in graphics related Lua bindings for the 14.Fx 15boot loaders using the Lua interpreter are available via the 16.Ic gfx 17table. 18.Ss Exported Functions 19The following functions are exported in the 20.Nm loader 21table. 22.Bl -tag -width term_putimage 23.It Fn fb_bezier x0 y0 x1 y1 x2 y2 width 24Draw a bezier curve through the points 25.Pq Va x0 , Va y0 , 26.Pq Va x1 , Va y1 , 27and 28.Pq Va x2 , Va y2 29of width 30.Va width . 31The units are in pixels and have an origin of 32.Pq 0 , 0 . 33.It Fn fb_drawrect x0 y0 x1 y1 fill 34Fill in a rectangle with the pixel 35.Va fill 36with the corners 37.Pq Va x0 , Va y0 38and 39.Pq Va x1 , Va y1 . 40The units are in pixels and have an origin of 41.Pq 0 , 0 . 42.It Fn fb_line x0 y0 x1 y1 width 43Draw a line from 44.Pq Va x0 , Va y0 45to 46.Pq Va x1 , Va y1 47with a width of 48.Va width . 49The units are in pixels and have an origin of 50.Pq 0 , 0 . 51.It Fn fb_putimage name x0 y0 x1 y1 f 52Load the PNG file 53.Va name 54and place it in the rectangle 55with the corners 56.Pq Va x0 , Va y0 57and 58.Pq Va x1 , Va y1 59and fill with pixel 60.Va f . 61The units are in pixels and have an origin of 62.Pq 0 , 0 . 63.It Fn fb_set_pixel x y 64Sets the pixel at 65.Pq Va x , Va y . 66The units are in pixels and have an origin of 67.Pq 0 , 0 . 68.It Fn term_drawrect x0 y0 x1 y1 69Draw the outline of a rectangle with the text coordinate corners of 70.Pq Va x0 , Va y0 71and 72.Pq Va x1 , Va y1 . 73The units are in character cells and have an origin of 74.Pq 1 , 1 . 75.It Fn term_putimage name x0 y0 x1 y1 f 76Load the PNG file 77.Va name 78and place it in the rectangle 79with the text coordinate corners 80.Pq Va x0 , Va y0 81and 82.Pq Va x1 , Va y1 83and fill with pixel 84.Va f . 85The units are in character cells and have an origin of 86.Pq 1 , 1 . 87.El 88.Pp 89This table is optional and should only be used if it is non-nil and if 90.Fn core.isFramebufferConsole 91is true. 92.Ss Compatibility 93All the interfaces described above are also available via the 94.Ic loader 95table through at last FreeBSD 15.0. 96.Sh SEE ALSO 97.Xr loader.conf 5 , 98.Xr core.lua 8 , 99.Xr loader 8 , 100.Xr loader.lua 8 101.Sh AUTHORS 102The 103.Nm 104man page was written by 105.An Warner Losh Aq Mt imp@FreeBSD.org . 106 107