当前位置: 首页>>代码示例>>C++>>正文


C++ VImage::embed方法代码示例

本文整理汇总了C++中VImage::embed方法的典型用法代码示例。如果您正苦于以下问题:C++ VImage::embed方法的具体用法?C++ VImage::embed怎么用?C++ VImage::embed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VImage的用法示例。


在下文中一共展示了VImage::embed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: return

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

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

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

	out.write_to_file( argv[2] );

	vips_shutdown();

        return( 0 );
}
开发者ID:jcupitt,项目名称:libvips,代码行数:18,代码来源:embed.cpp

示例2: bands

VImage 
VImage::new_from_image( std::vector<double> pixel )
{
	VImage onepx = VImage::black( 1, 1, 
		VImage::option()->set( "bands", bands() ) ); 

	onepx = onepx.linear( to_vectorv( 1, 1.0 ), pixel ).cast( format() );

	VImage big = onepx.embed( 0, 0, width(), height(), 
		VImage::option()->set( "extend", VIPS_EXTEND_COPY ) ); 

	big = big.copy( 
		VImage::option()->
			set( "interpretation", interpretation() )->
			set( "xres", xres() )->
			set( "yres", yres() )->
			set( "xoffset", xres() )->
			set( "yoffset", yres() ) ); 

	return( big ); 
}
开发者ID:One-com,项目名称:sharp,代码行数:21,代码来源:VImage.cpp

示例3: return

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 ) ); 

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

	out.write_to_file( argv[2] );
}

	vips_shutdown();

        return( 0 );
}
开发者ID:ChiaraCaiazza,项目名称:collageMaker,代码行数:40,代码来源:embed.cpp

示例4: avec

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 );
}
开发者ID:eeertekin,项目名称:libvips,代码行数:80,代码来源:try.cpp


注:本文中的VImage::embed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。