libvips/cplusplus/examples/resize.cpp

29 lines
514 B
C++
Raw Normal View History

2019-08-04 18:43:35 +02:00
/* compile with:
*
* g++ -g -Wall resize.cpp `pkg-config vips-cpp --cflags --libs`
*/
#include <vips/vips8>
using namespace vips;
int
main( int argc, char **argv )
{
2019-08-04 18:43:35 +02:00
if( VIPS_INIT( argv[0] ) )
vips_error_exit( NULL );
2019-08-04 18:43:35 +02:00
VImage in = VImage::new_from_file( argv[1], VImage::option()
->set( "access", "sequential" ) );
2019-08-04 18:43:35 +02:00
VImage out = in.resize( 0.2, VImage::option()
->set( "kernel", "cubic" )
->set( "vscale", 0.2 ) );
out.write_to_file( argv[2] );
vips_shutdown();
return( 0 );
}