pike.git
/
src
/
modules
/
Image
/
colors.c
version
»
Context lines:
10
20
40
80
file
none
3
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.
66
2003/
09/
10
15
:
21
:
58
mast
Exp $
+
|| $Id: colors.c,v 1.
67
2003/
10
/
13
17
:
39
:
08
grubba
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:185:
**! 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.
66
2003/
09/
10
15
:
21
:
58
mast
Exp $");
+
RCSID("$Id: colors.c,v 1.
67
2003/
10
/
13
17
:
39
:
08
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:578:
**! method int bits( int rbits, int gbits, int bbits, int rshift, int gshift, int bshift ) **! 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")->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 );
+
get_all_args( "bits", args, "%
i
%
i
%
i
%
i
%
i
%
i
", &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, * but... */ #define push_int_bits( i, b, s ) \ if( b <= 31 ) \