pike.git
/
src
/
modules
/
Image
/
colors.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/colors.c:277:
for (i=0; (size_t)i<sizeof(html_color)/sizeof(html_color[0]); i++) html_color[i].pname=make_shared_string(html_color[i].name); for (i=0;i<n;i++) { struct color_struct *cs; push_text(c[i].name); copy_shared_string(c[i].pname,sp[-1].u.string); push_object(clone_object(image_color_program,0));
-
cs=
(struct color_struct*)
-
get_storage(sp[-1].u.object,image_color_program);
+
cs=get_storage(sp[-1].u.object,image_color_program);
cs->rgb.r=(COLORTYPE)c[i].r; cs->rgb.g=(COLORTYPE)c[i].g; cs->rgb.b=(COLORTYPE)c[i].b; RGB_TO_RGBL(cs->rgbl,cs->rgb); copy_shared_string(cs->name,c[i].pname); } f_aggregate_mapping(n*2); colors=sp[-1].u.mapping; sp--; dmalloc_touch_svalue(sp);
pike.git/src/modules/Image/colors.c:947:
*/ static void image_color_equal(INT32 args) { if (args!=1) Pike_error("Image.Color.Color->`==: illegal number of arguments\n"); if (TYPEOF(sp[-1]) == T_OBJECT) { struct color_struct *other;
-
other=
(struct color_struct*)
-
get_storage(sp[-1].u.object,image_color_program);
+
other=get_storage(sp[-1].u.object,image_color_program);
if (other&& other->rgbl.r==THIS->rgbl.r && other->rgbl.g==THIS->rgbl.g && other->rgbl.b==THIS->rgbl.b) { pop_stack(); push_int(1); return; } }
pike.git/src/modules/Image/colors.c:1172:
pop_n_elems(args); _image_make_rgb_color(DOUBLE_TO_INT(THIS->rgb.r*x), DOUBLE_TO_INT(THIS->rgb.g*x), DOUBLE_TO_INT(THIS->rgb.b*x)); } int image_color_svalue(struct svalue *v,rgb_group *rgb) { if (TYPEOF(*v) == T_OBJECT) {
-
struct color_struct *cs=
(struct color_struct*)
-
get_storage(v->u.object,image_color_program);
+
struct color_struct *cs=get_storage(v->u.object,image_color_program);
if (cs) { *rgb=cs->rgb; return 1; } } else if (TYPEOF(*v) == T_ARRAY) { if (v->u.array->size==3 &&
pike.git/src/modules/Image/colors.c:1200:
rgb->b=(COLORTYPE)(v->u.array->item[2].u.integer); return 1; } } else if (TYPEOF(*v) == T_STRING) { push_svalue(v); image_make_color(1); if (TYPEOF(sp[-1]) == T_OBJECT) {
-
struct color_struct *cs=
(struct color_struct*)
-
get_storage(sp[-1].u.object,image_color_program);
+
struct color_struct *cs=get_storage(sp[-1].u.object,image_color_program);
*rgb=cs->rgb; pop_stack(); return 1; } pop_stack(); } return 0; } int image_color_arg(INT32 args,rgb_group *rgb)
pike.git/src/modules/Image/colors.c:1498:
static void _image_make_rgbl_color(INT32 r,INT32 g,INT32 b) { struct color_struct *cs; if (r<0) r=0; else if (r>COLORLMAX) r=COLORLMAX; /* >=2^31? no way... */ if (g<0) g=0; else if (g>COLORLMAX) g=COLORLMAX; if (b<0) b=0; else if (b>COLORLMAX) b=COLORLMAX; push_object(clone_object(image_color_program,0));
-
cs=
(struct color_struct*)
-
get_storage(sp[-1].u.object,image_color_program);
+
cs=get_storage(sp[-1].u.object,image_color_program);
cs->rgbl.r=(INT32)r; cs->rgbl.g=(INT32)g; cs->rgbl.b=(INT32)b; RGBL_TO_RGB(cs->rgb,cs->rgbl); } static void image_color__encode( INT32 UNUSED(args) ) { push_int( THIS->rgbl.r );
pike.git/src/modules/Image/colors.c:1545:
void _image_make_rgb_color(INT32 r,INT32 g,INT32 b) { struct color_struct *cs; if (r<0) r=0; else if (r>COLORMAX) r=COLORMAX; if (g<0) g=0; else if (g>COLORMAX) g=COLORMAX; if (b<0) b=0; else if (b>COLORMAX) b=COLORMAX; push_object(clone_object(image_color_program,0));
-
cs=
(struct color_struct*)
-
get_storage(sp[-1].u.object,image_color_program);
+
cs=get_storage(sp[-1].u.object,image_color_program);
cs->rgb.r=(COLORTYPE)r; cs->rgb.g=(COLORTYPE)g; cs->rgb.b=(COLORTYPE)b; RGB_TO_RGBL(cs->rgbl,cs->rgb); } static void image_make_rgb_color(INT32 args) { INT_TYPE r=0,g=0,b=0;