IM_INPUT_DOUBLE( "anisotropy" ), IM_INPUT_DOUBLE( "alpha" ), IM_INPUT_DOUBLE( "sigma" ), IM_INPUT_DOUBLE( "dl" ), IM_INPUT_DOUBLE( "da" ), IM_INPUT_DOUBLE( "gauss_prec" ), IM_INPUT_INT( "interpolation" ), IM_INPUT_INT( "fast_approx" ) }; static im_function greyc_desc = { "im_greyc", /* Name */ "noise-removing filter", /* Description */ (im_fn_flags) (IM_FN_TRANSFORM | IM_FN_PIO),/* Flags */ greyc_vec, /* Dispatch function */ IM_NUMBER( greyc_arg_types ), /* Size of arg list */ greyc_arg_types /* Arg list */ }; static int greyc_mask_vec( im_object *argv ) { IMAGE *src = (IMAGE *) argv[0]; IMAGE *dst = (IMAGE *) argv[1]; IMAGE *mask = (IMAGE *) argv[2]; int iterations = *((int *) argv[3]); double amplitude = *((double *) argv[4]); double sharpness = *((double *) argv[5]); double anisotropy = *((double *) argv[6]); double alpha = *((double *) argv[7]);
stretch3_vec( im_object *argv ) { double xdisp = *((int *) argv[2]); double ydisp = *((int *) argv[3]); return( im_stretch3( argv[0], argv[1], xdisp, ydisp ) ); } /* Description of im_stretch3. */ static im_function stretch3_desc = { "im_stretch3", /* Name */ "stretch 3%, sub-pixel displace by xdisp/ydisp", IM_FN_PIO, /* Flags */ stretch3_vec, /* Dispatch function */ IM_NUMBER( stretch3_args ), /* Size of arg list */ stretch3_args /* Arg list */ }; /* Args to im_contrast_surface. */ static im_arg_desc contrast_surface_args[] = { IM_INPUT_IMAGE( "in" ), IM_OUTPUT_IMAGE( "out" ), IM_INPUT_INT( "half_win_size" ), IM_INPUT_INT( "spacing" ) }; /* Call im_contrast_surface via arg vector. */ static int
IMAGE *out = (IMAGE *) argv[1]; int *xshift = (int *) argv[2]; int *yshift = (int *) argv[3]; int *band_fmt = (int *) argv[4]; return im_rightshift_size (in, out, *xshift, *yshift, *band_fmt ); } /* Description of im_rightshift_size. */ static im_function rightshift_size_desc = { "im_rightshift_size", /* Name */ "decrease size by a power-of-two factor", IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ rightshift_size_vec, /* Dispatch function */ IM_NUMBER (rightshift_size_args), /* Size of arg list */ rightshift_size_args /* Arg list */ }; /* affinei args */ static im_arg_desc affinei_args[] = { IM_INPUT_IMAGE( "in" ), IM_OUTPUT_IMAGE( "out" ), IM_INPUT_INTERPOLATE( "interpolate" ), IM_INPUT_DOUBLE( "a" ), IM_INPUT_DOUBLE( "b" ), IM_INPUT_DOUBLE( "c" ), IM_INPUT_DOUBLE( "d" ), IM_INPUT_DOUBLE( "dx" ), IM_INPUT_DOUBLE( "dy" ),
IM_OUTPUT_IMAGE( "out" ), IM_INPUT_STRING( "device" ), IM_INPUT_INT( "channel" ), IM_INPUT_INT( "brightness" ), IM_INPUT_INT( "colour" ), IM_INPUT_INT( "contrast" ), IM_INPUT_INT( "hue" ), IM_INPUT_INT( "ngrabs" ) }; static im_function video_v4l1_desc = { "im_video_v4l1", /* Name */ "grab a video frame with v4l1", /* Description */ IM_FN_NOCACHE, /* Flags */ video_v4l1_vec, /* Dispatch function */ IM_NUMBER( video_v4l1_arg_types ), /* Size of arg list */ video_v4l1_arg_types /* Arg list */ }; static int video_test_vec( im_object *argv ) { IMAGE *out = argv[0]; int brightness = *((int*)argv[1]); int error = *((int*)argv[2]); return( im_video_test( out, brightness, error ) ); } static im_arg_desc video_test_arg_types[] = { IM_OUTPUT_IMAGE( "out" ),
" </menu>" " </menubar>" "</ui>"; static void trace_class_init( TraceClass *class ) { GtkObjectClass *object_class = (GtkObjectClass *) class; LogClass *log_class = (LogClass *) class; parent_class = g_type_class_peek_parent( class ); object_class->destroy = trace_destroy; log_class->actions = trace_actions; log_class->n_actions = IM_NUMBER( trace_actions ); log_class->toggle_actions = trace_toggle_actions; log_class->n_toggle_actions = IM_NUMBER( trace_toggle_actions ); log_class->action_name = "TraceActions"; log_class->ui_description = trace_menubar_ui_description; log_class->menu_bar_name = "/TraceMenubar"; } static void trace_init( Trace *trace ) { trace->flags = 0; } GtkType trace_get_type( void )
if( !(out->mask = im_matinv( in->mask, out->name )) ) return( -1 ); return( 0 ); } /* Description of im_matinv. */ static im_function matinv_desc = { "im_matinv", /* Name */ "invert matrix", 0, /* Flags */ matinv_vec, /* Dispatch function */ IM_NUMBER( one_in_one_out ), /* Size of arg list */ one_in_one_out /* Arg list */ }; /* Call im_mattrn via arg vector. */ static int mattrn_vec( im_object *argv ) { im_mask_object *in = argv[0]; im_mask_object *out = argv[1]; if( !(out->mask = im_mattrn( in->mask, out->name )) ) return( -1 );
return( 0 ); } static im_arg_desc system_args[] = { IM_INPUT_IMAGE( "im" ), IM_INPUT_STRING( "command" ), IM_OUTPUT_STRING( "output" ) }; static im_function system_desc = { "im_system", /* Name */ "run command on image", /* Description */ 0, /* Flags */ system_vec, /* Dispatch function */ IM_NUMBER( system_args ), /* Size of arg list */ system_args /* Arg list */ }; static int system_image_vec( im_object *argv ) { IMAGE *in = argv[0]; IMAGE *out = argv[1]; char *in_format = argv[2]; char *out_format = argv[3]; char *cmd = argv[4]; char **log = (char **) &argv[5]; IMAGE *out_image;
/* Call im_andimage via arg vector. */ static int andimage_vec( im_object *argv ) { return( im_andimage( argv[0], argv[1], argv[2] ) ); } /* Description of im_andimage. */ static im_function andimage_desc = { "im_andimage", /* Name */ "bitwise and of two images", /* Description */ IM_FN_PTOP | IM_FN_PIO, /* Flags */ andimage_vec, /* Dispatch function */ IM_NUMBER( two_in_one_out ), /* Size of arg list */ two_in_one_out /* Arg list */ }; /* Call im_andimageconst via arg vector. */ static int andimageconst_vec( im_object *argv ) { int c = *((int *) argv[2]); return( im_andimageconst( argv[0], argv[1], c ) ); } /* Description of im_andconst. */
int xsize = *((int *) argv[1]); int ysize = *((int *) argv[2]); double horfreq = *((double *) argv[3]); double verfreq = *((double *) argv[4]); return( im_sines( argv[0], xsize, ysize, horfreq, verfreq ) ); } /* Description of im_sines. */ static im_function sines_desc = { "im_sines", /* Name */ "generate 2D sine image", 0, /* Flags */ sines_vec, /* Dispatch function */ IM_NUMBER( sines_args ), /* Size of arg list */ sines_args /* Arg list */ }; /* Args for im_eye. */ static im_arg_desc eye_args[] = { IM_OUTPUT_IMAGE( "out" ), IM_INPUT_INT( "xsize" ), IM_INPUT_INT( "ysize" ), IM_INPUT_DOUBLE( "factor" ) }; /* Call im_eye via arg vector. */ static int
static int addgnoise_vec( im_object *argv ) { double sigma = *((double *) argv[2]); return( im_addgnoise( argv[0], argv[1], sigma ) ); } /* Description of im_addgnoise. */ static im_function addgnoise_desc = { "im_addgnoise", /* Name */ "add gaussian noise with mean 0 and std. dev. sigma", IM_FN_PIO, /* Flags */ addgnoise_vec, /* Dispatch function */ IM_NUMBER( addgnoise_args ), /* Size of arg list */ addgnoise_args /* Arg list */ }; /* Args to im_contrast_surface. */ static im_arg_desc contrast_surface_args[] = { IM_INPUT_IMAGE( "in" ), IM_OUTPUT_IMAGE( "out" ), IM_INPUT_INT( "half_win_size" ), IM_INPUT_INT( "spacing" ) }; /* Call im_contrast_surface via arg vector. */ static int
static int profile_vec( im_object *argv ) { int dir = *((int *) argv[2]); return( im_profile( argv[0], argv[1], dir ) ); } /* Description of im_profile. */ static im_function profile_desc = { "im_profile", /* Name */ "find first horizontal/vertical edge", /* Descr. */ IM_FN_TRANSFORM, /* Flags */ profile_vec, /* Dispatch function */ IM_NUMBER( profile_args ), /* Size of arg list */ profile_args /* Arg list */ }; /* Args to im_erode. */ static im_arg_desc erode_args[] = { IM_INPUT_IMAGE( "in" ), IM_OUTPUT_IMAGE( "out" ), IM_INPUT_IMASK( "mask" ) }; /* Call im_dilate via arg vector. */ static int dilate_vec( im_object *argv )
"IM_THINSTRIP", "IM_ANY" }; /* Stuff to decode an enum. */ typedef struct _EnumTable { const char *error; /* eg. "<bad Coding>" */ const char **names; /* eg. {"IM_CODING_NONE",..} */ int nnames; } EnumTable; static EnumTable enumType = { N_( "<bad Type>" ), im_Type, IM_NUMBER( im_Type ) }; static EnumTable enumBandFmt = { N_( "<bad BandFmt>" ), im_BandFmt, IM_NUMBER( im_BandFmt ) }; static EnumTable enumCoding = { N_( "<bad Coding>" ), im_Coding, IM_NUMBER( im_Coding ) }; static EnumTable enumCompression = {