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.57 2001/09/24 11:30:25 grubba Exp $ + **! $Id: colors.c,v 1.58 2001/11/07 21:37:34 nilsson 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:33:   **! ...red...   **! ...green...   **! ...lightgreen...   **! </pre>   **!   **! Giving red, green and blue values is equal to calling   **! <ref>Image.Color.rgb</ref>().   **!   **! The prefix_string method is a form for getting modified   **! colors, it understands all modifiers - **! (<link to=Image.Color.Color.light>light</link>, - **! <link to=Image.Color.Color.dark>dark</link>, - **! <link to=Image.Color.Color.bright>bright</link>, - **! <link to=Image.Color.Color.dull>dull</link> and - **! <link to=Image.Color.Color.neon>neon</link>). Simply use + **! (<link to=Color.light>light</link>, + **! <link to=Color.dark>dark</link>, + **! <link to=Color.bright>bright</link>, + **! <link to=Color.dull>dull</link> and + **! <link to=Color.neon>neon</link>). Simply use   **! "method"+"color"; (as in <tt>lightgreen</tt>,   **! <tt>dullmagenta</tt>, <tt>lightdullorange</tt>).   **!   **! The <tt>hex_name</tt> form is a simple   **! <tt>#rrggbb</tt> form, as in HTML or X-program argument.   **! A shorter form (<tt>#rgb</tt>) is also accepted. This   **! is the inverse to the <ref>Image.Color.Color->hex</ref>()   **! method.   **!   **! The <tt>cmyk_string</tt> is a string form of giving
pike.git/src/modules/Image/colors.c:79:   **! since that method is more tolerant for mistakes and errors.   **!   **! <tt>Image.Color</tt>() is case- and space-sensitive.   **! Use <ref>Image.Color.guess</ref>() to catch all variants.   **!   **! and subtract with a space (lower_case(x)-" ") to make   **! sure you get all variants.   **!   **! see also: Image.Color.Color, Image.Color.guess, Image, Image.Colortable   **! - **! +    **! appendix Image.Color colors   **!   **! This table lists all the different named colors available in Image.Color.   **! The first column shows the actual color while the five following columns   **! demonstrates the modifiers neon, light, dark, bright and dull. The color   **! begind the name of the color is produced by calling neon()->dark()->dark()->dark()   **! from the color object itself, i.e. Image.Color.mintcream->neon()->dark()->dark()->dark().   **!   **! <execute>   **!
pike.git/src/modules/Image/colors.c:181:   **! 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.57 2001/09/24 11:30:25 grubba Exp $"); + RCSID("$Id: colors.c,v 1.58 2001/11/07 21:37:34 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:401:      /*   **! method void create(int r,int g,int b)   **! This is the main <ref>Image.Color.Color</ref> creation   **! method, mostly for internal use.   **----- internal note: it takes a fourth argument, name of color ---   **!   */   /*   **! method array(int) rgb() + **! method array(float) rgbf()   **! method array(int) hsv() - **! method array(int) cmyk() + **! method array(float) hsvf() + **! method array(float) cmyk()   **! method int greylevel()   **! method int greylevel(int r, int g, int b)   **! This is methods of getting information from an   **! <ref>Image.Color.Color</ref> object.   **!   **! They give an array of   **! red, green and blue (rgb) values (color value),<br>   **! hue, saturation and value (hsv) values (range as color value), <br>   **! cyan, magenta, yellow, black (cmyk) values (in percent) <br>   **! or the greylevel value (range as color value).
pike.git/src/modules/Image/colors.c:763:    return;    }    if (sp[-1].u.string==str_string)    {    image_color_name(args);    return;    }    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,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)
pike.git/src/modules/Image/colors.c:1796:    free_string(str_string);    free_string(str_r);    free_string(str_g);    free_string(str_b);    free_string(str_h);    free_string(str_s);    free_string(str_v);       free_string(no_name);   } -  +