pike.git
/
src
/
modules
/
Image
/
colors.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/colors.c:655:
{ char buf[80]; INT_TYPE i=sizeof(COLORTYPE)*2; if (args) get_all_args("hex",args,"%i",&i); pop_n_elems(args); if (i<1) {
-
push_text("#"); /* stupid */
+
push_
static_
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:788:
if (args<2) SIMPLE_TOO_FEW_ARGS_ERROR("_sprintf",2); if (TYPEOF(sp[-args]) != T_INT) SIMPLE_BAD_ARG_ERROR("_sprintf",0,"int"); if (TYPEOF(sp[1-args]) != T_MAPPING) SIMPLE_BAD_ARG_ERROR("_sprintf",1,"mapping"); pop_n_elems(args-2);
-
push_text("precision");
+
push_
static_
text("precision");
f_index(2); if (TYPEOF(sp[-1]) != T_INT) SIMPLE_BAD_ARG_ERROR("_sprintf",1,"mapping(\"precision\":int)"); prec=sp[-1].u.integer; x=sp[-2].u.integer; pop_n_elems(2); switch (x) { /* case 'c': */ /* case 'd': */ case 't':
-
push_text("Image.Color.Color");
+
push_
static_
text("Image.Color.Color");
return; case 'O': if (!THIS->name) try_find_name(THIS); if (THIS->name==no_name) {
-
push_text("Image.Color(\"");
+
push_
static_
text("Image.Color(\"");
if (prec) { push_int(prec); image_color_hex(1); } else image_color_hex(0);
-
push_text("\")");
+
push_
static_
text("\")");
f_add(3); return; } else {
-
push_text("Image.Color.");
+
push_
static_
text("Image.Color.");
ref_push_string(THIS->name); f_add(2); return; } break; case 's': if (prec) { push_int(prec); image_color_name(1);
pike.git/src/modules/Image/colors.c:1316:
(INT32)rgb[1], (INT32)rgb[2]); return; } } if (sp[-1].u.string->len>=4 && sp[-1].u.string->str[0]=='@') { /* @h,s,v; h=0..359, s,v=0..100 */ stack_dup();
-
push_text("@%f,%f,%f\n");
+
push_
static_
text("@%f,%f,%f\n");
f_sscanf(2); if (TYPEOF(sp[-1]) == T_ARRAY && sp[-1].u.array->size==3) { FLOAT_TYPE h,s,v; stack_swap(); pop_stack(); sp--; dmalloc_touch_svalue(sp); push_array_items(sp->u.array);
pike.git/src/modules/Image/colors.c:1342:
image_make_hsv_color(3); return; } pop_stack(); } if (sp[-1].u.string->len>=4 && sp[-1].u.string->str[0]=='%') { /* @c,m,y,k; 0..100 */ stack_dup();
-
push_text("%%%f,%f,%f,%f\n");
+
push_
static_
text("%%%f,%f,%f,%f\n");
f_sscanf(2); if (TYPEOF(sp[-1]) == T_ARRAY && sp[-1].u.array->size==4) { stack_swap(); pop_stack(); sp--; dmalloc_touch_svalue(sp); push_array_items(sp->u.array); image_make_cmyk_color(4);
pike.git/src/modules/Image/colors.c:1376:
safe_apply(sp[-1].u.object,callables[n],0); stack_swap(); pop_stack(); return; } if (sp[-1].u.string->len>=4 && sp[-1].u.string->str[0]=='g') { /* greyx; x=0..99 */ stack_dup();
-
push_text("gr%*[ea]y%f\n");
+
push_
static_
text("gr%*[ea]y%f\n");
f_sscanf(2); if (TYPEOF(sp[-1]) == T_ARRAY && sp[-1].u.array->size==1) { double f; f = sp[-1].u.array->item[0].u.float_number; pop_stack(); pop_stack(); push_int( DO_NOT_WARN((int)(255*f/100)) ); /* grey100 is white, grey0 is black */
pike.git/src/modules/Image/colors.c:1411:
return; } static void image_guess_color(INT32 args) { if (args!=1 && TYPEOF(sp[-args]) != T_STRING) bad_arg_error("guess",sp-args,args,0,"",sp-args, "Bad arguments to guess.\n"); f_lower_case(1);
-
push_text(" ");
+
push_
static_
text(" ");
o_subtract(); stack_dup(); image_get_color(1); if (TYPEOF(sp[-1]) == T_OBJECT) { stack_swap(); pop_stack(); return; } pop_stack();
-
push_text("#");
+
push_
static_
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, 0, sp-1);
pike.git/src/modules/Image/colors.c:1677:
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_
static_
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>)