X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fhsv.c;h=2a88dffc3fb6cd64e4c6a0ae300d172496ccbd8f;hb=65740e2a8dea3d6309ae6e8914a0fb79e993ada8;hp=bf508f3d416abdb0fc53174fa544c0b6a3e29d3c;hpb=88134d551a9911995c013c5ed06a32c2b1044b85;p=xscreensaver diff --git a/utils/hsv.c b/utils/hsv.c old mode 100644 new mode 100755 index bf508f3d..2a88dffc --- a/utils/hsv.c +++ b/utils/hsv.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -16,10 +16,15 @@ #include void +#if __STDC__ +hsv_to_rgb (int h, double s, double v, + unsigned short *r, unsigned short *g, unsigned short *b) +#else hsv_to_rgb (h,s,v, r,g,b) int h; /* 0 - 360 */ double s, v; /* 0.0 - 1.0 */ unsigned short *r, *g, *b; /* 0 - 65535 */ +#endif { double H, S, V, R, G, B; double p1, p2, p3; @@ -44,10 +49,15 @@ hsv_to_rgb (h,s,v, r,g,b) } void +#if __STDC__ +rgb_to_hsv (unsigned short r, unsigned short g, unsigned short b, + int *h, double *s, double *v) +#else rgb_to_hsv (r,g,b, h,s,v) unsigned short r, g, b; /* 0 - 65535 */ int *h; /* 0 - 360 */ double *s, *v; /* 0.0 - 1.0 */ +#endif { double R, G, B, H, S, V; double cmax, cmin;