diff options
author | rodri <rgl@antares-labs.eu> | 2020-06-14 22:28:38 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2020-06-14 22:28:38 +0000 |
commit | 35490e9f73c182b844b1a32599aa105562e9f455 (patch) | |
tree | 4f9a0ac99c34c3a07e4d01e338d9090f7f7e7aff | |
parent | 1024676bc6ad5ef8b073cefd5da22c89dbb59dde (diff) | |
download | puppeteer-35490e9f73c182b844b1a32599aa105562e9f455.tar.gz puppeteer-35490e9f73c182b844b1a32599aa105562e9f455.tar.bz2 puppeteer-35490e9f73c182b844b1a32599aa105562e9f455.zip |
forgot the utils file.
-rw-r--r-- | utils.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -0,0 +1,18 @@ +#include <u.h> +#include <libc.h> +#include <draw.h> + +double +fclamp(double n, double min, double max) +{ + return n < min? min: n > max? max: n; +} + +int +alphachan(ulong chan) +{ + for(; chan; chan >>= 8) + if(TYPE(chan) == CAlpha) + return 1; + return 0; +} |