Exemplo n.º 1
0
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 ); 
}
Exemplo n.º 2
0
std::vector<double> 
to_vector( double value )
{
	return( to_vectorv( 1, value ) );
}
Exemplo n.º 3
0
VImage 
VImage::new_from_image( double pixel )
	throw( VError )
{
	return( new_from_image( to_vectorv( 1, pixel ) ) ); 
}