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

version» Context lines:

pike.git/src/modules/Image/colors.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: colors.c,v 1.65 2003/01/31 02:01:46 mast Exp $ + || $Id: colors.c,v 1.66 2003/09/10 15:21:58 mast Exp $   */      /*   **! module Image   **! submodule Color   **!   **! This module keeps names and easy handling   **! for easy color support. It gives you an easy   **! way to get colors from names.   **!
pike.git/src/modules/Image/colors.c:185:   **! class Color   **! 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"    - RCSID("$Id: colors.c,v 1.65 2003/01/31 02:01:46 mast Exp $"); + RCSID("$Id: colors.c,v 1.66 2003/09/10 15:21:58 mast Exp $");      #include "image_machine.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:1590:   #define t ((FLOAT_TYPE)(v * (1 - (s * (1 -f)))))    switch(DOUBLE_TO_INT(i))    {    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: Pike_error("internal error (hue=%d <= hsv[%f,%f,%f])\n", +  default: Pike_error("internal error (hue=%d <= hsv[%"PRINTPIKEFLOAT"f," +  "%"PRINTPIKEFLOAT"f,%"PRINTPIKEFLOAT"f])\n",    DOUBLE_TO_INT(i), h, s, v);    }    }   #undef i   #undef f   #undef p   #undef q   #undef t       _image_make_rgbf_color(r,g,b);