Exemple #1
0
VImage 
operator+( const VImage a, const std::vector<double> b ) 
{ 
	return( a.linear( 1.0, b ) ); 
}
Exemple #2
0
VImage 
operator>=( VImage a, double b ) 
{ 
	return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, 
		to_vector( b ) ) ); 
}
Exemple #3
0
VImage 
operator>=( VImage a, std::vector<double> b ) 
{ 
	return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, 
		b ) );
}
Exemple #4
0
int
main( int argc, char **argv )
{
	GOptionContext *context;
	GOptionGroup *main_group;
	GError *error = NULL;

	if( vips_init( argv[0] ) )
		vips_error_exit( NULL ); 

	context = g_option_context_new( "" ); 

	main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL );
	g_option_context_set_main_group( context, main_group );
	g_option_context_add_group( context, vips_get_option_group() );

	if( !g_option_context_parse( context, &argc, &argv, &error ) ) {
		if( error ) {
			fprintf( stderr, "%s\n", error->message );
			g_error_free( error );
		}

		vips_error_exit( NULL );
	}


{ 
	VImage in = VImage::new_from_file( argv[1], 
		VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) ); 
	double avg;

	avg = in.avg(); 

	printf( "avg = %g\n", avg ); 
}

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

	VImage out = in.embed( 10, 10, 1000, 1000, 
		VImage::option()->set( "extend", VIPS_EXTEND_BACKGROUND )->
		set( "background", 128 ) );

	out.write_to_file( "embed.jpg" );
}

{ 
	VImage in = VImage::new_from_file( argv[1], 
		VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) ); 
	double a[] = { 1.0, 2.0, 3.0 }; 
	double b[] = { 4.0, 5.0, 6.0 }; 

	std::vector<double> avec( a, a + VIPS_NUMBER( a ) ); 
	std::vector<double> bvec( b, b + VIPS_NUMBER( b ) ); 

	VImage out = in.linear( avec, bvec ); 

	out.write_to_file( "linear.jpg" );
}

{ 
	VImage in = VImage::new_from_file( argv[1], 
		VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED ) ); 
	VImage out = in.linear( 1, 2 ); 

	out.write_to_file( "linear1.jpg" );
}

{ 
	VImage in = VImage::new_from_file( argv[1] ); 
	VImage out = in.new_from_image( 128 );

	out.write_to_file( "const.jpg" );
}

	vips_shutdown();

        return( 0 );
}
Exemple #5
0
VImage 
operator>=( VImage a, VImage b ) 
{
	return( a.relational( b, VIPS_OPERATION_RELATIONAL_MOREEQ ) );
}
Exemple #6
0
VImage 
operator%( const VImage a, const double b ) 
{ 
	return( a.remainder_const( to_vector( b ) ) ); 
}
Exemple #7
0
VImage 
operator<( const VImage a, const VImage b ) 
{
	return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESS ) );
}
Exemple #8
0
VImage 
operator*( const VImage a, const VImage b ) 
{
	return( a.multiply( b ) );
}
Exemple #9
0
VImage 
operator*( double a, const VImage b ) 
{
	return( b.linear( a, 0.0 ) ); 
}
Exemple #10
0
VImage 
operator-( const std::vector<double> a, const VImage b ) 
{
	return( b.linear( -1.0, a ) ); 
}
Exemple #11
0
VImage 
operator-( const VImage a, const std::vector<double> b ) 
{ 
	return( a.linear( 1.0, vips::negate( b ) ) ); 
}
Exemple #12
0
VImage 
operator-( const VImage a, double b ) 
{ 
	return( a.linear( 1.0, -b ) ); 
}
Exemple #13
0
VImage 
operator-( double a, const VImage b ) 
{
	return( b.linear( -1.0, a ) ); 
}
Exemple #14
0
VImage 
operator-( const VImage a, const VImage b ) 
{
	return( a.subtract( b ) );
}
Exemple #15
0
VImage 
operator/( const VImage a, const std::vector<double> b ) 
{ 
	return( a.linear( vips::invert( b ), 0.0 ) ); 
}
Exemple #16
0
VImage 
operator*( const VImage a, double b ) 
{ 
	return( a.linear( b, 0.0 ) ); 
}
Exemple #17
0
VImage 
operator%( const VImage a, const VImage b ) 
{
	return( a.remainder( b ) );
}
Exemple #18
0
VImage 
operator*( const std::vector<double> a, const VImage b ) 
{
	return( b.linear( a, 0.0 ) ); 
}
Exemple #19
0
VImage 
operator%( const VImage a, const std::vector<double> b ) 
{ 
	return( a.remainder_const( b ) ); 
}
Exemple #20
0
VImage 
operator*( const VImage a, const std::vector<double> b ) 
{ 
	return( a.linear( b, 0.0 ) ); 
}
Exemple #21
0
VImage 
operator<( const double a, const VImage b ) 
{
	return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE, 
		to_vector( a ) ) ); 
}
Exemple #22
0
VImage 
operator/( const VImage a, const VImage b ) 
{
	return( a.divide( b ) );
}
Exemple #23
0
VImage 
operator<=( VImage a, VImage b ) 
{
	return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESSEQ ) );
}
Exemple #24
0
VImage 
operator/( double a, const VImage b ) 
{
	return( b.pow( -1.0 ).linear( a, 0.0 ) ); 
}
Exemple #25
0
VImage 
operator>=( double a, VImage b ) 
{
	return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, 
		to_vector( a ) ) );  
}
Exemple #26
0
VImage 
operator/( const VImage a, double b ) 
{ 
	return( a.linear( 1.0 / b, 0.0 ) ); 
}
Exemple #27
0
VImage 
operator>=( std::vector<double> a, VImage b ) 
{
	return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, 
		a ) );
}
Exemple #28
0
VImage 
operator/( const std::vector<double> a, const VImage b ) 
{
	return( b.pow( -1.0 ).linear( a, 0.0 ) ); 
}
Exemple #29
0
VImage 
operator==( VImage a, VImage b ) 
{
	return( a.relational( b, VIPS_OPERATION_RELATIONAL_EQUAL ) );
}
Exemple #30
0
VImage 
operator+( const VImage a, const VImage b )
{
	return( a.add( b ) );
}