colourpicker

Simple Colour Picker written in C
git clone anongit@rnpnr.xyz:colourpicker.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 1ff73eb56fe340edad1478fbabf1a49da1ce871c
Parent: 3b21b25b410f0684eccc6e9d4da24c0cd88e1c33
Author: Randy Palamar
Date:   Thu, 25 Jul 2024 21:34:12 -0600

keep normalize_colour() in main.c for now

Diffstat:
Mmain.c | 11+++++++++++
Mutil.c | 11-----------
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/main.c b/main.c @@ -107,6 +107,17 @@ parse_u32(char *s) return res; } +static v4 +normalize_colour(u32 rgba) +{ + return (v4){ + .r = ((rgba >> 24) & 0xFF) / 255.0f, + .g = ((rgba >> 16) & 0xFF) / 255.0f, + .b = ((rgba >> 8) & 0xFF) / 255.0f, + .a = ((rgba >> 0) & 0xFF) / 255.0f, + }; +} + int main(i32 argc, char *argv[]) { diff --git a/util.c b/util.c @@ -102,17 +102,6 @@ colour_from_normalized(v4 colour) } static v4 -normalize_colour(u32 rgba) -{ - return (v4){ - .r = ((rgba >> 24) & 0xFF) / 255.0f, - .g = ((rgba >> 16) & 0xFF) / 255.0f, - .b = ((rgba >> 8) & 0xFF) / 255.0f, - .a = ((rgba >> 0) & 0xFF) / 255.0f, - }; -} - -static v4 rgb_to_hsv(v4 rgb) { __m128 rgba = _mm_loadu_ps(rgb.E);