Exemple #1
0
/**
 * IM_E_X0:
 *
 * Areas under curves for equal energy illuminant E.
 */

/**
 * IM_D3250_X0:
 *
 * Areas under curves for black body at 3250K, 2 degree observer.
 */

/* One image in, one out.
 */
static im_arg_desc one_in_one_out[] = {
	IM_INPUT_IMAGE( "in" ),
	IM_OUTPUT_IMAGE( "out" )
};

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

/* Call im_sRGB2XYZ via arg vector.
 */
static int
sRGB2XYZ_vec( im_object *argv )
Exemple #2
0
 *   255 0   255
 *   128 255 128
 *
 * 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.
 * a mosaic
 * which has been assembled with these functions. It takes the mosaic apart,
 * measures image contrast differences along the seams, finds a set of
 * 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" ),
Exemple #4
0
	int interpolation = *((int *) argv[11]); 
	int fast_approx = *((int *) argv[12]); 

        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 = {
#include <vips/transform.h>

/** 
 * 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];
Exemple #6
0
static int
system_vec( im_object *argv )
{
	IMAGE *in = argv[0];
	char *cmd = argv[1];
	char **out = (char **) &argv[2];

	if( im_system( in, cmd, out ) )
		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 )