diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 09:04:45 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 09:04:45 +0100 |
| commit | 0b6ee849722002a8bc7cc5374e3136bee4be2ccd (patch) | |
| tree | 729e99b7e87d8cd298f3b62cd2b97f362b863216 /src/screen/drm/frame-buffer/pixelformat.zig | |
| parent | 88aa2940b27044794d4dcb49c924a5df17cc0055 (diff) | |
screen: add frame-buffer
Diffstat (limited to 'src/screen/drm/frame-buffer/pixelformat.zig')
| -rw-r--r-- | src/screen/drm/frame-buffer/pixelformat.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/screen/drm/frame-buffer/pixelformat.zig b/src/screen/drm/frame-buffer/pixelformat.zig new file mode 100644 index 0000000..a4b3f9a --- /dev/null +++ b/src/screen/drm/frame-buffer/pixelformat.zig @@ -0,0 +1,11 @@ + +fn pixel_format_code(comptime a: u8, comptime b: u8, comptime c: u8, comptime d: u8) u32 { + return @as(u32, @intCast(a)) | + (@as(u32, @intCast(b)) << 8) | + (@as(u32, @intCast(c)) << 16) | + (@as(u32, @intCast(d)) << 24); +} + +pub const PixelFormat = enum(u32) { + xrgb8888 = pixel_format_code('X', 'R', '2', '4'), +}; |