Example #1
0
        if( im_greyc_mask( src, dst, NULL,
		iterations,
		amplitude, sharpness, anisotropy,
		alpha, sigma, 
		dl, da, gauss_prec, 
		interpolation, fast_approx ) )
		return( -1 );

        return( 0 );
}

static im_arg_desc greyc_arg_types[] = {
        IM_INPUT_IMAGE( "src" ),
        IM_OUTPUT_IMAGE( "dst" ),
        IM_INPUT_INT( "iterations" ),
	IM_INPUT_DOUBLE( "amplitude" ),
	IM_INPUT_DOUBLE( "sharpness" ),
	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 */
Example #2
0
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_INPUT_INT( "x" ),
	IM_INPUT_INT( "y" ),
	IM_INPUT_INT( "w" ),
	IM_INPUT_INT( "h" )
};

/* Call im_affinei via arg vector.
 */
static int
affinei_vec( im_object *argv )
};

/* Two images in, one out.
 */
static im_arg_desc two_in_one_out[] = {
	IM_INPUT_IMAGE( "in1" ),
	IM_INPUT_IMAGE( "in2" ),
	IM_OUTPUT_IMAGE( "out" )
};

/* Args to im_stretch3.
 */
static im_arg_desc stretch3_args[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_DOUBLE( "xdisp" ),
	IM_INPUT_DOUBLE( "ydisp" )
};

/* Call im_stretch3 via arg vector.
 */
static int
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.
Example #4
0
static im_function subsample_desc = {
	"im_subsample",			/* Name */
	"subsample image by integer factors",	/* Description */
	IM_FN_PIO,			/* Flags */
	subsample_vec,			/* Dispatch function */
	IM_NUMBER( subsample_args ), 	/* Size of arg list */
	subsample_args 			/* Arg list */
};

/* Args for im_gaussnoise.
 */
static im_arg_desc gaussnoise_args[] = {
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "xsize" ),
	IM_INPUT_INT( "ysize" ),
	IM_INPUT_DOUBLE( "mean" ),
	IM_INPUT_DOUBLE( "sigma" )
};

/* Call im_gaussnoise via arg vector.
 */
static int
gaussnoise_vec( im_object *argv )
{
	int xsize = *((int *) argv[1]);
	int ysize = *((int *) argv[2]);
	double mean = *((double *) argv[3]);
	double sigma = *((double *) argv[4]);

	if( im_gaussnoise( argv[0], xsize, ysize, mean, sigma ) )
		return( -1 );
Example #5
0
 * @stability: Stable
 * @include: vips/vips.h
 *
 * These functions generate various test images. You can combine them with
 * the arithmetic and rotate functions to build more complicated images.
 *
 * The im_benchmark() operations are for testing the VIPS SMP system.
 */

/* Args for im_sines.
 */
static im_arg_desc sines_args[] = {
    IM_OUTPUT_IMAGE( "out" ),
    IM_INPUT_INT( "xsize" ),
    IM_INPUT_INT( "ysize" ),
    IM_INPUT_DOUBLE( "horfreq" ),
    IM_INPUT_DOUBLE( "verfreq" )
};

/* Call im_sines via arg vector.
 */
static int
sines_vec( im_object *argv )
{
    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 ) );
}
};

/* Two images in, one out.
 */
static im_arg_desc two_in_one_out[] = {
	IM_INPUT_IMAGE( "in1" ),
	IM_INPUT_IMAGE( "in2" ),
	IM_OUTPUT_IMAGE( "out" )
};

/* Args to im_addgnoise.
 */
static im_arg_desc addgnoise_args[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_DOUBLE( "sigma" )
};

/* Call im_addgnoise via arg vector.
 */
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 = {