Merge branch 'cl' of https://github.com/neheb/libvips into neheb-cl

This commit is contained in:
John Cupitt 2021-10-29 18:25:50 +01:00
commit 4f9ea61170

View File

@ -60,11 +60,12 @@ VIPS_NAMESPACE_START
std::vector<double>
to_vectorv( int n, ... )
{
std::vector<double> vector( n );
std::vector<double> vector;
vector.reserve( n );
va_list ap;
va_start( ap, n );
for( int i = 0; i < n; i++ )
for( std::vector<double>::size_type i = 0; i < size_t(n); i++ )
vector[i] = va_arg( ap, double );
va_end( ap );
@ -80,9 +81,10 @@ to_vector( double value )
std::vector<double>
to_vector( int n, double array[] )
{
std::vector<double> vector( n );
std::vector<double> vector;
vector.reserve( n );
for( int i = 0; i < n; i++ )
for( std::vector<double>::size_type i = 0; i < size_t(n); i++ )
vector[i] = array[i];
return( vector );
@ -91,9 +93,10 @@ to_vector( int n, double array[] )
std::vector<double>
negate( std::vector<double> vector )
{
std::vector<double> new_vector( vector.size() );
std::vector<double> new_vector;
new_vector.reserve( vector.size() );
for( unsigned int i = 0; i < vector.size(); i++ )
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
new_vector[i] = vector[i] * -1;
return( new_vector );
@ -102,9 +105,10 @@ negate( std::vector<double> vector )
std::vector<double>
invert( std::vector<double> vector )
{
std::vector<double> new_vector( vector.size() );
std::vector<double> new_vector;
new_vector.reserve( vector.size() );
for( unsigned int i = 0; i < vector.size(); i++ )
for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
new_vector[i] = 1.0 / vector[i];
return( new_vector );
@ -210,7 +214,6 @@ VOption::set( const char *name, std::vector<int> value )
Pair *pair = new Pair( name );
int *array;
unsigned int i;
pair->input = true;
@ -219,7 +222,7 @@ VOption::set( const char *name, std::vector<int> value )
static_cast< int >( value.size() ) );
array = vips_value_get_array_int( &pair->value, NULL );
for( i = 0; i < value.size(); i++ )
for( std::vector<double>::size_type i = 0; i < value.size(); i++ )
array[i] = value[i];
options.push_back( pair );
@ -234,7 +237,6 @@ VOption::set( const char *name, std::vector<double> value )
Pair *pair = new Pair( name );
double *array;
unsigned int i;
pair->input = true;
@ -243,7 +245,7 @@ VOption::set( const char *name, std::vector<double> value )
static_cast< int >( value.size() ) );
array = vips_value_get_array_double( &pair->value, NULL );
for( i = 0; i < value.size(); i++ )
for( std::vector<double>::size_type i = 0; i < value.size(); i++ )
array[i] = value[i];
options.push_back( pair );
@ -258,7 +260,6 @@ VOption::set( const char *name, std::vector<VImage> value )
Pair *pair = new Pair( name );
VipsImage **array;
unsigned int i;
pair->input = true;
@ -267,7 +268,7 @@ VOption::set( const char *name, std::vector<VImage> value )
static_cast< int >( value.size() ) );
array = vips_value_get_array_image( &pair->value, NULL );
for( i = 0; i < value.size(); i++ ) {
for( std::vector<double>::size_type i = 0; i < value.size(); i++ ) {
VipsImage *vips_image = value[i].get_image();
array[i] = vips_image;
@ -488,10 +489,8 @@ VOption::get_operation( VipsOperation *operation )
double *array =
vips_value_get_array_double( value,
&length );
int j;
((*i)->vvector)->resize( length );
for( j = 0; j < length; j++ )
for( size_t j = 0; j < length; j++ )
(*((*i)->vvector))[j] = array[j];
}
else if( type == VIPS_TYPE_BLOB ) {