Copyright (c) 2024 Netflix, Inc.

SPDX-License-Identifier: BSD-2-Clause

.Dd February 6, 2024 .Dt GFX.LUA 8 .Os .Sh NAME .Nm gfx.lua .Nd Fx Lua gfx module .Sh DESCRIPTION The built-in graphics related Lua bindings for the .Fx boot loaders using the Lua interpreter are available via the c gfx table. .Ss Exported Functions The following functions are exported in the .Nm loader table. l -tag -width term_putimage t Fn fb_bezier x0 y0 x1 y1 x2 y2 width Draw a bezier curve through the points

q Va x0 , Va y0 ,

q Va x1 , Va y1 , and

q Va x2 , Va y2 of width .Va width . The units are in pixels and have an origin of

q 0 , 0 . t Fn fb_drawrect x0 y0 x1 y1 fill Fill in a rectangle with the pixel .Va fill with the corners

q Va x0 , Va y0 and

q Va x1 , Va y1 . The units are in pixels and have an origin of

q 0 , 0 . t Fn fb_line x0 y0 x1 y1 width Draw a line from

q Va x0 , Va y0 to

q Va x1 , Va y1 with a width of .Va width . The units are in pixels and have an origin of

q 0 , 0 . t Fn fb_putimage name x0 y0 x1 y1 f Load the PNG file .Va name and place it in the rectangle with the corners

q Va x0 , Va y0 and

q Va x1 , Va y1 and fill with pixel .Va f . The units are in pixels and have an origin of

q 0 , 0 . t Fn fb_set_pixel x y Sets the pixel at

q Va x , Va y . The units are in pixels and have an origin of

q 0 , 0 . t Fn term_drawrect x0 y0 x1 y1 Draw the outline of a rectangle with the text coordinate corners of

q Va x0 , Va y0 and

q Va x1 , Va y1 . The units are in character cells and have an origin of

q 1 , 1 . t Fn term_putimage name x0 y0 x1 y1 f Load the PNG file .Va name and place it in the rectangle with the text coordinate corners

q Va x0 , Va y0 and

q Va x1 , Va y1 and fill with pixel .Va f . The units are in character cells and have an origin of

q 1 , 1 . .El

p This table is optional and should only be used if it is non-nil and if .Fn core.isFramebufferConsole is true. .Ss Compatibility All the interfaces described above are also available via the c loader table through at last FreeBSD 15.0. .Sh SEE ALSO .Xr loader.conf 5 , .Xr core.lua 8 , .Xr loader 8 , .Xr loader.lua 8 .Sh AUTHORS The .Nm man page was written by .An Warner Losh Aq Mt imp@FreeBSD.org .