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.24 1999/06/22 19:25:57 mirar Exp $ + **! $Id: colors.c,v 1.25 1999/07/02 21:19:49 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.24 1999/06/22 19:25:57 mirar Exp $"); + RCSID("$Id: colors.c,v 1.25 1999/07/02 21:19:49 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:926:   static void image_color_neon(INT32 args)   {    pop_n_elems(args);    image_color_hsvf(0);    sp--;    push_array_items(sp->u.array); /* frees */       if (sp[-1].u.float_number==0.0 ||    sp[-2].u.float_number==0.0)    { -  if (sp[-2].u.float_number<0.5) -  sp[-2].u.float_number=0.0; +  if (sp[-1].u.float_number<0.5) +  sp[-1].u.float_number=0.0;    else -  sp[-2].u.float_number=1.0; +  sp[-1].u.float_number=1.0;    }    else    {    sp[-1].u.float_number=1.0;    sp[-2].u.float_number=1.0;    }    image_make_hsv_color(3);   }      static void image_color_dull(INT32 args)   {    pop_n_elems(args);       image_color_hsvf(0);    sp--;    push_array_items(sp->u.array); /* frees */    -  if (sp[-1].u.float_number==0.0) +  if (sp[-2].u.float_number==0.0)    { -  pop_n_elems(3); -  ref_push_object(THISOBJ); -  return; +  sp[-1].u.float_number-=0.2;    } -  +  else +  {    sp[-2].u.float_number-=0.2;    sp[-1].u.float_number-=0.2; -  +  }    image_make_hsv_color(3);   }      static void image_color_bright(INT32 args)   {    pop_n_elems(args);    image_color_hsvf(0);    sp--;    push_array_items(sp->u.array); /* frees */    -  if (sp[-1].u.float_number==0.0) +  if (sp[-2].u.float_number==0.0)    { -  pop_n_elems(3); -  ref_push_object(THISOBJ); -  return; +  sp[-1].u.float_number+=0.2;    } -  +  else +  {    sp[-2].u.float_number+=0.2;    sp[-1].u.float_number+=0.2; -  +  }    image_make_hsv_color(3);   }         static void image_color_mult(INT32 args)   {    float x=0.0;    get_all_args("Image.Color.Color->`*",args,"%f",&x);    pop_n_elems(args);    _image_make_rgb_color((int)(THIS->rgb.r*x),