コード例 #1
0
ファイル: rpexpose.c プロジェクト: chaosgame/rpexpose
int rpexpose_generate(){
	g.x.display = XOpenDisplay(getenv("DISPLAY"));

	Window window;
	
	char filename[BUFFER_SIZE];

	sprintf(filename,"%s/.rpexpose/",g.file.home);

	DIR *directory = opendir(filename);
	if(!directory){
		assert( mkdir(filename,0755), "Could not create directory" );
	}else{
		closedir(directory);
	}

	while(!feof(g.file.handle)){
		fscanf(g.file.handle,"%i\n",&window);
		XImage *thumbnail=thumbnail_generate(window);

		sprintf(filename, "%s/.rpexpose/%i", g.file.home, window);
		thumbnail_write(thumbnail,filename);
		XDestroyImage(thumbnail);
	}

	XCloseDisplay(g.x.display);
	return 0;
}
コード例 #2
0
ファイル: vipsthumbnail.c プロジェクト: Korf74/libvips
static int
thumbnail_process( VipsObject *process, const char *filename )
{
	VipsImage *in;
	VipsImage *thumbnail;
	VipsImage *crop;
	VipsImage *rotate;

	if( !(in = thumbnail_open( process, filename )) ||
		!(thumbnail = thumbnail_shrink( process, in )) ||
		!(crop = thumbnail_crop( process, thumbnail )) ||
		!(rotate = thumbnail_rotate( process, crop )) ||
		thumbnail_write( process, rotate, filename ) )
		return( -1 );

	return( 0 );
}
コード例 #3
0
ファイル: vipsthumbnail.c プロジェクト: gxliu/libvips
static int
thumbnail_process( VipsObject *process, const char *filename )
{
	VipsImage *in;
	VipsInterpolate *interp;
	VipsImage *sharpen;
	VipsImage *thumbnail;
	VipsImage *crop;

	if( !(in = thumbnail_open( process, filename )) ||
		!(interp = thumbnail_interpolator( process, in )) ||
		!(sharpen = thumbnail_sharpen( process )) ||
		!(thumbnail = 
			thumbnail_shrink( process, in, interp, sharpen )) ||
		!(crop = thumbnail_crop( process, thumbnail )) ||
		thumbnail_write( crop, filename ) )
		return( -1 );

	return( 0 );
}