Skip to content
Permalink
Browse files

update resize C++ example

  • Loading branch information...
jcupitt committed Aug 4, 2019
1 parent f472df4 commit 503e83e23211764670c1ed32424d7f053e825a91
Showing with 7 additions and 12 deletions.
  1. +7 −12 cplusplus/examples/resize.cpp
@@ -1,29 +1,24 @@
/*
* compile with:
/* compile with:
*
* g++ -g -Wall resize.cpp `pkg-config vips-cpp --cflags --libs`
*
*/

#define DEBUG

#include <vips/vips8>

using namespace vips;

int
main( int argc, char **argv )
{
if( vips_init( argv[0] ) )
if( VIPS_INIT( argv[0] ) )
vips_error_exit( NULL );

VImage in = VImage::new_from_file( argv[1],
VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL ) );
VInterpolate interp = VInterpolate::new_from_name( "nohalo" );

VImage out;
VImage in = VImage::new_from_file( argv[1], VImage::option()
->set( "access", "sequential" ) );

out = in.resize( 0.2, VImage::option()->set( "interpolate", interp ) );
VImage out = in.resize( 0.2, VImage::option()
->set( "kernel", "cubic" )
->set( "vscale", 0.2 ) );

out.write_to_file( argv[2] );

0 comments on commit 503e83e

Please sign in to comment.
You can’t perform that action at this time.