"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cplusplus/VImage.cpp" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

VImage.cpp  (vips-8.10.6):VImage.cpp  (vips-8.11.0)
skipping to change at line 54 skipping to change at line 54
#include <vips/debug.h> #include <vips/debug.h>
/* /*
#define VIPS_DEBUG #define VIPS_DEBUG
#define VIPS_DEBUG_VERBOSE #define VIPS_DEBUG_VERBOSE
*/ */
VIPS_NAMESPACE_START VIPS_NAMESPACE_START
/**
* \namespace vips
*
* General docs for the vips namespace.
*/
std::vector<double> std::vector<double>
to_vectorv( int n, ... ) to_vectorv( int n, ... )
{ {
std::vector<double> vector( n ); std::vector<double> vector( n );
va_list ap; va_list ap;
va_start( ap, n ); va_start( ap, n );
for( int i = 0; i < n; i++ ) for( int i = 0; i < n; i++ )
vector[i] = va_arg( ap, double ); vector[i] = va_arg( ap, double );
va_end( ap ); va_end( ap );
skipping to change at line 143 skipping to change at line 149
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
pair->input = true; pair->input = true;
g_value_init( &pair->value, G_TYPE_INT ); g_value_init( &pair->value, G_TYPE_INT );
g_value_set_int( &pair->value, value ); g_value_set_int( &pair->value, value );
options.push_back( pair ); options.push_back( pair );
return( this ); return( this );
} }
// input guint64
VOption *
VOption::set( const char *name, guint64 value )
{
Pair *pair = new Pair( name );
pair->input = true;
g_value_init( &pair->value, G_TYPE_UINT64 );
g_value_set_uint64( &pair->value, value );
options.push_back( pair );
return( this );
}
// input double // input double
VOption * VOption *
VOption::set( const char *name, double value ) VOption::set( const char *name, double value )
{ {
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
pair->input = true; pair->input = true;
g_value_init( &pair->value, G_TYPE_DOUBLE ); g_value_init( &pair->value, G_TYPE_DOUBLE );
g_value_set_double( &pair->value, value ); g_value_set_double( &pair->value, value );
options.push_back( pair ); options.push_back( pair );
skipping to change at line 170 skipping to change at line 190
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
pair->input = true; pair->input = true;
g_value_init( &pair->value, G_TYPE_STRING ); g_value_init( &pair->value, G_TYPE_STRING );
g_value_set_string( &pair->value, value ); g_value_set_string( &pair->value, value );
options.push_back( pair ); options.push_back( pair );
return( this ); return( this );
} }
// input image // input vips object (image, source, target, etc. etc.)
VOption * VOption *
VOption::set( const char *name, const VImage value ) VOption::set( const char *name, const VObject value )
{ {
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
VipsObject *object = value.get_object();
GType type = G_OBJECT_TYPE( object );
pair->input = true; pair->input = true;
g_value_init( &pair->value, VIPS_TYPE_IMAGE ); g_value_init( &pair->value, type );
g_value_set_object( &pair->value, value.get_image() ); g_value_set_object( &pair->value, object );
options.push_back( pair ); options.push_back( pair );
return( this ); return( this );
} }
// input double array // input int array
VOption * VOption *
VOption::set( const char *name, std::vector<double> value ) VOption::set( const char *name, std::vector<int> value )
{ {
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
double *array; int *array;
unsigned int i; unsigned int i;
pair->input = true; pair->input = true;
g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE ); g_value_init( &pair->value, VIPS_TYPE_ARRAY_INT );
vips_value_set_array_double( &pair->value, NULL, vips_value_set_array_int( &pair->value, NULL,
static_cast< int >( value.size() ) ); static_cast< int >( value.size() ) );
array = vips_value_get_array_double( &pair->value, NULL ); array = vips_value_get_array_int( &pair->value, NULL );
for( i = 0; i < value.size(); i++ ) for( i = 0; i < value.size(); i++ )
array[i] = value[i]; array[i] = value[i];
options.push_back( pair ); options.push_back( pair );
return( this ); return( this );
} }
// input int array // input double array
VOption * VOption *
VOption::set( const char *name, std::vector<int> value ) VOption::set( const char *name, std::vector<double> value )
{ {
Pair *pair = new Pair( name ); Pair *pair = new Pair( name );
int *array; double *array;
unsigned int i; unsigned int i;
pair->input = true; pair->input = true;
g_value_init( &pair->value, VIPS_TYPE_ARRAY_INT ); g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE );
vips_value_set_array_int( &pair->value, NULL, vips_value_set_array_double( &pair->value, NULL,
static_cast< int >( value.size() ) ); static_cast< int >( value.size() ) );
array = vips_value_get_array_int( &pair->value, NULL ); array = vips_value_get_array_double( &pair->value, NULL );
for( i = 0; i < value.size(); i++ ) for( i = 0; i < value.size(); i++ )
array[i] = value[i]; array[i] = value[i];
options.push_back( pair ); options.push_back( pair );
return( this ); return( this );
} }
// input image array // input image array
skipping to change at line 623 skipping to change at line 645
options = (options ? options : VImage::option())-> options = (options ? options : VImage::option())->
set( "source", source )-> set( "source", source )->
set( "out", &out ); set( "out", &out );
call_option_string( operation_name, option_string, options ); call_option_string( operation_name, option_string, options );
return( out ); return( out );
} }
VImage VImage
VImage::new_from_memory_steal( void *data, size_t size,
int width, int height, int bands, VipsBandFormat format )
{
VipsImage *image;
if( !(image = vips_image_new_from_memory( data, size,
width, height, bands, format )) )
throw( VError() );
g_signal_connect( image, "postclose",
G_CALLBACK( vips_image_free_buffer ), data);
return( VImage( image ) );
}
VImage
VImage::new_matrix( int width, int height ) VImage::new_matrix( int width, int height )
{ {
return( VImage( vips_image_new_matrix( width, height ) ) ); return( VImage( vips_image_new_matrix( width, height ) ) );
} }
VImage VImage
VImage::new_matrixv( int width, int height, ... ) VImage::new_matrixv( int width, int height, ... )
{ {
VImage matrix = new_matrix( width, height ); VImage matrix = new_matrix( width, height );
VipsImage *vips_matrix = matrix.get_image(); VipsImage *vips_matrix = matrix.get_image();
 End of changes. 17 change blocks. 
16 lines changed or deleted 54 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)