mortie / swaylock-effects

Swaylock, with fancy effects
MIT License
707 stars 46 forks source link

Support 10-bit screenshots by downsampling to 8-bit #81

Open quantum5 opened 2 years ago

quantum5 commented 2 years ago

This commit introduces support for all eight 10-bit colour formats supported by wl_shm.

le32toh is used to convert little endian pixels to host endianness. This function is available on Linux in <endian.h> and FreeBSD in <sys/endian.h>.

For readability, the if/else chain is converted into a switch.

This fixes #80.