pike.git / src / modules / Image / colors.c

version» Context lines:

pike.git/src/modules/Image/colors.c:1:   /*   **! module Image   **! note - **! $Id: colors.c,v 1.14 1999/04/25 20:34:00 grubba Exp $ + **! $Id: colors.c,v 1.15 1999/04/25 20:34:51 grubba Exp $   **! submodule Color   **!   **! This module keeps names and easy handling   **! for easy color support. It gives you an easy   **! way to get colors from names.   **!   **! A color is here an object, containing color   **! information and methods for conversion, see below.   **!   **! <ref>Image.Color</ref> can be called to make a color object.
pike.git/src/modules/Image/colors.c:90:   **! This is the color object. It has six readable variables,   **! <tt>r</tt>, <tt>g</tt>, <tt>b</tt>, for the <i>red</i>,   **! <i>green</i> and <i>blue</i> values,   **! and <tt>h</tt>, <tt>s</tt>, <tt>v</tt>, for   **! the <i>hue</i>, <i>saturation</i> anv <i>value</i> values.   */      #include "global.h"   #include <config.h>    - RCSID("$Id: colors.c,v 1.14 1999/04/25 20:34:00 grubba Exp $"); + RCSID("$Id: colors.c,v 1.15 1999/04/25 20:34:51 grubba Exp $");      #include "config.h"      #include <math.h>      #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"
pike.git/src/modules/Image/colors.c:1295:    {    r = g = b = v;    } else {   #define i floor(h)   #define f (h-i)   #define p (v * (1 - s))   #define q (v * (1 - (s * f)))   #define t (v * (1 - (s * (1 -f))))    switch((int)i)    { -  case 6: // 360 degrees. Same as 0.. +  case 6: /* 360 degrees. Same as 0.. */    case 0: r = v; g = t; b = p; break;    case 1: r = q; g = v; b = p; break;    case 2: r = p; g = v; b = t; break;    case 3: r = p; g = q; b = v; break;    case 4: r = t; g = p; b = v; break;    case 5: r = v; g = p; b = q; break;    default: error("internal error\n");    }    }   #undef i