2014-10-29 10:47:02 +01:00
|
|
|
/*
|
|
|
|
* compile with:
|
|
|
|
*
|
2015-01-06 12:51:53 +01:00
|
|
|
* g++ -g -Wall embed.cpp `pkg-config vips-cpp --cflags --libs`
|
2014-10-29 10:47:02 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define DEBUG
|
|
|
|
|
|
|
|
#include <vips/vips8>
|
|
|
|
|
2015-01-06 12:51:53 +01:00
|
|
|
using namespace vips;
|
2014-10-29 10:47:02 +01:00
|
|
|
|
|
|
|
int
|
|
|
|
main( int argc, char **argv )
|
|
|
|
{
|
|
|
|
if( vips_init( argv[0] ) )
|
|
|
|
vips_error_exit( NULL );
|
|
|
|
|
|
|
|
VImage in = VImage::new_from_file( argv[1],
|
2018-06-11 16:24:11 +02:00
|
|
|
VImage::option()->set( "access", "sequential" ) );
|
2014-10-29 10:47:02 +01:00
|
|
|
|
|
|
|
VImage out = in.embed( 10, 10, 1000, 1000,
|
2018-06-11 16:24:11 +02:00
|
|
|
VImage::option()->set( "extend", "copy" ) );
|
2014-10-29 10:47:02 +01:00
|
|
|
|
|
|
|
out.write_to_file( argv[2] );
|
|
|
|
|
|
|
|
vips_shutdown();
|
|
|
|
|
|
|
|
return( 0 );
|
|
|
|
}
|