From a19c6cd17561473e60b73a58a9172af79a16a5f1 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 5 Nov 2009 13:41:21 +0000 Subject: [PATCH] stuff --- libvips/deprecated/deprecated_dispatch.c | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/libvips/deprecated/deprecated_dispatch.c b/libvips/deprecated/deprecated_dispatch.c index f308a5d1..aada2c60 100644 --- a/libvips/deprecated/deprecated_dispatch.c +++ b/libvips/deprecated/deprecated_dispatch.c @@ -781,10 +781,51 @@ static im_function resize_linear_desc = { "resize to X by Y pixels with linear interpolation", 0, /* Flags */ resize_linear_vec, /* Dispatch function */ - IM_NUMBER( resize_linear_args ), /* Size of arg list */ + IM_NUMBER( resize_linear_args ), /* Size of arg list */ resize_linear_args /* Arg list */ }; +/* Args for im_insertplaceset. + */ +static im_arg_desc insertplaceset_args[] = { + IM_INPUT_IMAGE( "main" ), + IM_INPUT_IMAGE( "sub" ), + IM_OUTPUT_IMAGE( "out" ), + IM_INPUT_INTVEC( "x" ), + IM_INPUT_INTVEC( "y" ) +}; + +/* Call im_insertplaceplaceset via arg vector. + */ +static int +insertplaceset_vec( im_object *argv ) +{ + im_intvec_object *xv = (im_intvec_object *) argv[3]; + im_intvec_object *yv = (im_intvec_object *) argv[4]; + + if( xv->n != yv->n ) { + im_error( "im_insertplaceset", "%s", + _( "vectors not same length" ) ); + return( -1 ); + } + + if( im_insertset( argv[0], argv[1], argv[2], xv->n, xv->vec, yv->vec ) ) + return( -1 ); + + return( 0 ); +} + +/* Description of im_insertplaceset. + */ +static im_function insertplaceset_desc = { + "im_insertplaceset", /* Name */ + "insert sub into main at every position in x, y", + 0, /* Flags */ + insertplaceset_vec, /* Dispatch function */ + IM_NUMBER( insertplaceset_args ), /* Size of arg list */ + insertplaceset_args /* Arg list */ +}; + /* Package up all these functions. */ static im_function *deprecated_list[] = { @@ -805,6 +846,7 @@ static im_function *deprecated_list[] = { &convsub_desc, &clip2s_desc, &clip2ui_desc, + &insertplaceset_desc, &clip2us_desc, &print_desc, &slice_desc,