コード例 #1
0
ファイル: im_png2vips.c プロジェクト: Ikulagin/transmem
/* Read a PNG file header into a VIPS header.
 */
static int
png2vips_header( const char *name, IMAGE *out )
{
	Read *read;

	if( !(read = read_new( name, out )) )
		return( -1 );

	if( png2vips( read, 1 ) ) {
		read_destroy( read );
		return( -1 );
	}

	read_destroy( read );

	return( 0 );
}
コード例 #2
0
ファイル: im_png2vips.c プロジェクト: Ikulagin/transmem
/**
 * im_png2vips:
 * @filename: file to load
 * @out: image to write to
 *
 * Read a PNG file into a VIPS image. It can read all png images, including 8-
 * and 16-bit images, 1 and 3 channel, with and without an alpha channel.
 *
 * There is no support for embedded ICC profiles.
 *
 * See also: #VipsFormat, im_vips2png().
 *
 * Returns: 0 on success, -1 on error.
 */
int
im_png2vips( const char *name, IMAGE *out )
{
	Read *read;

#ifdef DEBUG
	printf( "im_png2vips: reading \"%s\"\n", name );
#endif /*DEBUG*/

	if( !(read = read_new( name, out )) )
		return( -1 );

	if( png2vips( read, 0 ) ) {
		read_destroy( read );
		return( -1 );
	}

	read_destroy( read );

	return( 0 );
}
コード例 #3
0
ファイル: im_png2vips.c プロジェクト: achanda101/libvips
/* By having a separate header func, we get lazy.c to open via disc/mem.
 */
static int
im_png2vips_header( const char *name, IMAGE *out )
{
	return( png2vips( name, out, TRUE ) ); 
}
コード例 #4
0
ファイル: im_png2vips.c プロジェクト: achanda101/libvips
int
im_png2vips( const char *name, IMAGE *out )
{
	return( png2vips( name, out, FALSE ) ); 
}