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.42 2000/12/05 21:08:24 per Exp $ + **! $Id: colors.c,v 1.43 2001/01/03 18:08:07 mirar 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:172:   **! 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.42 2000/12/05 21:08:24 per Exp $"); + RCSID("$Id: colors.c,v 1.43 2001/01/03 18:08:07 mirar 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:1359:    if (sp[-1].u.string->len>=4 &&    sp[-1].u.string->str[0]=='g')    {    /* greyx; x=0..99 */    stack_dup();    push_text("grey%f\n");    f_sscanf(2);    if (sp[-1].type==T_ARRAY &&    sp[-1].u.array->size==1)    { -  double f; /* FIXME: What is f used for? */ +  double f;    f = sp[-1].u.array->item[0].u.float_number;    pop_stack(); -  sp--; +  push_int( (int)(255*f/99) ); +  stack_dup(); +  stack_dup(); +  image_make_rgb_color(3);       return;    }    pop_stack();    }    }       /* try other stuff here */       pop_stack();