diff options
author | Daniel Eklöf <daniel@ekloef.se> | 2020-08-01 15:32:48 +0200 |
---|---|---|
committer | Daniel Eklöf <daniel@ekloef.se> | 2020-08-01 15:32:48 +0200 |
commit | b947448795d604f169246b0c3191028ae6a0ab83 (patch) | |
tree | 6d99443c8f46d6e2730344efcca6b9d972fdce00 /stride.h | |
download | wbg-b947448795d604f169246b0c3191028ae6a0ab83.tar.gz |
Initial commit
Can display a single PNG image scaled-to-fit on all outputs.
Diffstat (limited to 'stride.h')
-rw-r--r-- | stride.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/stride.h b/stride.h new file mode 100644 index 0000000..b2c71a7 --- /dev/null +++ b/stride.h @@ -0,0 +1,9 @@ +#pragma once + +#include <pixman.h> + +static inline int +stride_for_format_and_width(pixman_format_code_t format, int width) +{ + return (((PIXMAN_FORMAT_BPP(format) * width + 7) / 8 + 4 - 1) & -4); +} |