diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index 0c51de82..3e67896b 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -357,6 +357,13 @@ public: vips_image_set_array_int( this->get_image(), field, value, n ); } + void + set( const char *field, std::vector value ) + { + vips_image_set_array_int( this->get_image(), field, &value[0], + static_cast( value.size() ) ); + } + void set( const char *field, double value ) { @@ -401,6 +408,20 @@ public: throw( VError() ); } + std::vector + get_array_int( const char *field ) const + { + int length; + int *array; + + if( vips_image_get_array_int( this->get_image(), field, &array, &length ) ) + throw( VError() ); + + std::vector vector( array, array + length ); + + return( vector ); + } + double get_double( const char *field ) const {