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.50 2001/07/01 21:53:37 mast Exp $ + **! $Id: colors.c,v 1.51 2001/07/12 13:52:47 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: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.50 2001/07/01 21:53:37 mast Exp $"); + RCSID("$Id: colors.c,v 1.51 2001/07/12 13:52:47 grubba 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:761:    Pike_error("Image.Color.Color->cast(): Can't cast to that\n");   }      /*   **! method _sprintf(string s, mapping flags)   **!   */      static void image_color__sprintf(INT32 args)   { -  int prec,n,x; +  int prec,x;       if (args<2)    SIMPLE_TOO_FEW_ARGS_ERROR("_sprintf",2);       if (sp[-args].type!=T_INT)    SIMPLE_BAD_ARG_ERROR("_sprintf",0,"integer");    if (sp[1-args].type!=T_MAPPING)    SIMPLE_BAD_ARG_ERROR("_sprintf",1,"mapping");       pop_n_elems(args-2);
pike.git/src/modules/Image/colors.c:1349:    push_array_items(sp->u.array);    image_make_cmyk_color(4);    return;    }    pop_stack();    }    for (n=0; (size_t)n<sizeof(callables)/sizeof(callables[0]); n++)    if (sp[-1].u.string->len>(ptrdiff_t)strlen(callables[n]) &&    memcmp(sp[-1].u.string->str,callables[n],strlen(callables[n]))==0)    { -  push_int(DO_NOT_WARN(strlen(callables[n]))); +  push_int(DO_NOT_WARN((INT32)strlen(callables[n])));    push_int(1000000);    f_index(3);    image_get_color(1);    if (sp[-1].type!=T_OBJECT) return; /* no way */    safe_apply(sp[-1].u.object,callables[n],0);    stack_swap();    pop_stack();    return;    }    if (sp[-1].u.string->len>=4 &&
pike.git/src/modules/Image/colors.c:1395:    /* try other stuff here */       pop_stack();    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)    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);
pike.git/src/modules/Image/colors.c:1436:    {    pop_stack();    *(sp++)=s;    return;    }    image_get_color(args);   }      static void image_make_color(INT32 args)   { -  struct svalue s; -  +     if (args==1 && sp[-args].type==T_STRING)    {    image_get_color(args);    return;    }    image_make_rgb_color(args);   }         /*
pike.git/src/modules/Image/colors.c:1676:   static void image_colors_values(INT32 args)   {    pop_n_elems(args);    if (!colors) make_colors();    ref_push_mapping(colors);    f_values(1);   }      void init_image_colors(void)   { -  struct program *prg; -  struct pike_string *str; -  +     str_array=make_shared_string("array");    str_string=make_shared_string("string");    str_r=make_shared_string("r");    str_g=make_shared_string("g");    str_b=make_shared_string("b");    str_h=make_shared_string("h");    str_s=make_shared_string("s");    str_v=make_shared_string("v");       no_name=make_shared_string("");