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.59 2002/05/11 00:27:03 nilsson Exp $ + **! $Id: colors.c,v 1.60 2002/06/05 07:33:03 jhs 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:180:   **! 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.59 2002/05/11 00:27:03 nilsson Exp $"); + RCSID("$Id: colors.c,v 1.60 2002/06/05 07:33:03 jhs 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:566:   static void image_color_grey(INT32 args)   {    image_color_greylevel(args);    stack_dup();    stack_dup();    image_make_rgb_color(3);   }      /*   **! method int bits( int rbits, int gbits, int bbits, int rshift, int gshift, int bshift ) - **! Returns the color as an integer + **! Returns the color as an integer. The first three parameters state how + **! many bits to use for red, green and blue respectively. The last three + **! state how many bits each colour should be shifted. For instance, + **! <tt>Image.Color("#AABBCC")-&gt;bits(8, 8, 8, 16, 8, 0)</tt> returns + **! the integer 11189196, that is, 0xAABBCC.   */   static void image_color_bits( INT32 args )   {    INT_TYPE rb, gb, bb, rs, gs, bs;    get_all_args( "bits", args, "%d%d%d%d%d%d", &rb,&gb,&bb, &rs, &gs, &bs );    pop_n_elems( args );          /* Do it on the stack to support bignums (it's possible to get 2M    * bits for each channel this way. Not that that's really useful,