Add missing file from commit fc233ed

This commit is contained in:
Lovell Fuller 2017-11-27 19:35:08 +00:00
parent 929ea10f76
commit 1be424cd47

View File

@ -205,6 +205,30 @@ VOption::set( const char *name, std::vector<double> value )
return( this ); return( this );
} }
// input int array
VOption *
VOption::set( const char *name, std::vector<int> value )
{
Pair *pair = new Pair( name );
int *array;
unsigned int i;
pair->input = true;
g_value_init( &pair->value, VIPS_TYPE_ARRAY_INT );
vips_value_set_array_int( &pair->value, NULL,
static_cast< int >( value.size() ) );
array = vips_value_get_array_int( &pair->value, NULL );
for( i = 0; i < value.size(); i++ )
array[i] = value[i];
options.push_back( pair );
return( this );
}
// input image array // input image array
VOption * VOption *
VOption::set( const char *name, std::vector<VImage> value ) VOption::set( const char *name, std::vector<VImage> value )
@ -465,8 +489,7 @@ VImage::call_option_string( const char *operation_name,
operation_name ); operation_name );
if( !(operation = vips_operation_new( operation_name )) ) { if( !(operation = vips_operation_new( operation_name )) ) {
if( options ) delete options;
delete options;
throw( VError() ); throw( VError() );
} }
@ -671,6 +694,17 @@ VImage::bandjoin( VImage other, VOption *options )
return( bandjoin( vec, options ) ); return( bandjoin( vec, options ) );
} }
VImage
VImage::composite( VImage other, VipsBlendMode mode, VOption *options )
{
VImage v[2] = { *this, other };
std::vector<VImage> ivec( v, v + VIPS_NUMBER( v ) );
int m[1] = { static_cast<int>( mode ) };
std::vector<int> mvec( m, m + VIPS_NUMBER( m ) );
return( composite( ivec, mvec, options ) );
}
std::complex<double> std::complex<double>
VImage::minpos( VOption *options ) VImage::minpos( VOption *options )
{ {