Beispiel #1
0
 *
 * applied to an image with im_erode(), will find all black pixels
 * 4-way connected with white pixels. Essentially, im_dilate()
 * sets pixels in the output if any part of the mask matches, whereas
 * im_erode() sets pixels only if all of the mask matches.
 *
 * See im_andimage(), im_orimage() and im_eorimage()
 * for analogues of the usual set difference and set union operations.
 */

/* Args to im_profile.
 */
static im_arg_desc profile_args[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "direction" )
};

/* Call im_profile via arg vector.
 */
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 = {
Beispiel #2
0
static int
icc_transform_vec( im_object *argv )
{
	int intent = *((int *) argv[4]);

	return( im_icc_transform( argv[0], argv[1], 
		argv[2], argv[3], intent ) );
}

static im_arg_desc icc_transform_args[] = {
        IM_INPUT_IMAGE( "in" ),
        IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_STRING( "input_profile" ),
	IM_INPUT_STRING( "output_profile" ),
	IM_INPUT_INT( "intent" )
};

/* Description of im_icc_transform.
 */ 
static im_function icc_transform_desc = {
	"im_icc_transform", 		/* Name */
	"convert between two device images with a pair of ICC profiles",
					/* Description */
	IM_FN_PIO,			/* Flags */
	icc_transform_vec, 		/* Dispatch function */
	IM_NUMBER( icc_transform_args ), 	/* Size of arg list */
	icc_transform_args 		/* Arg list */
};

static int
Beispiel #3
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 */
 * correction factors which will minimise these differences, and reassembles
 * the mosaic.
 * im_remosaic() uses the
 * same
 * techniques, but will reassemble the image from a different set of source
 * images.
 *
 */

/* Merge args.
 */
static im_arg_desc merge_args[] = {
	IM_INPUT_IMAGE( "ref" ),
	IM_INPUT_IMAGE( "sec" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "dx" ),
	IM_INPUT_INT( "dy" ),
	IM_INPUT_INT( "mwidth" )
};

/* Merge1 args.
 */
static im_arg_desc merge1_args[] = {
	IM_INPUT_IMAGE( "ref" ),
	IM_INPUT_IMAGE( "sec" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "xr1" ),
	IM_INPUT_INT( "yr1" ),
	IM_INPUT_INT( "xs1" ),
	IM_INPUT_INT( "ys1" ),
	IM_INPUT_INT( "xr2" ),
 */ 
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
contrast_surface_vec( im_object *argv )
{
	int half_win_size = *((int *) argv[2]);
	int spacing = *((int *) argv[3]);

	return( im_contrast_surface( argv[0], argv[1], 
		half_win_size, spacing ) );
}
Beispiel #6
0
/** 
 * SECTION: resample
 * @short_description: shrink, expand, rotate with a choice of interpolators
 * @stability: Stable
 * @include: vips/vips.h
 *
 * Resample an image in various ways, using a #VipsInterpolate to generate
 * intermediate values.
 */

/* Args to im_rightshift_size.
 */
static im_arg_desc rightshift_size_args[] = {
  IM_INPUT_IMAGE ("in"),
  IM_OUTPUT_IMAGE ("out"),
  IM_INPUT_INT ("xshift"),
  IM_INPUT_INT ("yshift"),
  IM_INPUT_INT ("band_fmt")
};

/* Call im_rightshift_size via arg vector.
 */
static int
rightshift_size_vec (im_object * argv)
{
  IMAGE *in = (IMAGE *) argv[0];
  IMAGE *out = (IMAGE *) argv[1];
  int *xshift = (int *) argv[2];
  int *yshift = (int *) argv[3];
  int *band_fmt = (int *) argv[4];
Beispiel #7
0
        char *device = (char *) argv[1];
        int channel = *((int*)argv[2]);
        int brightness = *((int*)argv[3]);
        int colour = *((int*)argv[4]);
        int contrast = *((int*)argv[5]);
        int hue = *((int*)argv[6]);
        int ngrabs = *((int*)argv[7]);

        return( im_video_v4l1( out, device, 
		channel, brightness, colour, contrast, hue, ngrabs ) );
}

static im_arg_desc video_v4l1_arg_types[] = {
        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 */
};
Beispiel #8
0
{
	IMAGE *in = argv[0];
	IMAGE *out = argv[1];
	int xsh = *((int *) argv[2]);
	int ysh = *((int *) argv[3]);

	if( im_subsample( in, out, xsh, ysh ) )
		return( -1 );

	return( 0 );
}

static im_arg_desc subsample_args[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "xshrink" ),
	IM_INPUT_INT( "yshrink" )
};

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[] = {
Beispiel #9
0
 */

/* 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" )
};

/* One image plus one constant in, one image out.
 */
static im_arg_desc const_in_one_out[] = {
	IM_INPUT_IMAGE( "in1" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_INT( "c" )
};

/* One image plus doublevec in, one image out.
 */
static im_arg_desc vec_in_one_out[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" ),
	IM_INPUT_DOUBLEVEC( "vec" )
};

/* Call im_andimage via arg vector.
 */
static int
andimage_vec( im_object *argv )
{
Beispiel #10
0
 * SECTION: other
 * @short_description: miscellaneous operators
 * @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]);
 */ 
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
contrast_surface_vec( im_object *argv )
{
	int half_win_size = *((int *) argv[2]);
	int spacing = *((int *) argv[3]);

	return( im_contrast_surface( argv[0], argv[1], 
		half_win_size, spacing ) );
}