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.21 1999/06/14 22:16:02 mirar Exp $ + **! $Id: colors.c,v 1.22 1999/06/18 19:19:15 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:175:   **! 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.21 1999/06/14 22:16:02 mirar Exp $"); + RCSID("$Id: colors.c,v 1.22 1999/06/18 19:19:15 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:671:   **! and blue (equal to <tt>-><ref>rgb</ref>()</tt>), or   **! to a string, giving the name (equal to <tt>-><ref>name</ref>()</tt>).   **! returns the name as string or rgb as array   **! see also: rgb, name   */      static void image_color_cast(INT32 args)   {    if (args!=1 ||    sp[-1].type!=T_STRING) -  error("Image.Color.Color->cast(): Illegal argument(s)\n"); +  bad_arg_error("Image.Color.Color->cast",sp-args,args,0,"",sp-args, +  "Bad arguments to Image.Color.Color->cast()\n");       if (sp[-1].u.string==str_array)    {    image_color_rgb(args);    return;    }    if (sp[-1].u.string==str_string)    {    image_color_name(args);    return;
pike.git/src/modules/Image/colors.c:1231:    push_int(0);    sp[-1].subtype=NUMBER_UNDEFINED;    return;   }      static void image_guess_color(INT32 args)   {    struct svalue s;       if (args!=1 && sp[-args].type!=T_STRING) -  error("Image.Color->guess(): illegal argument(s)\n"); +  bad_arg_error("Image.Color->guess",sp-args,args,0,"",sp-args, +  "Bad arguments to Image.Color->guess()\n");       f_lower_case(1);    push_text(" ");    o_subtract();       stack_dup();    image_get_color(1);    if (sp[-1].type==T_OBJECT)    {    stack_swap();
pike.git/src/modules/Image/colors.c:1453:    _image_make_rgb_color(i,i,i);   }      static void image_make_html_color(INT32 args)   {    int i;       if (args!=1 ||    sp[-1].type!=T_STRING)    { -  error("Image.Color.html(): illegal arguments\n"); +  bad_arg_error("Image.Color.html",sp-args,args,0,"",sp-args, +  "Bad arguments to Image.Color.html()\n");    return;    }       f_lower_case(1);    for (i=0; (size_t)i<sizeof(html_color)/sizeof(html_color[0]); i++)    if (html_color[i].pname==sp[-1].u.string)    {    _image_make_rgb_color(html_color[i].r,    html_color[i].g,    html_color[i].b);