reformat
This commit is contained in:
parent
d6a6d7ae71
commit
35bcd4eaa0
|
@ -43,7 +43,8 @@
|
||||||
|
|
||||||
VIPS_NAMESPACE_START
|
VIPS_NAMESPACE_START
|
||||||
|
|
||||||
std::vector<double> to_vectorv( int n, ... )
|
std::vector<double>
|
||||||
|
to_vectorv( int n, ... )
|
||||||
{
|
{
|
||||||
std::vector<double> vector( n );
|
std::vector<double> vector( n );
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -56,12 +57,14 @@ std::vector<double> to_vectorv( int n, ... )
|
||||||
return( vector );
|
return( vector );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> to_vector( double value )
|
std::vector<double>
|
||||||
|
to_vector( double value )
|
||||||
{
|
{
|
||||||
return( to_vectorv( 1, value ) );
|
return( to_vectorv( 1, value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> to_vector( int n, double array[] )
|
std::vector<double>
|
||||||
|
to_vector( int n, double array[] )
|
||||||
{
|
{
|
||||||
std::vector<double> vector( n );
|
std::vector<double> vector( n );
|
||||||
|
|
||||||
|
@ -71,7 +74,8 @@ std::vector<double> to_vector( int n, double array[] )
|
||||||
return( vector );
|
return( vector );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> negate( std::vector<double> vector )
|
std::vector<double>
|
||||||
|
negate( std::vector<double> vector )
|
||||||
{
|
{
|
||||||
std::vector<double> new_vector( vector.size() );
|
std::vector<double> new_vector( vector.size() );
|
||||||
|
|
||||||
|
@ -81,7 +85,8 @@ std::vector<double> negate( std::vector<double> vector )
|
||||||
return( new_vector );
|
return( new_vector );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> invert( std::vector<double> vector )
|
std::vector<double>
|
||||||
|
invert( std::vector<double> vector )
|
||||||
{
|
{
|
||||||
std::vector<double> new_vector( vector.size() );
|
std::vector<double> new_vector( vector.size() );
|
||||||
|
|
||||||
|
@ -100,7 +105,8 @@ VOption::~VOption()
|
||||||
}
|
}
|
||||||
|
|
||||||
// input bool
|
// input bool
|
||||||
VOption *VOption::set( const char *name, bool value )
|
VOption *
|
||||||
|
VOption::set( const char *name, bool value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -113,7 +119,8 @@ VOption *VOption::set( const char *name, bool value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input int ... this path is used for enums as well
|
// input int ... this path is used for enums as well
|
||||||
VOption *VOption::set( const char *name, int value )
|
VOption *
|
||||||
|
VOption::set( const char *name, int value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -126,7 +133,8 @@ VOption *VOption::set( const char *name, int value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input double
|
// input double
|
||||||
VOption *VOption::set( const char *name, double value )
|
VOption *
|
||||||
|
VOption::set( const char *name, double value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -138,7 +146,8 @@ VOption *VOption::set( const char *name, double value )
|
||||||
return( this );
|
return( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
VOption *VOption::set( const char *name, const char *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, const char *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -151,7 +160,8 @@ VOption *VOption::set( const char *name, const char *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input image
|
// input image
|
||||||
VOption *VOption::set( const char *name, VImage value )
|
VOption *
|
||||||
|
VOption::set( const char *name, VImage value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -165,7 +175,8 @@ VOption *VOption::set( const char *name, VImage value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input double array
|
// input double array
|
||||||
VOption *VOption::set( const char *name, std::vector<double> value )
|
VOption *
|
||||||
|
VOption::set( const char *name, std::vector<double> value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -186,7 +197,8 @@ VOption *VOption::set( const char *name, std::vector<double> value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input image array
|
// input image array
|
||||||
VOption *VOption::set( const char *name, std::vector<VImage> value )
|
VOption *
|
||||||
|
VOption::set( const char *name, std::vector<VImage> value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -211,7 +223,8 @@ VOption *VOption::set( const char *name, std::vector<VImage> value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// input blob
|
// input blob
|
||||||
VOption *VOption::set( const char *name, VipsBlob *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, VipsBlob *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -224,7 +237,8 @@ VOption *VOption::set( const char *name, VipsBlob *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output bool
|
// output bool
|
||||||
VOption *VOption::set( const char *name, bool *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, bool *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -239,7 +253,8 @@ VOption *VOption::set( const char *name, bool *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output int
|
// output int
|
||||||
VOption *VOption::set( const char *name, int *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, int *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -254,7 +269,8 @@ VOption *VOption::set( const char *name, int *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output double
|
// output double
|
||||||
VOption *VOption::set( const char *name, double *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, double *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -269,7 +285,8 @@ VOption *VOption::set( const char *name, double *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output image
|
// output image
|
||||||
VOption *VOption::set( const char *name, VImage *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, VImage *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -284,7 +301,8 @@ VOption *VOption::set( const char *name, VImage *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output doublearray
|
// output doublearray
|
||||||
VOption *VOption::set( const char *name, std::vector<double> *value )
|
VOption *
|
||||||
|
VOption::set( const char *name, std::vector<double> *value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -298,7 +316,8 @@ VOption *VOption::set( const char *name, std::vector<double> *value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// output blob
|
// output blob
|
||||||
VOption *VOption::set( const char *name, VipsBlob **value )
|
VOption *
|
||||||
|
VOption::set( const char *name, VipsBlob **value )
|
||||||
{
|
{
|
||||||
Pair *pair = new Pair( name );
|
Pair *pair = new Pair( name );
|
||||||
|
|
||||||
|
@ -311,7 +330,8 @@ VOption *VOption::set( const char *name, VipsBlob **value )
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk the options and set props on the operation
|
// walk the options and set props on the operation
|
||||||
void VOption::set_operation( VipsOperation *operation )
|
void
|
||||||
|
VOption::set_operation( VipsOperation *operation )
|
||||||
{
|
{
|
||||||
std::list<Pair *>::iterator i;
|
std::list<Pair *>::iterator i;
|
||||||
|
|
||||||
|
@ -332,7 +352,8 @@ void VOption::set_operation( VipsOperation *operation )
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk the options and do any processing needed for output objects
|
// walk the options and do any processing needed for output objects
|
||||||
void VOption::get_operation( VipsOperation *operation )
|
void
|
||||||
|
VOption::get_operation( VipsOperation *operation )
|
||||||
{
|
{
|
||||||
std::list<Pair *>::iterator i;
|
std::list<Pair *>::iterator i;
|
||||||
|
|
||||||
|
@ -383,7 +404,8 @@ void VOption::get_operation( VipsOperation *operation )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VImage::call_option_string( const char *operation_name,
|
void
|
||||||
|
VImage::call_option_string( const char *operation_name,
|
||||||
const char *option_string, VOption *options )
|
const char *option_string, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
|
@ -437,13 +459,15 @@ void VImage::call_option_string( const char *operation_name,
|
||||||
g_object_unref( operation );
|
g_object_unref( operation );
|
||||||
}
|
}
|
||||||
|
|
||||||
void VImage::call( const char *operation_name, VOption *options )
|
void
|
||||||
|
VImage::call( const char *operation_name, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
call_option_string( operation_name, NULL, options );
|
call_option_string( operation_name, NULL, options );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage VImage::new_from_file( const char *name, VOption *options )
|
VImage
|
||||||
|
VImage::new_from_file( const char *name, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
char filename[VIPS_PATH_MAX];
|
char filename[VIPS_PATH_MAX];
|
||||||
|
@ -466,7 +490,8 @@ VImage VImage::new_from_file( const char *name, VOption *options )
|
||||||
return( out );
|
return( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage VImage::new_from_image( std::vector<double> pixel )
|
VImage
|
||||||
|
VImage::new_from_image( std::vector<double> pixel )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
VImage onepx = VImage::black( 1, 1,
|
VImage onepx = VImage::black( 1, 1,
|
||||||
|
@ -488,18 +513,21 @@ VImage VImage::new_from_image( std::vector<double> pixel )
|
||||||
return( big );
|
return( big );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage VImage::new_from_image( double pixel )
|
VImage
|
||||||
|
VImage::new_from_image( double pixel )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( new_from_image( to_vectorv( 1, pixel ) ) );
|
return( new_from_image( to_vectorv( 1, pixel ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage VImage::new_matrix( int width, int height )
|
VImage
|
||||||
|
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::new_matrixv( int width, int height, ... )
|
VImage
|
||||||
|
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();
|
||||||
|
@ -516,7 +544,8 @@ VImage VImage::new_matrixv( int width, int height, ... )
|
||||||
return( matrix );
|
return( matrix );
|
||||||
}
|
}
|
||||||
|
|
||||||
void VImage::write_to_file( const char *name, VOption *options )
|
void
|
||||||
|
VImage::write_to_file( const char *name, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
char filename[VIPS_PATH_MAX];
|
char filename[VIPS_PATH_MAX];
|
||||||
|
@ -537,7 +566,8 @@ void VImage::write_to_file( const char *name, VOption *options )
|
||||||
|
|
||||||
#include "vips-operators.cc"
|
#include "vips-operators.cc"
|
||||||
|
|
||||||
std::vector<VImage> VImage::bandsplit( VOption *options )
|
std::vector<VImage>
|
||||||
|
VImage::bandsplit( VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
std::vector<VImage> b;
|
std::vector<VImage> b;
|
||||||
|
@ -548,7 +578,8 @@ std::vector<VImage> VImage::bandsplit( VOption *options )
|
||||||
return( b );
|
return( b );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage VImage::bandjoin( VImage other, VOption *options )
|
VImage
|
||||||
|
VImage::bandjoin( VImage other, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
VImage v[2] = { *this, other };
|
VImage v[2] = { *this, other };
|
||||||
|
@ -557,7 +588,8 @@ VImage VImage::bandjoin( VImage other, VOption *options )
|
||||||
return( bandjoin( vec, options ) );
|
return( bandjoin( vec, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::complex<double> VImage::minpos( VOption *options )
|
std::complex<double>
|
||||||
|
VImage::minpos( VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
|
@ -570,7 +602,8 @@ std::complex<double> VImage::minpos( VOption *options )
|
||||||
return( std::complex<double>( x, y ) );
|
return( std::complex<double>( x, y ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::complex<double> VImage::maxpos( VOption *options )
|
std::complex<double>
|
||||||
|
VImage::maxpos( VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
double x, y;
|
double x, y;
|
||||||
|
|
|
@ -0,0 +1,92 @@
|
||||||
|
/*
|
||||||
|
* compile with:
|
||||||
|
*
|
||||||
|
* g++ -g -Wall try.cc `pkg-config vips-cc --cflags --libs`
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
|
||||||
|
#include <vips/vips8>
|
||||||
|
|
||||||
|
using namespace vips8;
|
||||||
|
|
||||||
|
int
|
||||||
|
main( int argc, char **argv )
|
||||||
|
{
|
||||||
|
GOptionContext *context;
|
||||||
|
GOptionGroup *main_group;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
if( vips_init( argv[0] ) )
|
||||||
|
vips_error_exit( NULL );
|
||||||
|
|
||||||
|
context = g_option_context_new( "" );
|
||||||
|
|
||||||
|
main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL );
|
||||||
|
g_option_context_set_main_group( context, main_group );
|
||||||
|
g_option_context_add_group( context, vips_get_option_group() );
|
||||||
|
|
||||||
|
if( !g_option_context_parse( context, &argc, &argv, &error ) ) {
|
||||||
|
if( error ) {
|
||||||
|
fprintf( stderr, "%s\n", error->message );
|
||||||
|
g_error_free( error );
|
||||||
|
}
|
||||||
|
|
||||||
|
vips_error_exit( NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
VImage in = VImage::new_from_file( argv[1],
|
||||||
|
VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) );
|
||||||
|
double avg;
|
||||||
|
|
||||||
|
avg = in.avg();
|
||||||
|
|
||||||
|
printf( "avg = %g\n", avg );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
VImage in = VImage::new_from_file( argv[1],
|
||||||
|
VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) );
|
||||||
|
|
||||||
|
VImage out = in.embed( 10, 10, 1000, 1000,
|
||||||
|
VImage::option()->set( "extend", VIPS_EXTEND_COPY ) );
|
||||||
|
|
||||||
|
out.write_to_file( "embed.jpg" );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
VImage in = VImage::new_from_file( argv[1],
|
||||||
|
VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) );
|
||||||
|
double a[] = { 1.0, 2.0, 3.0 };
|
||||||
|
double b[] = { 4.0, 5.0, 6.0 };
|
||||||
|
|
||||||
|
std::vector<double> avec( a, a + VIPS_NUMBER( a ) );
|
||||||
|
std::vector<double> bvec( b, b + VIPS_NUMBER( b ) );
|
||||||
|
|
||||||
|
VImage out = in.linear( avec, bvec );
|
||||||
|
|
||||||
|
out.write_to_file( "linear.jpg" );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
VImage in = VImage::new_from_file( argv[1],
|
||||||
|
VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) );
|
||||||
|
VImage out = in.linear( 1, 2 );
|
||||||
|
|
||||||
|
out.write_to_file( "linear1.jpg" );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
VImage in = VImage::new_from_file( argv[1] );
|
||||||
|
VImage out = in.new_from_image( 128 );
|
||||||
|
|
||||||
|
out.write_to_file( "const.jpg" );
|
||||||
|
}
|
||||||
|
|
||||||
|
vips_shutdown();
|
||||||
|
|
||||||
|
return( 0 );
|
||||||
|
}
|
|
@ -253,114 +253,136 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VipsImage *get_image()
|
VipsImage *
|
||||||
|
get_image()
|
||||||
{
|
{
|
||||||
return( (VipsImage *) VObject::get_object() );
|
return( (VipsImage *) VObject::get_object() );
|
||||||
}
|
}
|
||||||
|
|
||||||
int width()
|
int
|
||||||
|
width()
|
||||||
{
|
{
|
||||||
return( vips_image_get_width( get_image() ) );
|
return( vips_image_get_width( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int height()
|
int
|
||||||
|
height()
|
||||||
{
|
{
|
||||||
return( vips_image_get_height( get_image() ) );
|
return( vips_image_get_height( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int bands()
|
int
|
||||||
|
bands()
|
||||||
{
|
{
|
||||||
return( vips_image_get_bands( get_image() ) );
|
return( vips_image_get_bands( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VipsBandFormat format()
|
VipsBandFormat
|
||||||
|
format()
|
||||||
{
|
{
|
||||||
return( vips_image_get_format( get_image() ) );
|
return( vips_image_get_format( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VipsCoding coding()
|
VipsCoding
|
||||||
|
coding()
|
||||||
{
|
{
|
||||||
return( vips_image_get_coding( get_image() ) );
|
return( vips_image_get_coding( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VipsInterpretation interpretation()
|
VipsInterpretation
|
||||||
|
interpretation()
|
||||||
{
|
{
|
||||||
return( vips_image_get_interpretation( get_image() ) );
|
return( vips_image_get_interpretation( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VipsInterpretation guess_interpretation()
|
VipsInterpretation
|
||||||
|
guess_interpretation()
|
||||||
{
|
{
|
||||||
return( vips_image_guess_interpretation( get_image() ) );
|
return( vips_image_guess_interpretation( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double xres()
|
double
|
||||||
|
xres()
|
||||||
{
|
{
|
||||||
return( vips_image_get_xres( get_image() ) );
|
return( vips_image_get_xres( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double yres()
|
double
|
||||||
|
yres()
|
||||||
{
|
{
|
||||||
return( vips_image_get_yres( get_image() ) );
|
return( vips_image_get_yres( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double xoffset()
|
double
|
||||||
|
xoffset()
|
||||||
{
|
{
|
||||||
return( vips_image_get_xoffset( get_image() ) );
|
return( vips_image_get_xoffset( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double yoffset()
|
double
|
||||||
|
yoffset()
|
||||||
{
|
{
|
||||||
return( vips_image_get_yoffset( get_image() ) );
|
return( vips_image_get_yoffset( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *filename()
|
const char *
|
||||||
|
filename()
|
||||||
{
|
{
|
||||||
return( vips_image_get_filename( get_image() ) );
|
return( vips_image_get_filename( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double scale()
|
double
|
||||||
|
scale()
|
||||||
{
|
{
|
||||||
return( vips_image_get_scale( get_image() ) );
|
return( vips_image_get_scale( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
double offset()
|
double
|
||||||
|
offset()
|
||||||
{
|
{
|
||||||
return( vips_image_get_offset( get_image() ) );
|
return( vips_image_get_offset( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *data()
|
const void *
|
||||||
|
data()
|
||||||
{
|
{
|
||||||
return( vips_image_get_data( get_image() ) );
|
return( vips_image_get_data( get_image() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( const char *field, int value )
|
void
|
||||||
|
set( const char *field, int value )
|
||||||
{
|
{
|
||||||
vips_image_set_int( this->get_image(), field, value );
|
vips_image_set_int( this->get_image(), field, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( const char *field, double value )
|
void
|
||||||
|
set( const char *field, double value )
|
||||||
{
|
{
|
||||||
vips_image_set_double( this->get_image(), field, value );
|
vips_image_set_double( this->get_image(), field, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( const char *field, const char *value )
|
void
|
||||||
|
set( const char *field, const char *value )
|
||||||
{
|
{
|
||||||
vips_image_set_string( this->get_image(), field, value );
|
vips_image_set_string( this->get_image(), field, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
void set( const char *field,
|
void
|
||||||
|
set( const char *field,
|
||||||
VipsCallbackFn free_fn, void *data, size_t length )
|
VipsCallbackFn free_fn, void *data, size_t length )
|
||||||
{
|
{
|
||||||
vips_image_set_blob( this->get_image(), field,
|
vips_image_set_blob( this->get_image(), field,
|
||||||
free_fn, data, length );
|
free_fn, data, length );
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_typeof( const char *field )
|
int
|
||||||
|
get_typeof( const char *field )
|
||||||
{
|
{
|
||||||
return( vips_image_get_typeof( this->get_image(), field ) );
|
return( vips_image_get_typeof( this->get_image(), field ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_int( const char *field )
|
int
|
||||||
|
get_int( const char *field )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
|
@ -371,7 +393,8 @@ public:
|
||||||
return( value );
|
return( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
double get_double( const char *field )
|
double
|
||||||
|
get_double( const char *field )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
double value;
|
double value;
|
||||||
|
@ -382,7 +405,8 @@ public:
|
||||||
return( value );
|
return( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *get_string( const char *field )
|
const char *
|
||||||
|
get_string( const char *field )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
const char *value;
|
const char *value;
|
||||||
|
@ -393,7 +417,8 @@ public:
|
||||||
return( value );
|
return( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *get_blob( const char *field, size_t *length )
|
const void *
|
||||||
|
get_blob( const char *field, size_t *length )
|
||||||
{
|
{
|
||||||
void *value;
|
void *value;
|
||||||
|
|
||||||
|
@ -404,7 +429,8 @@ public:
|
||||||
return( value );
|
return( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOption *option()
|
static VOption *
|
||||||
|
option()
|
||||||
{
|
{
|
||||||
return( new VOption() );
|
return( new VOption() );
|
||||||
}
|
}
|
||||||
|
@ -431,20 +457,23 @@ public:
|
||||||
|
|
||||||
// a few useful things
|
// a few useful things
|
||||||
|
|
||||||
VImage linear( double a, double b, VOption *options = 0 )
|
VImage
|
||||||
|
linear( double a, double b, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( this->linear( to_vector( a ), to_vector( b ),
|
return( this->linear( to_vector( a ), to_vector( b ),
|
||||||
options ) );
|
options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage linear( std::vector<double> a, double b, VOption *options = 0 )
|
VImage
|
||||||
|
linear( std::vector<double> a, double b, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( this->linear( a, to_vector( b ), options ) );
|
return( this->linear( a, to_vector( b ), options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage linear( double a, std::vector<double> b, VOption *options = 0 )
|
VImage
|
||||||
|
linear( double a, std::vector<double> b, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( this->linear( to_vector( a ), b, options ) );
|
return( this->linear( to_vector( a ), b, options ) );
|
||||||
|
@ -455,12 +484,15 @@ public:
|
||||||
|
|
||||||
VImage bandjoin( VImage other, VOption *options = 0 )
|
VImage bandjoin( VImage other, VOption *options = 0 )
|
||||||
throw( VError );
|
throw( VError );
|
||||||
VImage bandjoin( double other, VOption *options = 0 )
|
VImage
|
||||||
|
bandjoin( double other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( bandjoin( this->new_from_image( other ), options ) );
|
return( bandjoin( this->new_from_image( other ), options ) );
|
||||||
}
|
}
|
||||||
VImage bandjoin( std::vector<double> other, VOption *options = 0 )
|
|
||||||
|
VImage
|
||||||
|
bandjoin( std::vector<double> other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( bandjoin( this->new_from_image( other ), options ) );
|
return( bandjoin( this->new_from_image( other ), options ) );
|
||||||
|
@ -472,169 +504,194 @@ public:
|
||||||
std::complex<double> maxpos( VOption *options = 0 )
|
std::complex<double> maxpos( VOption *options = 0 )
|
||||||
throw( VError );
|
throw( VError );
|
||||||
|
|
||||||
VImage floor( VOption *options = 0 )
|
VImage
|
||||||
|
floor( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( round( VIPS_OPERATION_ROUND_FLOOR, options ) );
|
return( round( VIPS_OPERATION_ROUND_FLOOR, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ceil( VOption *options = 0 )
|
VImage
|
||||||
|
ceil( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( round( VIPS_OPERATION_ROUND_CEIL, options ) );
|
return( round( VIPS_OPERATION_ROUND_CEIL, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage rint( VOption *options = 0 )
|
VImage
|
||||||
|
rint( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( round( VIPS_OPERATION_ROUND_RINT, options ) );
|
return( round( VIPS_OPERATION_ROUND_RINT, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage real( VOption *options = 0 )
|
VImage
|
||||||
|
real( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( complexget( VIPS_OPERATION_COMPLEXGET_REAL, options ) );
|
return( complexget( VIPS_OPERATION_COMPLEXGET_REAL, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage imag( VOption *options = 0 )
|
VImage
|
||||||
|
imag( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( complexget( VIPS_OPERATION_COMPLEXGET_IMAG, options ) );
|
return( complexget( VIPS_OPERATION_COMPLEXGET_IMAG, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage polar( VOption *options = 0 )
|
VImage
|
||||||
|
polar( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( complex( VIPS_OPERATION_COMPLEX_POLAR, options ) );
|
return( complex( VIPS_OPERATION_COMPLEX_POLAR, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage rect( VOption *options = 0 )
|
VImage
|
||||||
|
rect( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( complex( VIPS_OPERATION_COMPLEX_RECT, options ) );
|
return( complex( VIPS_OPERATION_COMPLEX_RECT, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage conj( VOption *options = 0 )
|
VImage
|
||||||
|
conj( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( complex( VIPS_OPERATION_COMPLEX_CONJ, options ) );
|
return( complex( VIPS_OPERATION_COMPLEX_CONJ, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage sin( VOption *options = 0 )
|
VImage
|
||||||
|
sin( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_SIN, options ) );
|
return( math( VIPS_OPERATION_MATH_SIN, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage cos( VOption *options = 0 )
|
VImage
|
||||||
|
cos( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_COS, options ) );
|
return( math( VIPS_OPERATION_MATH_COS, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage tan( VOption *options = 0 )
|
VImage
|
||||||
|
tan( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_TAN, options ) );
|
return( math( VIPS_OPERATION_MATH_TAN, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage asin( VOption *options = 0 )
|
VImage
|
||||||
|
asin( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_ASIN, options ) );
|
return( math( VIPS_OPERATION_MATH_ASIN, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage acos( VOption *options = 0 )
|
VImage
|
||||||
|
acos( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_ACOS, options ) );
|
return( math( VIPS_OPERATION_MATH_ACOS, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage atan( VOption *options = 0 )
|
VImage
|
||||||
|
atan( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_ATAN, options ) );
|
return( math( VIPS_OPERATION_MATH_ATAN, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage log( VOption *options = 0 )
|
VImage
|
||||||
|
log( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_LOG, options ) );
|
return( math( VIPS_OPERATION_MATH_LOG, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage log10( VOption *options = 0 )
|
VImage
|
||||||
|
log10( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_LOG10, options ) );
|
return( math( VIPS_OPERATION_MATH_LOG10, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage exp( VOption *options = 0 )
|
VImage
|
||||||
|
exp( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_EXP, options ) );
|
return( math( VIPS_OPERATION_MATH_EXP, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage exp10( VOption *options = 0 )
|
VImage
|
||||||
|
exp10( VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math( VIPS_OPERATION_MATH_EXP10, options ) );
|
return( math( VIPS_OPERATION_MATH_EXP10, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage pow( VImage other, VOption *options = 0 )
|
VImage
|
||||||
|
pow( VImage other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2( other, VIPS_OPERATION_MATH2_POW, options ) );
|
return( math2( other, VIPS_OPERATION_MATH2_POW, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage pow( double other, VOption *options = 0 )
|
VImage
|
||||||
|
pow( double other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2_const( to_vector( other ),
|
return( math2_const( to_vector( other ),
|
||||||
VIPS_OPERATION_MATH2_POW, options ) );
|
VIPS_OPERATION_MATH2_POW, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage pow( std::vector<double> other, VOption *options = 0 )
|
VImage
|
||||||
|
pow( std::vector<double> other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2_const( other,
|
return( math2_const( other,
|
||||||
VIPS_OPERATION_MATH2_POW, options ) );
|
VIPS_OPERATION_MATH2_POW, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage wop( VImage other, VOption *options = 0 )
|
VImage
|
||||||
|
wop( VImage other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2( other, VIPS_OPERATION_MATH2_WOP, options ) );
|
return( math2( other, VIPS_OPERATION_MATH2_WOP, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage wop( double other, VOption *options = 0 )
|
VImage
|
||||||
|
wop( double other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2_const( to_vector( other ),
|
return( math2_const( to_vector( other ),
|
||||||
VIPS_OPERATION_MATH2_WOP, options ) );
|
VIPS_OPERATION_MATH2_WOP, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage wop( std::vector<double> other, VOption *options = 0 )
|
VImage
|
||||||
|
wop( std::vector<double> other, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( math2_const( other,
|
return( math2_const( other,
|
||||||
VIPS_OPERATION_MATH2_WOP, options ) );
|
VIPS_OPERATION_MATH2_WOP, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( std::vector<double> th, VImage el,
|
VImage
|
||||||
VOption *options = 0 )
|
ifthenelse( std::vector<double> th, VImage el, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( ifthenelse( el.new_from_image( th ), el, options ) );
|
return( ifthenelse( el.new_from_image( th ), el, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( VImage th, std::vector<double> el,
|
VImage
|
||||||
VOption *options = 0 )
|
ifthenelse( VImage th, std::vector<double> el, VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( ifthenelse( th, th.new_from_image( el ), options ) );
|
return( ifthenelse( th, th.new_from_image( el ), options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( std::vector<double> th, std::vector<double> el,
|
VImage
|
||||||
|
ifthenelse( std::vector<double> th, std::vector<double> el,
|
||||||
VOption *options = 0 )
|
VOption *options = 0 )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
|
@ -642,19 +699,22 @@ public:
|
||||||
options ) );
|
options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( double th, VImage el, VOption *options )
|
VImage
|
||||||
|
ifthenelse( double th, VImage el, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( ifthenelse( to_vector( th ), el, options ) );
|
return( ifthenelse( to_vector( th ), el, options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( VImage th, double el, VOption *options )
|
VImage
|
||||||
|
ifthenelse( VImage th, double el, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( ifthenelse( th, to_vector( el ), options ) );
|
return( ifthenelse( th, to_vector( el ), options ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
VImage ifthenelse( double th, double el, VOption *options )
|
VImage
|
||||||
|
ifthenelse( double th, double el, VOption *options )
|
||||||
throw( VError )
|
throw( VError )
|
||||||
{
|
{
|
||||||
return( ifthenelse( to_vector( th ), to_vector( el ),
|
return( ifthenelse( to_vector( th ), to_vector( el ),
|
||||||
|
|
Loading…
Reference in New Issue