diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 21:54:14 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2025-02-02 21:54:14 +0100 |
| commit | 811a6bd572f4c6b26e99b4e746f5d710947ee934 (patch) | |
| tree | 3ff6375ce2d7ea13e0d49f7800757a1b42604884 /src/screen/drm/pixel.zig | |
| parent | 3f4375a14218796cbd7bfff1c8cfff0f7bb1f6df (diff) | |
screen: drm change struct layout
Diffstat (limited to 'src/screen/drm/pixel.zig')
| -rw-r--r-- | src/screen/drm/pixel.zig | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/screen/drm/pixel.zig b/src/screen/drm/pixel.zig new file mode 100644 index 0000000..7c99e52 --- /dev/null +++ b/src/screen/drm/pixel.zig @@ -0,0 +1,19 @@ + +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 Pixel = packed struct(u32) { + blue: u8, + green: u8, + red: u8, + _padding: u8 = 0x0, + + pub const Format = enum(u32) { + xrgb8888 = pixel_format_code('X', 'R', '2', '4'), + }; +}; + |