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.69 2003/11/14 10:26:43 mast Exp $ + || $Id: colors.c,v 1.70 2003/12/09 08:11:01 nilsson 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:184:   **! 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.69 2003/11/14 10:26:43 mast Exp $"); + RCSID("$Id: colors.c,v 1.70 2003/12/09 08:11:01 nilsson 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:660:   {    char buf[80];    INT_TYPE i=sizeof(COLORTYPE)*2;       if (args)    get_all_args("Image.Color.Color->hex()",args,"%i",&i);       pop_n_elems(args);    if (i<1)    { -  push_text("#"); /* stupid */ +  push_constant_text("#"); /* stupid */    return;    }    else if (i!=sizeof(COLORTYPE)*2)    {    ptrdiff_t sh;    if (i>8) i=8;       sh=4*(sizeof(COLORTYPE)*2-i);    if (sh>0)    sprintf(buf,"#%0*x%0*x%0*x",
pike.git/src/modules/Image/colors.c:1414:    return;   }      static void image_guess_color(INT32 args)   {    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(" "); +  push_constant_text(" ");    o_subtract();       stack_dup();    image_get_color(1);    if (sp[-1].type==T_OBJECT)    {    stack_swap();    pop_stack();    return;    }    pop_stack(); -  push_text("#"); +  push_constant_text("#");    stack_swap();    f_add(2);       image_get_color(1);   }      static void image_colors_index(INT32 args)   {    struct svalue s;    object_index_no_free2(&s,THISOBJ,sp-1);
pike.git/src/modules/Image/colors.c:1653:    html_color[i].g,    html_color[i].b);    return;    }       if (sp[-1].u.string->len>0 &&    sp[-1].u.string->str[0]=='#')    image_get_color(1);    else    { -  push_text("#"); +  push_constant_text("#");    stack_swap();    f_add(2);    image_get_color(1);    }   }      /*   **! method array(string) _indices()   **! method array(object) _values()   **! (ie as <tt>indices(Image.Color)</tt> or <tt>values(Image.Color)</tt>)