pike.git
/
src
/
modules
/
Image
/
colors.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/colors.c:324:
sp--; dmalloc_touch_svalue(sp); } #ifdef THIS #undef THIS /* Needed for NT */ #endif #define THIS ((struct color_struct*)(Pike_fp->current_storage)) #define THISOBJ (Pike_fp->current_object)
-
static void init_color_struct(struct object *dummy)
+
static void init_color_struct(struct object *
UNUSED(
dummy)
)
{ THIS->rgb.r=THIS->rgb.g=THIS->rgb.b=0; THIS->name=NULL; }
-
static void exit_color_struct(struct object *dummy)
+
static void exit_color_struct(struct object *
UNUSED(
dummy)
)
{ if (THIS->name) { free_string(THIS->name); THIS->name=NULL; } } void _img_nct_map_to_flat_cubicles(rgb_group *s, rgb_group *d,
pike.git/src/modules/Image/colors.c:1507:
cs=(struct color_struct*) 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 args )
+
static void image_color__encode( INT32
UNUSED(
args
)
)
{ push_int( THIS->rgbl.r ); push_int( THIS->rgbl.g ); push_int( THIS->rgbl.b ); f_aggregate( 3 ); }
-
static void image_color__decode( INT32 args )
+
static void image_color__decode( INT32
UNUSED(
args
)
)
{ struct svalue *a; if( TYPEOF(Pike_sp[-1]) != PIKE_T_ARRAY || Pike_sp[-1].u.array->size != 3 ) Pike_error("Illegal argument to _decode\n"); a=Pike_sp[-1].u.array->item; THIS->rgbl.r = a[0].u.integer; THIS->rgbl.g = a[1].u.integer; THIS->rgbl.b = a[2].u.integer; RGBL_TO_RGB(THIS->rgb,THIS->rgbl); pop_stack();
pike.git/src/modules/Image/colors.c:1747:
set_init_callback(init_color_struct); set_exit_callback(exit_color_struct); /* color info methods */ ADD_FUNCTION("cast",image_color_cast,tFunc(tStr,tOr(tArray,tStr)),0); ADD_FUNCTION("_sprintf",image_color__sprintf, tFunc(tInt tMap(tStr,tMix),tStr),0); ADD_FUNCTION("`[]",image_color_index,tFunc(tOr(tStr,tInt),tOr(tInt,tFunction)),0); ADD_FUNCTION("`->",image_color_index,tFunc(tOr(tStr,tInt),tOr(tInt,tFunction)),0);
-
ADD_FUNCTION("`==",image_color_equal,tFunc(tOr(tObjImpl_IMAGE_COLOR_COLOR
_ID
,tInt),
+
ADD_FUNCTION("`==",image_color_equal,tFunc(tOr(tObjImpl_IMAGE_COLOR_COLOR,tInt),
tInt),0); ADD_FUNCTION("__hash",image_color___hash,tFunc(tNone,tInt),0); ADD_FUNCTION("_encode", image_color__encode,tFunc(tNone,tArr(tInt)),0); ADD_FUNCTION("_decode", image_color__decode,tFunc(tInt,tVoid),0); ADD_FUNCTION("name",image_color_name,tFunc(tNone,tStr),0); ADD_FUNCTION("hex",image_color_hex,tFunc(tNone,tStr),0); ADD_FUNCTION("html",image_color_html,tFunc(tNone,tStr),0);
pike.git/src/modules/Image/colors.c:1770:
ADD_FUNCTION("rgbf",image_color_rgbf,tFunc(tNone,tArr(tFlt)),0); ADD_FUNCTION("hsv",image_color_hsv,tFunc(tNone,tArr(tInt)),0); ADD_FUNCTION("hsvf",image_color_hsvf,tFunc(tNone,tArr(tFlt)),0); ADD_FUNCTION("cmyk",image_color_cmyk,tFunc(tNone,tArr(tFlt)),0); ADD_FUNCTION("greylevel",image_color_greylevel,tOr(tFunc(tNone,tInt), tFunc(tInt tInt tInt,tInt)),0); /* color conversion methods */ ADD_FUNCTION("grey",image_color_grey,
-
tOr(tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),
-
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
)),0);
+
tOr(tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),
+
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR)),0);
-
ADD_FUNCTION("light",image_color_light,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
-
ADD_FUNCTION("dark",image_color_dark,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
-
ADD_FUNCTION("neon",image_color_neon,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
-
ADD_FUNCTION("bright",image_color_bright,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
-
ADD_FUNCTION("dull",image_color_dull,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
ADD_FUNCTION("light",image_color_light,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),0);
+
ADD_FUNCTION("dark",image_color_dark,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),0);
+
ADD_FUNCTION("neon",image_color_neon,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),0);
+
ADD_FUNCTION("bright",image_color_bright,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),0);
+
ADD_FUNCTION("dull",image_color_dull,tFunc(tNone,tObjIs_IMAGE_COLOR_COLOR),0);
-
ADD_FUNCTION("`*",image_color_mult,tFunc(tFlt,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
-
ADD_FUNCTION("`+",image_color_add,tFunc(tObjImpl_IMAGE_COLOR_COLOR
_ID
,
-
tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
ADD_FUNCTION("`*",image_color_mult,tFunc(tFlt,tObjIs_IMAGE_COLOR_COLOR),0);
+
ADD_FUNCTION("`+",image_color_add,tFunc(tObjImpl_IMAGE_COLOR_COLOR,
+
tObjIs_IMAGE_COLOR_COLOR),0);
image_color_program=end_program(); image_color_program->flags |= PROGRAM_CONSTANT | PROGRAM_NO_EXPLICIT_DESTRUCT ; PIKE_MODULE_EXPORT(Image, image_color_program); /* this is the Image.Color stuff */
-
ADD_FUNCTION("`[]",image_colors_index,tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
ADD_FUNCTION("`[]",image_colors_index,tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR),0);
ADD_FUNCTION("`()",image_make_color,
-
tOr3(tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR
_ID
),
-
tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
),
-
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
)),0);
+
tOr3(tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR),
+
tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR),
+
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR)),0);
ADD_FUNCTION("rgb",image_make_rgb_color,
-
tOr(tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
),
-
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
)),0);
+
tOr(tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR),
+
tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR)),0);
ADD_FUNCTION("hsv",image_make_hsv_color,
-
tOr(tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
),
-
tFunc(tFlt tFlt tFlt,tObjIs_IMAGE_COLOR_COLOR
_ID
))
,0);
+
tOr(tFunc(tInt tInt tInt,tObjIs_IMAGE_COLOR_COLOR),
+
tFunc(tFlt tFlt tFlt,tObjIs_IMAGE_COLOR_COLOR)),0);
ADD_FUNCTION("cmyk",image_make_cmyk_color,tFunc(tOr(tInt,tFlt) tOr(tInt,tFlt) tOr(tInt,tFlt) tOr(tInt,tFlt),
-
tObjIs_IMAGE_COLOR_COLOR
_ID
), 0);
+
tObjIs_IMAGE_COLOR_COLOR), 0);
ADD_FUNCTION("html",image_make_html_color,
-
tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR),0);
ADD_FUNCTION("guess",image_guess_color,
-
tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
tFunc(tStr,tObjIs_IMAGE_COLOR_COLOR),0);
ADD_FUNCTION("greylevel",image_make_greylevel_color,
-
tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR
_ID
),0);
+
tFunc(tInt,tObjIs_IMAGE_COLOR_COLOR),0);
ADD_FUNCTION("_indices",image_colors_indices, tFunc(tNone,tArr(tStr)),0); ADD_FUNCTION("_values",image_colors_values,
-
tFunc(tNone,tArr(tObjIs_IMAGE_COLOR_COLOR
_ID
)),0);
+
tFunc(tNone,tArr(tObjIs_IMAGE_COLOR_COLOR)),0);
image_color_program->id = PROG_IMAGE_COLOR_COLOR_ID; add_program_constant("Color",image_color_program,0); } void exit_image_colors(void) { free_program(image_color_program); if (colors)