Update C++ binding and function list

This commit is contained in:
Kleis Auke Wolthuizen 2020-06-18 14:45:14 +02:00
parent d67eca7b8a
commit e5323b070b
6 changed files with 227 additions and 22 deletions

View File

@ -28,10 +28,6 @@ import argparse
from pyvips import Introspect, Operation, GValue, Error, \ from pyvips import Introspect, Operation, GValue, Error, \
ffi, gobject_lib, type_map, type_from_name, nickname_find, type_name ffi, gobject_lib, type_map, type_from_name, nickname_find, type_name
# TODO Move to pyvips.GValue
source_type = type_from_name('VipsSource')
target_type = type_from_name('VipsTarget')
# turn a GType into a C++ type # turn a GType into a C++ type
gtype_to_cpp = { gtype_to_cpp = {
GValue.gbool_type: 'bool', GValue.gbool_type: 'bool',
@ -41,8 +37,8 @@ gtype_to_cpp = {
GValue.refstr_type: 'char *', GValue.refstr_type: 'char *',
GValue.gflags_type: 'int', GValue.gflags_type: 'int',
GValue.image_type: 'VImage', GValue.image_type: 'VImage',
source_type: 'VSource', GValue.source_type: 'VSource',
target_type: 'VTarget', GValue.target_type: 'VTarget',
GValue.array_int_type: 'std::vector<int>', GValue.array_int_type: 'std::vector<int>',
GValue.array_double_type: 'std::vector<double>', GValue.array_double_type: 'std::vector<double>',
GValue.array_image_type: 'std::vector<VImage>', GValue.array_image_type: 'std::vector<VImage>',

View File

@ -1,5 +1,5 @@
// headers for vips operations // headers for vips operations
// Wed 01 Jan 2020 12:22:11 PM CET // Thu 18 Jun 2020 01:19:31 PM CEST
// this file is generated automatically, do not edit! // this file is generated automatically, do not edit!
/** /**
@ -454,7 +454,7 @@ double countlines( VipsDirection direction, VOption *options = 0 ) const;
VImage crop( int left, int top, int width, int height, VOption *options = 0 ) const; VImage crop( int left, int top, int width, int height, VOption *options = 0 ) const;
/** /**
* Load csv from file. * Load csv.
* @param filename Filename to load from. * @param filename Filename to load from.
* @param options Optional options. * @param options Optional options.
* @return Output image. * @return Output image.
@ -462,12 +462,27 @@ VImage crop( int left, int top, int width, int height, VOption *options = 0 ) co
static VImage csvload( const char *filename, VOption *options = 0 ); static VImage csvload( const char *filename, VOption *options = 0 );
/** /**
* Save image to csv file. * Load csv.
* @param source Source to load from.
* @param options Optional options.
* @return Output image.
*/
static VImage csvload_source( VSource source, VOption *options = 0 );
/**
* Save image to csv.
* @param filename Filename to save to. * @param filename Filename to save to.
* @param options Optional options. * @param options Optional options.
*/ */
void csvsave( const char *filename, VOption *options = 0 ) const; void csvsave( const char *filename, VOption *options = 0 ) const;
/**
* Save image to csv.
* @param target Target to save to.
* @param options Optional options.
*/
void csvsave_target( VTarget target, VOption *options = 0 ) const;
/** /**
* Calculate de00. * Calculate de00.
* @param right Right-hand input image. * @param right Right-hand input image.
@ -782,6 +797,14 @@ static VImage gifload( const char *filename, VOption *options = 0 );
*/ */
static VImage gifload_buffer( VipsBlob *buffer, VOption *options = 0 ); static VImage gifload_buffer( VipsBlob *buffer, VOption *options = 0 );
/**
* Load gif with giflib.
* @param source Source to load from.
* @param options Optional options.
* @return Output image.
*/
static VImage gifload_source( VSource source, VOption *options = 0 );
/** /**
* Global balance an image mosaic. * Global balance an image mosaic.
* @param options Optional options. * @param options Optional options.
@ -834,6 +857,14 @@ static VImage heifload( const char *filename, VOption *options = 0 );
*/ */
static VImage heifload_buffer( VipsBlob *buffer, VOption *options = 0 ); static VImage heifload_buffer( VipsBlob *buffer, VOption *options = 0 );
/**
* Load a heif image.
* @param source Source to load from.
* @param options Optional options.
* @return Output image.
*/
static VImage heifload_source( VSource source, VOption *options = 0 );
/** /**
* Save image in heif format. * Save image in heif format.
* @param filename Filename to load from. * @param filename Filename to load from.
@ -848,6 +879,13 @@ void heifsave( const char *filename, VOption *options = 0 ) const;
*/ */
VipsBlob *heifsave_buffer( VOption *options = 0 ) const; VipsBlob *heifsave_buffer( VOption *options = 0 ) const;
/**
* Save image in heif format.
* @param target Target to save to.
* @param options Optional options.
*/
void heifsave_target( VTarget target, VOption *options = 0 ) const;
/** /**
* Form cumulative histogram. * Form cumulative histogram.
* @param options Optional options. * @param options Optional options.
@ -1319,13 +1357,28 @@ VImage math2_const( VipsOperationMath2 math2, std::vector<double> c, VOption *op
static VImage matload( const char *filename, VOption *options = 0 ); static VImage matload( const char *filename, VOption *options = 0 );
/** /**
* Load matrix from file. * Invert an matrix.
* @param options Optional options.
* @return Output image.
*/
VImage matrixinvert( VOption *options = 0 ) const;
/**
* Load matrix.
* @param filename Filename to load from. * @param filename Filename to load from.
* @param options Optional options. * @param options Optional options.
* @return Output image. * @return Output image.
*/ */
static VImage matrixload( const char *filename, VOption *options = 0 ); static VImage matrixload( const char *filename, VOption *options = 0 );
/**
* Load matrix.
* @param source Source to load from.
* @param options Optional options.
* @return Output image.
*/
static VImage matrixload_source( VSource source, VOption *options = 0 );
/** /**
* Print matrix. * Print matrix.
* @param options Optional options. * @param options Optional options.
@ -1333,12 +1386,19 @@ static VImage matrixload( const char *filename, VOption *options = 0 );
void matrixprint( VOption *options = 0 ) const; void matrixprint( VOption *options = 0 ) const;
/** /**
* Save image to matrix file. * Save image to matrix.
* @param filename Filename to save to. * @param filename Filename to save to.
* @param options Optional options. * @param options Optional options.
*/ */
void matrixsave( const char *filename, VOption *options = 0 ) const; void matrixsave( const char *filename, VOption *options = 0 ) const;
/**
* Save image to matrix.
* @param target Target to save to.
* @param options Optional options.
*/
void matrixsave_target( VTarget target, VOption *options = 0 ) const;
/** /**
* Find image maximum. * Find image maximum.
* @param options Optional options. * @param options Optional options.
@ -1459,7 +1519,7 @@ static VImage openexrload( const char *filename, VOption *options = 0 );
static VImage openslideload( const char *filename, VOption *options = 0 ); static VImage openslideload( const char *filename, VOption *options = 0 );
/** /**
* Load pdf with libpoppler. * Load pdf from file.
* @param filename Filename to load from. * @param filename Filename to load from.
* @param options Optional options. * @param options Optional options.
* @return Output image. * @return Output image.
@ -1467,13 +1527,21 @@ static VImage openslideload( const char *filename, VOption *options = 0 );
static VImage pdfload( const char *filename, VOption *options = 0 ); static VImage pdfload( const char *filename, VOption *options = 0 );
/** /**
* Load pdf with libpoppler. * Load pdf from buffer.
* @param buffer Buffer to load from. * @param buffer Buffer to load from.
* @param options Optional options. * @param options Optional options.
* @return Output image. * @return Output image.
*/ */
static VImage pdfload_buffer( VipsBlob *buffer, VOption *options = 0 ); static VImage pdfload_buffer( VipsBlob *buffer, VOption *options = 0 );
/**
* Load pdf from source.
* @param source Source to load from.
* @param options Optional options.
* @return Output image.
*/
static VImage pdfload_source( VSource source, VOption *options = 0 );
/** /**
* Find threshold for percent of pixels. * Find threshold for percent of pixels.
* @param percent Percent of pixels. * @param percent Percent of pixels.

View File

@ -1,5 +1,5 @@
// bodies for vips operations // bodies for vips operations
// Wed 01 Jan 2020 12:22:12 PM CET // Thu 18 Jun 2020 01:19:31 PM CEST
// this file is generated automatically, do not edit! // this file is generated automatically, do not edit!
VImage VImage::CMC2LCh( VOption *options ) const VImage VImage::CMC2LCh( VOption *options ) const
@ -754,6 +754,18 @@ VImage VImage::csvload( const char *filename, VOption *options )
return( out ); return( out );
} }
VImage VImage::csvload_source( VSource source, VOption *options )
{
VImage out;
call( "csvload_source",
(options ? options : VImage::option())->
set( "out", &out )->
set( "source", source ) );
return( out );
}
void VImage::csvsave( const char *filename, VOption *options ) const void VImage::csvsave( const char *filename, VOption *options ) const
{ {
call( "csvsave", call( "csvsave",
@ -762,6 +774,14 @@ void VImage::csvsave( const char *filename, VOption *options ) const
set( "filename", filename ) ); set( "filename", filename ) );
} }
void VImage::csvsave_target( VTarget target, VOption *options ) const
{
call( "csvsave_target",
(options ? options : VImage::option())->
set( "in", *this )->
set( "target", target ) );
}
VImage VImage::dE00( VImage right, VOption *options ) const VImage VImage::dE00( VImage right, VOption *options ) const
{ {
VImage out; VImage out;
@ -1218,6 +1238,18 @@ VImage VImage::gifload_buffer( VipsBlob *buffer, VOption *options )
return( out ); return( out );
} }
VImage VImage::gifload_source( VSource source, VOption *options )
{
VImage out;
call( "gifload_source",
(options ? options : VImage::option())->
set( "out", &out )->
set( "source", source ) );
return( out );
}
VImage VImage::globalbalance( VOption *options ) const VImage VImage::globalbalance( VOption *options ) const
{ {
VImage out; VImage out;
@ -1297,6 +1329,18 @@ VImage VImage::heifload_buffer( VipsBlob *buffer, VOption *options )
return( out ); return( out );
} }
VImage VImage::heifload_source( VSource source, VOption *options )
{
VImage out;
call( "heifload_source",
(options ? options : VImage::option())->
set( "out", &out )->
set( "source", source ) );
return( out );
}
void VImage::heifsave( const char *filename, VOption *options ) const void VImage::heifsave( const char *filename, VOption *options ) const
{ {
call( "heifsave", call( "heifsave",
@ -1317,6 +1361,14 @@ VipsBlob *VImage::heifsave_buffer( VOption *options ) const
return( buffer ); return( buffer );
} }
void VImage::heifsave_target( VTarget target, VOption *options ) const
{
call( "heifsave_target",
(options ? options : VImage::option())->
set( "in", *this )->
set( "target", target ) );
}
VImage VImage::hist_cum( VOption *options ) const VImage VImage::hist_cum( VOption *options ) const
{ {
VImage out; VImage out;
@ -2028,6 +2080,18 @@ VImage VImage::matload( const char *filename, VOption *options )
return( out ); return( out );
} }
VImage VImage::matrixinvert( VOption *options ) const
{
VImage out;
call( "matrixinvert",
(options ? options : VImage::option())->
set( "in", *this )->
set( "out", &out ) );
return( out );
}
VImage VImage::matrixload( const char *filename, VOption *options ) VImage VImage::matrixload( const char *filename, VOption *options )
{ {
VImage out; VImage out;
@ -2040,6 +2104,18 @@ VImage VImage::matrixload( const char *filename, VOption *options )
return( out ); return( out );
} }
VImage VImage::matrixload_source( VSource source, VOption *options )
{
VImage out;
call( "matrixload_source",
(options ? options : VImage::option())->
set( "out", &out )->
set( "source", source ) );
return( out );
}
void VImage::matrixprint( VOption *options ) const void VImage::matrixprint( VOption *options ) const
{ {
call( "matrixprint", call( "matrixprint",
@ -2055,6 +2131,14 @@ void VImage::matrixsave( const char *filename, VOption *options ) const
set( "filename", filename ) ); set( "filename", filename ) );
} }
void VImage::matrixsave_target( VTarget target, VOption *options ) const
{
call( "matrixsave_target",
(options ? options : VImage::option())->
set( "in", *this )->
set( "target", target ) );
}
double VImage::max( VOption *options ) const double VImage::max( VOption *options ) const
{ {
double out; double out;
@ -2256,6 +2340,18 @@ VImage VImage::pdfload_buffer( VipsBlob *buffer, VOption *options )
return( out ); return( out );
} }
VImage VImage::pdfload_source( VSource source, VOption *options )
{
VImage out;
call( "pdfload_source",
(options ? options : VImage::option())->
set( "out", &out )->
set( "source", source ) );
return( out );
}
int VImage::percent( double percent, VOption *options ) const int VImage::percent( double percent, VOption *options ) const
{ {
int threshold; int threshold;

View File

@ -363,14 +363,24 @@
</row> </row>
<row> <row>
<entry>csvload</entry> <entry>csvload</entry>
<entry>Load csv from file</entry> <entry>Load csv</entry>
<entry>vips_csvload()</entry> <entry>vips_csvload()</entry>
</row> </row>
<row>
<entry>csvload_source</entry>
<entry>Load csv</entry>
<entry>vips_csvload_source()</entry>
</row>
<row> <row>
<entry>csvsave</entry> <entry>csvsave</entry>
<entry>Save image to csv file</entry> <entry>Save image to csv</entry>
<entry>vips_csvsave()</entry> <entry>vips_csvsave()</entry>
</row> </row>
<row>
<entry>csvsave_target</entry>
<entry>Save image to csv</entry>
<entry>vips_csvsave_target()</entry>
</row>
<row> <row>
<entry>dE00</entry> <entry>dE00</entry>
<entry>Calculate de00</entry> <entry>Calculate de00</entry>
@ -556,6 +566,11 @@
<entry>Load gif with giflib</entry> <entry>Load gif with giflib</entry>
<entry>vips_gifload_buffer()</entry> <entry>vips_gifload_buffer()</entry>
</row> </row>
<row>
<entry>gifload_source</entry>
<entry>Load gif with giflib</entry>
<entry>vips_gifload_source()</entry>
</row>
<row> <row>
<entry>globalbalance</entry> <entry>globalbalance</entry>
<entry>Global balance an image mosaic</entry> <entry>Global balance an image mosaic</entry>
@ -586,6 +601,11 @@
<entry>Load a heif image</entry> <entry>Load a heif image</entry>
<entry>vips_heifload_buffer()</entry> <entry>vips_heifload_buffer()</entry>
</row> </row>
<row>
<entry>heifload_source</entry>
<entry>Load a heif image</entry>
<entry>vips_heifload_source()</entry>
</row>
<row> <row>
<entry>heifsave</entry> <entry>heifsave</entry>
<entry>Save image in heif format</entry> <entry>Save image in heif format</entry>
@ -596,6 +616,11 @@
<entry>Save image in heif format</entry> <entry>Save image in heif format</entry>
<entry>vips_heifsave_buffer()</entry> <entry>vips_heifsave_buffer()</entry>
</row> </row>
<row>
<entry>heifsave_target</entry>
<entry>Save image in heif format</entry>
<entry>vips_heifsave_target()</entry>
</row>
<row> <row>
<entry>hist_cum</entry> <entry>hist_cum</entry>
<entry>Form cumulative histogram</entry> <entry>Form cumulative histogram</entry>
@ -871,11 +896,21 @@
<entry>Load mat from file</entry> <entry>Load mat from file</entry>
<entry>vips_matload()</entry> <entry>vips_matload()</entry>
</row> </row>
<row>
<entry>matrixinvert</entry>
<entry>Invert an matrix</entry>
<entry>vips_matrixinvert()</entry>
</row>
<row> <row>
<entry>matrixload</entry> <entry>matrixload</entry>
<entry>Load matrix from file</entry> <entry>Load matrix</entry>
<entry>vips_matrixload()</entry> <entry>vips_matrixload()</entry>
</row> </row>
<row>
<entry>matrixload_source</entry>
<entry>Load matrix</entry>
<entry>vips_matrixload_source()</entry>
</row>
<row> <row>
<entry>matrixprint</entry> <entry>matrixprint</entry>
<entry>Print matrix</entry> <entry>Print matrix</entry>
@ -883,9 +918,14 @@
</row> </row>
<row> <row>
<entry>matrixsave</entry> <entry>matrixsave</entry>
<entry>Save image to matrix file</entry> <entry>Save image to matrix</entry>
<entry>vips_matrixsave()</entry> <entry>vips_matrixsave()</entry>
</row> </row>
<row>
<entry>matrixsave_target</entry>
<entry>Save image to matrix</entry>
<entry>vips_matrixsave_target()</entry>
</row>
<row> <row>
<entry>max</entry> <entry>max</entry>
<entry>Find image maximum</entry> <entry>Find image maximum</entry>
@ -953,14 +993,19 @@
</row> </row>
<row> <row>
<entry>pdfload</entry> <entry>pdfload</entry>
<entry>Load pdf with libpoppler</entry> <entry>Load pdf from file</entry>
<entry>vips_pdfload()</entry> <entry>vips_pdfload()</entry>
</row> </row>
<row> <row>
<entry>pdfload_buffer</entry> <entry>pdfload_buffer</entry>
<entry>Load pdf with libpoppler</entry> <entry>Load pdf from buffer</entry>
<entry>vips_pdfload_buffer()</entry> <entry>vips_pdfload_buffer()</entry>
</row> </row>
<row>
<entry>pdfload_source</entry>
<entry>Load pdf from source</entry>
<entry>vips_pdfload_source()</entry>
</row>
<row> <row>
<entry>percent</entry> <entry>percent</entry>
<entry>Find threshold for percent of pixels</entry> <entry>Find threshold for percent of pixels</entry>

View File

@ -98,7 +98,7 @@ typedef struct _VipsForeignLoadCsv {
typedef VipsForeignLoadClass VipsForeignLoadCsvClass; typedef VipsForeignLoadClass VipsForeignLoadCsvClass;
G_DEFINE_TYPE( VipsForeignLoadCsv, vips_foreign_load_csv, G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadCsv, vips_foreign_load_csv,
VIPS_TYPE_FOREIGN_LOAD ); VIPS_TYPE_FOREIGN_LOAD );
static void static void

View File

@ -71,7 +71,7 @@ typedef struct _VipsForeignLoadMatrix {
typedef VipsForeignLoadClass VipsForeignLoadMatrixClass; typedef VipsForeignLoadClass VipsForeignLoadMatrixClass;
G_DEFINE_TYPE( VipsForeignLoadMatrix, vips_foreign_load_matrix, G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadMatrix, vips_foreign_load_matrix,
VIPS_TYPE_FOREIGN_LOAD ); VIPS_TYPE_FOREIGN_LOAD );
static void static void