コード例 #1
0
static void dev_open_cb(struct fp_dev *dev, int status, void *user_data)
{
	struct fp_driver *drv;
	gchar *tmp;

	gtk_widget_destroy(GTK_WIDGET(user_data));
	fpdev = dev;

	fp_dscv_prints = fp_discover_prints();
	if (!fp_dscv_prints) {
		mwin_devstatus_update("Error loading enrolled prints.");
		/* FIXME error handling */
		return;
	}

	mwin_devstatus_update("Device ready for use.");

	drv = fp_dev_get_driver(fpdev);
	tmp = g_strdup_printf("<b>Driver:</b> %s", fp_driver_get_name(drv));
	gtk_label_set_markup(GTK_LABEL(mwin_drvname_label), tmp);
	g_free(tmp);

	if (fp_dev_supports_imaging(fpdev))
		gtk_label_set_markup(GTK_LABEL(mwin_imgcapa_label), "Imaging device");
	else
		gtk_label_set_markup(GTK_LABEL(mwin_imgcapa_label),
			"Non-imaging device");

	for_each_tab_call_op(activate_dev);
}
コード例 #2
0
ファイル: img.c プロジェクト: litlfred/fprint_demo
static void ewin_cb_export_clicked(GtkWidget *widget, gpointer data)
{
	struct fp_img *scan = NULL;
	int finger = GPOINTER_TO_INT(data);
	int r;
	char path[2048];
	sprintf(path,"captured_%d.pgm",finger);
	if (!fp_dev_supports_imaging(fpdev)) {
	  fprintf(stderr, "this device does not have imaging capabilities.\n");
	  return; 
	} 
	r = fp_dev_img_capture(fpdev,0,&scan);
	if (r != 0) {
	  fprintf(stderr,"Image Capture Failed: %d\n",r);
	  fp_img_free(scan);
	  return;
	}
	fp_img_standardize(scan);
	r = fp_img_save_to_file(scan,path);
	fp_img_free(scan);
	if (r != 0) {
	  fprintf(stderr,"Image Save Failed: %d\n",r);
	}
	return;

}
コード例 #3
0
ファイル: parmakfoto.c プロジェクト: dhirajkhatiwada1/uludag
struct fp_img* get_image(struct fp_dev* dev){
    if(!fp_dev_supports_imaging(dev)){
        printf("Okuyucuda imaging destegi yok ... :(\n");
        exit(1); //failure
    }

    struct fp_img* image = NULL;
    if(fp_dev_img_capture(dev, 0, &image)){ //0 on success
        printf("Resim alinamadi.\n");
        exit(1); //failure
    } 

    return image;
}
コード例 #4
0
ファイル: image.c プロジェクト: dhirajkhatiwada1/uludag
/**Helper: Read an image into a variable*/
struct fp_img* image_get(){
    //imaging supported?
    if(!fp_dev_supports_imaging(device)){
        pyfmsg(ERR_LFP_NOIMAGING, 1);
    }

    //capture image
    struct fp_img* image = NULL;
    if (fp_dev_img_capture(device, 0, &image)){
        pyfmsg(ERR_LFP_IMAGINGFAIL, 1);
    }

    return image;
}
コード例 #5
0
static void vwin_activate_dev(void)
{
	struct fp_dscv_print *print;
	int i = 0;
	g_assert(fpdev);
	g_assert(fp_dscv_prints);

	while ((print = fp_dscv_prints[i++])) {
		GtkTreeIter iter;
		int fnum;

		if (!fp_dev_supports_dscv_print(fpdev, print))
			continue;

		fnum = fp_dscv_print_get_finger(print);
		gtk_list_store_append(vwin_fingmodel, &iter);
		gtk_list_store_set(vwin_fingmodel, &iter, FC_COL_PRINT, print,
			FC_COL_FINGSTR, fingerstr(fnum), FC_COL_FINGNUM, fnum, -1);
	}

	gtk_widget_set_sensitive(vwin_fingcombo, TRUE);
	vwin_fingcombo_select_first();

	if (fp_dev_supports_imaging(fpdev)) {
		int width = fp_dev_get_img_width(fpdev);
		int height = fp_dev_get_img_height(fpdev);
		gtk_widget_set_size_request(vwin_verify_img,
			(width == 0) ? 192 : width,
			(height == 0) ? 192 : height);
		gtk_widget_hide(vwin_non_img_label);
		gtk_widget_show(vwin_verify_img);
		gtk_widget_set_sensitive(vwin_ctrl_frame, TRUE);
	} else {
		gtk_widget_show(vwin_non_img_label);
		gtk_widget_hide(vwin_verify_img);
		gtk_widget_set_sensitive(vwin_ctrl_frame, FALSE);
	}
}